-
Notifications
You must be signed in to change notification settings - Fork 229
Test with the 'c' feature enabled on CI #166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 46 commits
a137787
2f2bb32
eeb44ab
275d103
7886ae2
d170421
12a0038
a4120ad
7f90c48
215fa06
1b78d79
f0e5859
8abb0ab
47ff813
4c41b56
4540bd4
0be8b20
696b821
560018c
93fed26
83d63ea
ac3715d
7c47450
5a444d5
a16ebb0
5172f8c
a839d53
7de57cd
eabb6fa
635e519
d513c92
94bc995
b42d267
4dac0be
a2bdb4b
2147753
5e28b7e
7643048
734ec3d
5d6d3fd
91b1291
d051480
4859aba
acaa2f0
5c74fb1
c193113
afe5c71
0ebbcae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,45 @@ | ||
environment: | ||
# It's... a little unclear why the memcpy symbols clash on linux but not on | ||
# other platforms. Would be great to not differ on this though! | ||
INTRINSICS_FAILS_WITH_MEM_FEATURE: 1 | ||
|
||
matrix: | ||
- TARGET: i686-pc-windows-msvc | ||
- TARGET: x86_64-pc-windows-msvc | ||
|
||
# Ensure MinGW works, but we need to download the 32-bit MinGW compiler from a | ||
# custom location. | ||
# | ||
# Note that the MinGW builds have tons of references to | ||
# `rust_eh_unwind_resume` in the debug LTO builds that aren't optimized out, | ||
# so we skip that test for now. Would be great to not skip it! | ||
- TARGET: i686-pc-windows-gnu | ||
MINGW_URL: https://s3.amazonaws.com/rust-lang-ci | ||
MINGW_ARCHIVE: i686-4.9.2-release-win32-dwarf-rt_v4-rev4.7z | ||
MINGW_DIR: mingw32 | ||
DEBUG_LTO_BUILD_DOESNT_WORK: 1 | ||
- TARGET: x86_64-pc-windows-gnu | ||
DEBUG_LTO_BUILD_DOESNT_WORK: 1 | ||
|
||
install: | ||
- git submodule update --init | ||
- curl -sSf -o rustup-init.exe https://win.rustup.rs | ||
- appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe | ||
- rustup-init.exe --default-host x86_64-pc-windows-msvc --default-toolchain nightly -y | ||
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin | ||
- if "%TARGET%"=="i686-pc-windows-msvc" ( rustup target add %TARGET% ) | ||
- if NOT "%TARGET%" == "x86_64-pc-windows-msvc" rustup target add %TARGET% | ||
|
||
# Use the system msys | ||
- set PATH=C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH% | ||
|
||
# download a custom compiler otherwise | ||
- if defined MINGW_URL appveyor DownloadFile %MINGW_URL%/%MINGW_ARCHIVE% | ||
- if defined MINGW_URL 7z x -y %MINGW_ARCHIVE% > nul | ||
- if defined MINGW_URL set PATH=C:\Python27;%CD%\%MINGW_DIR%\bin;C:\msys64\usr\bin;%PATH% | ||
|
||
- rustc -Vv | ||
- cargo -V | ||
|
||
build: false | ||
|
||
test_script: | ||
- cargo build --target %TARGET% | ||
- cargo build --release --target %TARGET% | ||
- cargo test --no-default-features --features gen-tests --target %TARGET% | ||
- cargo test --no-default-features --features gen-tests --release --target %TARGET% | ||
- sh ci/run.sh %TARGET% | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,23 @@ | ||
set -ex | ||
|
||
case $1 in | ||
thumb*) | ||
cargo=xargo | ||
;; | ||
*) | ||
cargo=cargo | ||
;; | ||
esac | ||
|
||
INTRINSICS_FEATURES="c" | ||
|
||
# Some architectures like ARM apparently seem to require the `mem` feature | ||
# enabled to successfully compile the `intrinsics` example, and... we're not | ||
# sure why! | ||
if [ -z "$INTRINSICS_FAILS_WITH_MEM_FEATURE" ]; then | ||
INTRINSICS_FEATURES="$INTRINSICS_FEATURES mem" | ||
fi | ||
|
||
# Test our implementation | ||
case $1 in | ||
thumb*) | ||
|
@@ -33,35 +51,14 @@ case $1 in | |
done | ||
;; | ||
*) | ||
cargo test --no-default-features --features gen-tests --target $1 | ||
cargo test --no-default-features --features gen-tests --target $1 --release | ||
;; | ||
esac | ||
|
||
# Verify that we haven't drop any intrinsic/symbol | ||
case $1 in | ||
thumb*) | ||
xargo build --features c --target $1 --example intrinsics | ||
;; | ||
*) | ||
cargo build --no-default-features --features c --target $1 --example intrinsics | ||
;; | ||
esac | ||
|
||
# Verify that there are no undefined symbols to `panic` within our implementations | ||
# TODO(#79) fix the undefined references problem for debug-assertions+lto | ||
case $1 in | ||
thumb*) | ||
RUSTFLAGS="-C debug-assertions=no" xargo rustc --no-default-features --features c --target $1 --example intrinsics -- -C lto -C link-arg=-nostartfiles | ||
xargo rustc --no-default-features --features c --target $1 --example intrinsics --release -- -C lto | ||
;; | ||
*) | ||
RUSTFLAGS="-C debug-assertions=no" cargo rustc --no-default-features --features c --target $1 --example intrinsics -- -C lto | ||
cargo rustc --no-default-features --features c --target $1 --example intrinsics --release -- -C lto | ||
run="cargo test --no-default-features --target $1" | ||
$run --features 'gen-tests mangled-names' | ||
$run --features 'gen-tests mangled-names' --release | ||
$run --features 'gen-tests mangled-names c' | ||
$run --features 'gen-tests mangled-names c' --release | ||
;; | ||
esac | ||
|
||
# Look out for duplicated symbols when we include the compiler-rt (C) implementation | ||
PREFIX=$(echo $1 | sed -e 's/unknown-//')- | ||
case $1 in | ||
armv7-*) | ||
|
@@ -75,7 +72,7 @@ case $1 in | |
;; | ||
esac | ||
|
||
case $TRAVIS_OS_NAME in | ||
case "$TRAVIS_OS_NAME" in | ||
osx) | ||
# NOTE OSx's nm doesn't accept the `--defined-only` or provide an equivalent. | ||
# Use GNU nm instead | ||
|
@@ -87,22 +84,70 @@ case $TRAVIS_OS_NAME in | |
;; | ||
esac | ||
|
||
if [ $TRAVIS_OS_NAME = osx ]; then | ||
path=target/${1}/debug/deps/libcompiler_builtins-*.rlib | ||
else | ||
if [ -d /target ]; then | ||
path=/target/${1}/debug/deps/libcompiler_builtins-*.rlib | ||
else | ||
path=target/${1}/debug/deps/libcompiler_builtins-*.rlib | ||
fi | ||
|
||
# Look out for duplicated symbols when we include the compiler-rt (C) implementation | ||
for rlib in $(echo $path); do | ||
stdout=$($PREFIX$NM -g --defined-only $rlib) | ||
set +x | ||
stdout=$($PREFIX$NM -g --defined-only $rlib 2>&1) | ||
|
||
# NOTE On i586, It's normal that the get_pc_thunk symbol appears several times so ignore it | ||
# NOTE On i586, It's normal that the get_pc_thunk symbol appears several | ||
# times so ignore it | ||
# | ||
# FIXME(#167) - we shouldn't ignore `__builtin_cl` style symbols here. | ||
set +e | ||
echo "$stdout" | sort | uniq -d | grep -v __x86.get_pc_thunk | grep 'T __' | ||
echo "$stdout" | \ | ||
sort | \ | ||
uniq -d | \ | ||
grep -v __x86.get_pc_thunk | \ | ||
grep -v __builtin_cl | \ | ||
grep 'T __' | ||
|
||
if test $? = 0; then | ||
exit 1 | ||
fi | ||
set -ex | ||
done | ||
|
||
rm -f $path | ||
|
||
# Verification of the `intrinsics` program doesn't work on thumb targets right | ||
# now. | ||
case $1 in | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, I don't know when (or why) this test broke on master for thumb but it seems that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah so right now it actually has more to do with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yeah, I think we should. The thumb targets, specially the thumbv6m one, actually require more intrinsics (mainly float ops iirc) than the ARM targets so it would be good to test that we don't drop, by mistake, an intrinsic that those targets need. |
||
thumb*) | ||
exit 0 | ||
;; | ||
*) | ||
;; | ||
esac | ||
|
||
# Verify that we haven't drop any intrinsic/symbol | ||
RUSTFLAGS="-C debug-assertions=no" \ | ||
$cargo build --features "$INTRINSICS_FEATURES" --target $1 --example intrinsics | ||
|
||
# Verify that there are no undefined symbols to `panic` within our | ||
# implementations | ||
# | ||
# TODO(#79) fix the undefined references problem for debug-assertions+lto | ||
if [ -z "$DEBUG_LTO_BUILD_DOESNT_WORK" ]; then | ||
RUSTFLAGS="-C debug-assertions=no" \ | ||
$cargo rustc --features "$INTRINSICS_FEATURES" --target $1 --example intrinsics -- -C lto | ||
fi | ||
$cargo rustc --features "$INTRINSICS_FEATURES" --target $1 --example intrinsics --release -- -C lto | ||
|
||
# Ensure no references to a panicking function | ||
for rlib in $(echo $path); do | ||
set +ex | ||
$PREFIX$NM -u $rlib 2>&1 | grep panicking | ||
|
||
if test $? = 0; then | ||
exit 1 | ||
fi | ||
set -ex | ||
done | ||
|
||
true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What?! You can use bash on Windows / AppVeyor? I have been doing it wrong all this time ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🌠