Skip to content

Commit ce105a4

Browse files
committed
Clean up and rework CI script
1 parent 351d48e commit ce105a4

File tree

6 files changed

+32
-31
lines changed

6 files changed

+32
-31
lines changed

.github/workflows/main.yml

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ jobs:
66
name: Test
77
runs-on: ${{ matrix.os }}
88
strategy:
9+
fail-fast: false
910
matrix:
1011
include:
1112
- target: aarch64-unknown-linux-gnu

ci/docker/thumbv6m-none-eabi/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ RUN apt-get update && \
44
gcc libc6-dev ca-certificates \
55
gcc-arm-none-eabi \
66
libnewlib-arm-none-eabi
7-
ENV XARGO=1
7+
ENV NO_STD=1

ci/docker/thumbv7em-none-eabi/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ RUN apt-get update && \
44
gcc libc6-dev ca-certificates \
55
gcc-arm-none-eabi \
66
libnewlib-arm-none-eabi
7-
ENV XARGO=1
7+
ENV NO_STD=1

ci/docker/thumbv7em-none-eabihf/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ RUN apt-get update && \
44
gcc libc6-dev ca-certificates \
55
gcc-arm-none-eabi \
66
libnewlib-arm-none-eabi
7-
ENV XARGO=1
7+
ENV NO_STD=1

ci/docker/thumbv7m-none-eabi/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ RUN apt-get update && \
44
gcc libc6-dev ca-certificates \
55
gcc-arm-none-eabi \
66
libnewlib-arm-none-eabi
7-
ENV XARGO=1
7+
ENV NO_STD=1

ci/run.sh

+27-27
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
set -ex
22

3-
cargo=cargo
4-
53
# Test our implementation
6-
if [ "$XARGO" = "1" ]; then
7-
# FIXME: currently these tests don't work...
4+
if [ "$NO_STD" = "1" ]; then
85
echo nothing to do
96
else
107
run="cargo test --manifest-path testcrate/Cargo.toml --target $1"
@@ -16,6 +13,15 @@ else
1613
$run --features no-asm --release
1714
fi
1815

16+
if [ -d /target ]; then
17+
path=/target/${1}/debug/deps/libcompiler_builtins-*.rlib
18+
else
19+
path=target/${1}/debug/deps/libcompiler_builtins-*.rlib
20+
fi
21+
22+
# Remove any existing artifacts from previous tests that don't set #![compiler_builtins]
23+
rm -f $path
24+
1925
cargo build --target $1
2026
cargo build --target $1 --release
2127
cargo build --target $1 --features c
@@ -36,17 +42,11 @@ case $1 in
3642
;;
3743
esac
3844

39-
NM=$(find $(rustc --print sysroot) -name llvm-nm)
45+
NM=$(find $(rustc --print sysroot) \( -name llvm-nm -o -name llvm-nm.exe \) )
4046
if [ "$NM" = "" ]; then
4147
NM=${PREFIX}nm
4248
fi
4349

44-
if [ -d /target ]; then
45-
path=/target/${1}/debug/deps/libcompiler_builtins-*.rlib
46-
else
47-
path=target/${1}/debug/deps/libcompiler_builtins-*.rlib
48-
fi
49-
5050
# Look out for duplicated symbols when we include the compiler-rt (C) implementation
5151
for rlib in $(echo $path); do
5252
set +x
@@ -79,29 +79,29 @@ done
7979
rm -f $path
8080

8181
# Verify that we haven't drop any intrinsic/symbol
82-
build_intrinsics="$cargo build --target $1 -v --example intrinsics"
83-
RUSTFLAGS="-C debug-assertions=no" $build_intrinsics
84-
RUSTFLAGS="-C debug-assertions=no" $build_intrinsics --release
85-
RUSTFLAGS="-C debug-assertions=no" $build_intrinsics --features c
86-
RUSTFLAGS="-C debug-assertions=no" $build_intrinsics --features c --release
82+
build_intrinsics="cargo build --target $1 -v --example intrinsics"
83+
$build_intrinsics
84+
$build_intrinsics --release
85+
$build_intrinsics --features c
86+
$build_intrinsics --features c --release
8787

8888
# Verify that there are no undefined symbols to `panic` within our
8989
# implementations
90-
#
91-
# TODO(#79) fix the undefined references problem for debug-assertions+lto
92-
if [ -z "$DEBUG_LTO_BUILD_DOESNT_WORK" ]; then
93-
RUSTFLAGS="-C debug-assertions=no" \
94-
CARGO_INCREMENTAL=0 \
95-
CARGO_PROFILE_DEV_LTO=true \
96-
$cargo rustc --features "$INTRINSICS_FEATURES" --target $1 --example intrinsics
97-
fi
90+
CARGO_PROFILE_DEV_LTO=true \
91+
cargo build --target $1 --example intrinsics
9892
CARGO_PROFILE_RELEASE_LTO=true \
99-
$cargo rustc --features "$INTRINSICS_FEATURES" --target $1 --example intrinsics --release
93+
cargo build --target $1 --example intrinsics --release
10094

101-
# Ensure no references to a panicking function
95+
# Ensure no references to any symbols from core
10296
for rlib in $(echo $path); do
10397
set +ex
104-
$NM -u $rlib 2>&1 | grep panicking
98+
echo "================================================================"
99+
echo checking $rlib for references to core
100+
echo "================================================================"
101+
102+
$NM --quiet -U $rlib | grep 'T _ZN4core' | awk '{print $3}' | sort | uniq > defined_symbols.txt
103+
$NM --quiet -u $rlib | grep 'U _ZN4core' | awk '{print $2}' | sort | uniq > undefined_symbols.txt
104+
grep -v -F -x -f defined_symbols.txt undefined_symbols.txt
105105

106106
if test $? = 0; then
107107
exit 1

0 commit comments

Comments
 (0)