Skip to content
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

Fix OpenSSL linkage by using the final install-directory in the build #1065

Merged
merged 3 commits into from
Apr 15, 2017
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
7 changes: 7 additions & 0 deletions ci/build-run-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,10 @@ docker run \
-e SKIP_TESTS=$SKIP_TESTS \
-it $DOCKER \
ci/run-docker.sh

# check that rustup-init was built with ssl support
# see https://github.com/rust-lang-nursery/rustup.rs/issues/1051
if ! (nm target/$TARGET/release/rustup-init | grep Curl_ssl_version &> /dev/null); then
echo "Missing ssl support!!!!" >&2
exit 1
fi
19 changes: 11 additions & 8 deletions ci/run-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -147,17 +147,14 @@ esac

install=`pwd`/target/$TARGET/openssl/openssl-install/$OPENSSL_VERS

if [ -e $install ]; then

if [ -L $install -a -d $install-final ]; then
# $install is the "right" place for the build. See below for why it's a symlink
echo 'Using cached OpenSSL static libs'
else
# Clean up any builds of previous versions from the cache
rm -rf $(dirname $install)/*

# If the build fails half way through it will be difficult to distinguish when the next run sees
# the cached version, so finalize the build atomically. We're linking statically so don't need to
# worry about using a different prefix at install time.
final_install_path=$install
install=$install-partial

mkdir -p target/$TARGET/openssl
out=`pwd`/target/$TARGET/openssl/openssl-$OPENSSL_VERS.tar.gz
Expand All @@ -173,8 +170,14 @@ else
make -j4 && \
make install)

mv $install $final_install_path
install=$final_install_path
# Travis will cache the parent directory. That's fine, but want a way of marking the
# install "complete". In this setup, if the build fails there will be no -final and
# the whole thing starts again (which is fine).
# The same reasoning is why to cache the install-target directory rather than
# the build directory in the first place (make should be able to sort itself out in
# that case, but that's relying on intuitive timestamps in the presence of caching etc)
mv $install $install-final
ln -s $install-final $install
fi

# Variables to the openssl-sys crate to link statically against the OpenSSL we
Expand Down