Skip to content

CI: gist the disassemblies #54

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

Merged
merged 3 commits into from
Aug 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ install:
- ps: Start-FileDownload "https://static.rust-lang.org/dist/rust-nightly-${env:TARGET}.exe"
- rust-nightly-%TARGET%.exe /VERYSILENT /NORESTART /DIR="C:\Program Files (x86)\Rust"
- SET PATH=%PATH%;C:\Program Files (x86)\Rust\bin
- gem install gist
- rustc -Vv
- cargo -V

Expand All @@ -17,8 +18,11 @@ test_script:
- cargo build --release
- cargo test
- cargo test --release
- CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
- dumpbin /disasm target/release/librustc_builtins.rlib || exit 0

on_success:
- cmd: |
CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
dumpbin /disasm target/release/librustc_builtins.rlib | gist -d "'%TARGET%/rustc-builtins.rlib' from commit '%APPVEYOR_REPO_COMMIT%' on branch '%APPVEYOR_REPO_branch%'"

branches:
only:
Expand Down
31 changes: 22 additions & 9 deletions ci/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ set -ex

. $(dirname $0)/env.sh

gist_it() {
gist -ap -f "'$1' from commit '$TRAVIS_COMMIT' on branch '$TRAVIS_BRANCH'"
echo "Disassembly available at the above URL."
}

build() {
${CARGO:-cargo} build --target $TARGET
${CARGO:-cargo} build --target $TARGET --release
Expand All @@ -11,18 +16,24 @@ inspect() {
$PREFIX$NM -g --defined-only target/**/debug/*.rlib

set +e
$PREFIX$OBJDUMP -Cd target/**/release/*.rlib
set -e

# Check presence of weak symbols
case $TRAVIS_OS_NAME in
linux)
local symbols=( memcmp memcpy memmove memset )
for symbol in "${symbols[@]}"; do
$PREFIX$NM target/**/debug/deps/librlibc*.rlib | grep -q "W $symbol"
done
$PREFIX$OBJDUMP -Cd target/**/release/*.rlib | gist_it "$TARGET/rustc-builtins.rlib"
;;
osx)
$PREFIX$OBJDUMP -Cd target/**/release/*.rlib
;;
esac
set -e

# Check presence of weak symbols
if [[ $TRAVIS_OS_NAME = "linux" ]]; then
local symbols=( memcmp memcpy memmove memset )
for symbol in "${symbols[@]}"; do
$PREFIX$NM target/**/debug/deps/librlibc*.rlib | grep -q "W $symbol"
done
fi

}

run_tests() {
Expand All @@ -38,12 +49,14 @@ run_tests() {

main() {
if [[ $TRAVIS_OS_NAME == "linux" && ${IN_DOCKER_CONTAINER:-n} == "n" ]]; then
local tag=2016-08-13
local tag=2016-08-22

docker run \
--privileged \
-e IN_DOCKER_CONTAINER=y \
-e TARGET=$TARGET \
-e TRAVIS_BRANCH=$TRAVIS_BRANCH \
-e TRAVIS_COMMIT=$TRAVIS_COMMIT \
-e TRAVIS_OS_NAME=$TRAVIS_OS_NAME \
-v $(pwd):/mnt \
japaric/rustc-builtins:$tag \
Expand Down