-
Notifications
You must be signed in to change notification settings - Fork 232
Add a way to test more targets on non-linux machines #591
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
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
*.rs.bk | ||
Cargo.lock | ||
target | ||
compiler-rt | ||
*.tar.gz | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
FROM ubuntu:18.04 | ||
ARG IMAGE=ubuntu:18.04 | ||
FROM $IMAGE | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
gcc-multilib libc6-dev ca-certificates |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
FROM ubuntu:18.04 | ||
ARG IMAGE=ubuntu:18.04 | ||
FROM $IMAGE | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
gcc-multilib libc6-dev ca-certificates |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
FROM ubuntu:18.04 | ||
ARG IMAGE=ubuntu:18.04 | ||
FROM $IMAGE | ||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
gcc libc6-dev ca-certificates |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,77 @@ | ||
#!/bin/bash | ||
|
||
# Small script to run tests for a target (or all targets) inside all the | ||
# respective docker images. | ||
|
||
set -ex | ||
set -euxo pipefail | ||
|
||
run() { | ||
local target=$1 | ||
local target="$1" | ||
|
||
echo $target | ||
echo "TESTING TARGET: $target" | ||
|
||
# This directory needs to exist before calling docker, otherwise docker will create it but it | ||
# will be owned by root | ||
mkdir -p target | ||
|
||
docker build -t $target ci/docker/$target | ||
if [ $(uname -s) = "Linux" ] && [ -z "${DOCKER_BASE_IMAGE:-}" ]; then | ||
# Share the host rustc and target. Do this only on Linux and if the image | ||
# isn't overridden | ||
run_args=( | ||
--user "$(id -u):$(id -g)" | ||
-e "CARGO_HOME=/cargo" | ||
-v "${HOME}/.cargo:/cargo" | ||
-v "$(pwd)/target:/builtins-target" | ||
-v "$(rustc --print sysroot):/rust:ro" | ||
) | ||
run_cmd="HOME=/tmp PATH=\$PATH:/rust/bin ci/run.sh $target" | ||
else | ||
# Use rustc provided by a docker image | ||
docker volume create compiler-builtins-cache | ||
build_args=( | ||
"--build-arg" "IMAGE=${DOCKER_BASE_IMAGE:-rustlang/rust:nightly}" | ||
) | ||
run_args=( | ||
-v "compiler-builtins-cache:/builtins-target" | ||
) | ||
run_cmd="HOME=/tmp USING_CONTAINER_RUSTC=1 ci/run.sh $target" | ||
fi | ||
|
||
if [ -d compiler-rt ]; then | ||
export RUST_COMPILER_RT_ROOT=./compiler-rt | ||
fi | ||
|
||
docker build \ | ||
-t "builtins-$target" \ | ||
${build_args[@]:-} \ | ||
"ci/docker/$target" | ||
docker run \ | ||
--rm \ | ||
--user $(id -u):$(id -g) \ | ||
-e CARGO_HOME=/cargo \ | ||
-e CARGO_TARGET_DIR=/target \ | ||
-e RUST_COMPILER_RT_ROOT \ | ||
-v "${HOME}/.cargo":/cargo \ | ||
-v `pwd`/target:/target \ | ||
-v `pwd`:/checkout:ro \ | ||
-v `rustc --print sysroot`:/rust:ro \ | ||
-e "CARGO_TARGET_DIR=/builtins-target" \ | ||
-v "$(pwd):/checkout:ro" \ | ||
-w /checkout \ | ||
${run_args[@]:-} \ | ||
--init \ | ||
$target \ | ||
sh -c "HOME=/tmp PATH=\$PATH:/rust/bin ci/run.sh $target" | ||
"builtins-$target" \ | ||
sh -c "$run_cmd" | ||
} | ||
|
||
if [ -z "$1" ]; then | ||
for d in `ls ci/docker/`; do | ||
run $d | ||
if [ "${1:-}" = "--help" ] || [ "$#" -gt 1 ]; then | ||
set +x | ||
echo "\ | ||
usage: ./ci/run-docker.sh [target] | ||
|
||
you can also set DOCKER_BASE_IMAGE to use something other than the default | ||
ubuntu:18.04 (or rustlang/rust:nightly). | ||
" | ||
exit | ||
fi | ||
|
||
if [ -z "${1:-}" ]; then | ||
for d in ci/docker/*; do | ||
run $(basename "$d") | ||
done | ||
else | ||
run $1 | ||
run "$1" | ||
fi |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I don't think these changes should be committed. Maybe only the compiler-rt one?
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.
Ah,
target-docker
was from before I changed it to just use a docker volume. Removed this.tar.gz is just there so if you download the C libraries like in CI it won't get picked up. Is this okay to keep?