-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix OpenSSL 3.0.0 on crates.io (#110)
Actually fix `run.sh` and find a set of `exclude`-ed files which allows the crate to still build.
- Loading branch information
1 parent
4f6cc35
commit f043255
Showing
2 changed files
with
36 additions
and
17 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 |
---|---|---|
@@ -1,24 +1,42 @@ | ||
#!/bin/bash | ||
|
||
target=$1 | ||
testcrate_dir="$(pwd)/testcrate" | ||
set -ex | ||
|
||
if [ "$1" = "aarch64-apple-darwin" ] ; then | ||
sudo xcode-select -s /Applications/Xcode_12.2.app/Contents/Developer/ | ||
export SDKROOT=$(xcrun -sdk macosx11.0 --show-sdk-path) | ||
export MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx11.0 --show-sdk-platform-version) | ||
export CARGO_TARGET_AARCH64_APPLE_DARWIN_RUNNER=echo | ||
sudo xcode-select -s /Applications/Xcode_12.2.app/Contents/Developer/ | ||
export SDKROOT=$(xcrun -sdk macosx11.0 --show-sdk-path) | ||
export MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx11.0 --show-sdk-platform-version) | ||
export CARGO_TARGET_AARCH64_APPLE_DARWIN_RUNNER=echo | ||
fi | ||
|
||
cargo test --manifest-path "$testcrate_dir/Cargo.toml" --target $1 -vv | ||
cargo test --manifest-path "$testcrate_dir/Cargo.toml" --target $1 -vv --release | ||
|
||
if [ "$1" = "x86_64-unknown-linux-gnu" ] ; then | ||
cargo test --manifest-path "$testcrate_dir/Cargo.toml" --target $1 -vv --all-features | ||
cargo test --manifest-path "$testcrate_dir/Cargo.toml" --target $1 -vv --all-features | ||
|
||
# Ensure we don't rely on any files excluded by Cargo.toml | ||
rm -rf target/ci | ||
cargo package --allow-dirty --target-dir target/ci | ||
rm -f target/ci/package/*.crate | ||
cd target/ci/package/openssl-src-* | ||
cargo test --manifest-path "$testcrate_dir/Cargo.toml" --target $1 -vv | ||
# Run a few tests here: | ||
# | ||
# * Make sure the packaged crate file isn't bigger than 10MB which is | ||
# crate.io's limit. | ||
# * Make sure that the package crate itself works. | ||
# | ||
# A lot of OpenSSL's source code is excluded on crates.io because it makes the | ||
# crate file much too large, so the test here should inform us if we're | ||
# missing anything actually required to build OpenSSL. | ||
rm -rf target/ci | ||
cargo package --allow-dirty --target-dir target/ci | ||
crate=`ls target/ci/package/*.crate` | ||
filesize=$(stat -c%s "$crate") | ||
echo "tarball is $filesize bytes" | ||
if (( filesize > 10000000 )); then | ||
echo "file size too big" | ||
exit 1 | ||
fi | ||
rm "$crate" | ||
cd target/ci/package/openssl-src-* | ||
cp -r "$testcrate_dir" . | ||
cargo test --manifest-path "testcrate/Cargo.toml" --target $1 -vv | ||
fi |