-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
152 additions
and
28 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#!/usr/bin/env bash | ||
# shellcheck disable=SC1091,SC1090 | ||
|
||
# test to see that custom toolchains work | ||
|
||
set -x | ||
set -eo pipefail | ||
|
||
if [[ -z "${TARGET}" ]]; then | ||
export TARGET="aarch64-unknown-linux-gnu" | ||
fi | ||
|
||
source=$(dirname "${BASH_SOURCE[0]}") | ||
. "${source}"/shared.sh | ||
|
||
main() { | ||
local td= | ||
local err= | ||
|
||
retry cargo fetch | ||
cargo install --force --path . | ||
cargo install cargo-bisect-rustc | ||
|
||
td="$(mktemp -d)" | ||
git clone --depth 1 https://github.com/cross-rs/rust-cpp-hello-word "${td}" | ||
|
||
pushd "${td}" | ||
retry cargo fetch | ||
echo '#!/usr/bin/env bash | ||
export CROSS_CUSTOM_TOOLCHAIN=1 | ||
exec cross run --target '"${TARGET}" > bisect.sh | ||
chmod +x bisect.sh | ||
|
||
if ! err=$(cargo bisect-rustc --script=./bisect.sh --target "${TARGET}" 2>&1 >/dev/null); then | ||
if [[ "${err}" != *"does not reproduce the regression"* ]]; then | ||
echo "${err}" | ||
exit 1 | ||
fi | ||
else | ||
echo "should have failed, instead succeeded" 1>&2 | ||
exit 1 | ||
fi | ||
popd | ||
|
||
rm -rf "${td}" | ||
} | ||
|
||
main |
This file contains 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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/usr/bin/env bash | ||
# shellcheck disable=SC1091,SC1090 | ||
|
||
# test to see that remote docker support works. | ||
|
||
set -x | ||
set -eo pipefail | ||
|
||
export CROSS_REMOTE=1 | ||
if [[ -z "${TARGET}" ]]; then | ||
export TARGET="aarch64-unknown-linux-gnu" | ||
fi | ||
|
||
source=$(dirname "${BASH_SOURCE[0]}") | ||
. "${source}"/shared.sh | ||
|
||
main() { | ||
local err= | ||
|
||
retry cargo fetch | ||
cargo install --force --path . | ||
|
||
# if the create volume fails, ensure it exists. | ||
if ! err=$(cross-util volumes create 2>&1 >/dev/null); then | ||
if [[ "${err}" != *"already exists"* ]]; then | ||
echo "${err}" | ||
exit 1 | ||
fi | ||
fi | ||
cross_test_cpp | ||
cross-util volumes remove | ||
|
||
# ensure the data volume was removed. | ||
cross_test_cpp | ||
} | ||
|
||
cross_test_cpp() { | ||
local td= | ||
td="$(mktemp -d)" | ||
|
||
git clone --depth 1 https://github.com/cross-rs/rust-cpp-hello-word "${td}" | ||
|
||
pushd "${td}" | ||
retry cargo fetch | ||
cross run --target "${TARGET}" | ||
popd | ||
|
||
rm -rf "${td}" | ||
} | ||
|
||
main |
This file contains 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
function retry { | ||
local tries="${TRIES-5}" | ||
local timeout="${TIMEOUT-1}" | ||
local try=0 | ||
local exit_code=0 | ||
|
||
while (( try < tries )); do | ||
if "${@}"; then | ||
return 0 | ||
else | ||
exit_code=$? | ||
fi | ||
|
||
sleep "${timeout}" | ||
echo "Retrying ..." 1>&2 | ||
try=$(( try + 1 )) | ||
timeout=$(( timeout * 2 )) | ||
done | ||
|
||
return ${exit_code} | ||
} |
This file contains 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 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