Skip to content

Commit 1a6ffc6

Browse files
committed
ci: combine and export RUSTFLAGS rather than passing inline
This cleans things up and allows us to pass more flags externally.
1 parent 8e828e9 commit 1a6ffc6

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

ci/build.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ test_target() {
2323
target="${2}"
2424
no_std="${3}"
2525

26+
RUSTFLAGS="${RUSTFLAGS:-}"
27+
2628
# If there is a std component, fetch it:
2729
if [ "${no_std}" != "1" ]; then
2830
# FIXME: rustup often fails to download some artifacts due to network
@@ -36,15 +38,17 @@ test_target() {
3638
n=$((n+1))
3739
sleep 1
3840
done
41+
42+
# FIXME: With `build-std` feature, `compiler_builtins` emits a lof of lint warnings.
43+
RUSTFLAGS="${RUSTFLAGS:-} -Aimproper_ctypes_definitions"
44+
export RUSTFLAGS
3945
fi
4046

4147
# Test that libc builds without any default features (no std)
4248
if [ "$no_std" != "1" ]; then
4349
cargo "+$rust" "$build_cmd" --no-default-features --target "$target"
4450
else
45-
# FIXME: With `build-std` feature, `compiler_builtins` emits a lof of lint warnings.
46-
RUSTFLAGS="-A improper_ctypes_definitions" \
47-
cargo "+$rust" "$build_cmd" \
51+
cargo "+$rust" "$build_cmd" \
4852
-Z build-std=core,alloc \
4953
--no-default-features \
5054
--target "$target"
@@ -55,8 +59,7 @@ test_target() {
5559
if [ "$no_std" != "1" ]; then
5660
cargo "+$rust" "$build_cmd" --target "$target"
5761
else
58-
RUSTFLAGS="-A improper_ctypes_definitions" \
59-
cargo "+$rust" "${build_cmd}" \
62+
cargo "+$rust" "${build_cmd}" \
6063
-Z build-std=core,alloc \
6164
--target "$target"
6265
fi
@@ -68,8 +71,7 @@ test_target() {
6871
--features extra_traits \
6972
--target "$target"
7073
else
71-
RUSTFLAGS="-A improper_ctypes_definitions" \
72-
cargo "+$rust" "$build_cmd" \
74+
cargo "+$rust" "$build_cmd" \
7375
-Z build-std=core,alloc \
7476
--no-default-features \
7577
--features extra_traits \
@@ -84,8 +86,7 @@ test_target() {
8486
--features const-extern-fn \
8587
--target "$target"
8688
else
87-
RUSTFLAGS="-A improper_ctypes_definitions" \
88-
cargo "+$rust" "$build_cmd" \
89+
cargo "+$rust" "$build_cmd" \
8990
-Z build-std=core,alloc \
9091
--no-default-features \
9192
--features const-extern-fn \
@@ -99,8 +100,7 @@ test_target() {
99100
--target "$target" \
100101
--features extra_traits
101102
else
102-
RUSTFLAGS="-A improper_ctypes_definitions" \
103-
cargo "+$rust" "$build_cmd" \
103+
cargo "+$rust" "$build_cmd" \
104104
-Z build-std=core,alloc \
105105
--target "$target" \
106106
--features extra_traits

0 commit comments

Comments
 (0)