Skip to content

Commit

Permalink
Try #994: --target cross
Browse files Browse the repository at this point in the history
  • Loading branch information
bors[bot] authored Aug 10, 2022
2 parents 7b04b6d + 37c27b4 commit 497d533
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
11 changes: 11 additions & 0 deletions ci/test-cross-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ git clone --depth 1 https://github.com/cross-rs/rust-cpp-hello-word "${td}"
cd "${td}"
cross run --target "${TARGET}"
'
td="$(mkcargotemp -d)"
git clone --depth 1 https://github.com/cross-rs/rust-cpp-hello-word "${td}"
cd "${td}"
echo '# Cross.toml
[target.'${TARGET}']
pre-build = ["exit 0"]
' > Cross.toml
docker run --rm -e TARGET -e CROSS_CONTAINER_IN_CONTAINER=1 -e "CROSS_TARGET_${TARGET_UPPER//-/_}_IMAGE" \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $PWD:/mount -w /mount \
"${CROSS_TARGET_CROSS_IMAGE}" cross build --target "${TARGET}"
}

main "${@}"
8 changes: 6 additions & 2 deletions ci/test-docker-in-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ ci_dir=$(realpath "${ci_dir}")
. "${ci_dir}"/shared.sh

main() {
docker run -v "${PROJECT_HOME}":"${PROJECT_HOME}" -w "${PROJECT_HOME}" \
--rm -e TARGET -e RUSTFLAGS -e RUST_TEST_THREADS \
docker run --platform linux/amd64 -v "${PROJECT_HOME}":"${PROJECT_HOME}" -w "${PROJECT_HOME}" \
--rm -e TARGET -e TARGET_UPPER -e RUSTFLAGS -e RUST_TEST_THREADS \
-e LLVM_PROFILE_FILE -e CARGO_INCREMENTAL \
-e "CROSS_TARGET_${TARGET_UPPER//-/_}_IMAGE" \
-v /var/run/docker.sock:/var/run/docker.sock \
Expand Down Expand Up @@ -55,10 +55,14 @@ git clone --depth 1 https://github.com/cross-rs/test-workspace "${td}"
cd "${td}"
cross build --target "${TARGET}" --workspace \
--manifest-path="./workspace/Cargo.toml" --verbose
eval CROSS_TARGET_${TARGET_UPPER//-/_}_PRE_BUILD="exit" cross build --target "${TARGET}" --workspace \
--manifest-path="./workspace/Cargo.toml" --verbose
cd workspace
cross build --target "${TARGET}" --workspace --verbose
eval CROSS_TARGET_${TARGET_UPPER//-/_}_PRE_BUILD="exit" cross build --target "${TARGET}" --workspace --verbose
cd binary
cross run --target "${TARGET}" --verbose
eval CROSS_TARGET_${TARGET_UPPER//-/_}_PRE_BUILD="exit" cross run --target "${TARGET}" --verbose
'
}

Expand Down

0 comments on commit 497d533

Please sign in to comment.