Skip to content

Commit eb2896b

Browse files
committed
Auto merge of #1065 - jelford:fix_caching, r=Diggsey
Fix OpenSSL linkage by using the final install-directory in the build This PR addresses #1051 by avoiding moving OpenSSL's install-target directory after it's been configured. It also encorporates the regression test suggested by @malbarbo on #1054. It still makes sense to move directories about to avoid getting a partially-built copy of openssl, and I think it makes sense to cache the finished product rather than the src/build directory. I haven't been able to test the output on one of the affected platforms (although the check on symbols passes) as I don't know a good way to get artefacts out of the travis build.
2 parents 270aaa5 + 3b7ada1 commit eb2896b

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

ci/build-run-docker.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,10 @@ docker run \
2222
-e SKIP_TESTS=$SKIP_TESTS \
2323
-it $DOCKER \
2424
ci/run-docker.sh
25+
26+
# check that rustup-init was built with ssl support
27+
# see https://github.com/rust-lang-nursery/rustup.rs/issues/1051
28+
if ! (nm target/$TARGET/release/rustup-init | grep Curl_ssl_version &> /dev/null); then
29+
echo "Missing ssl support!!!!" >&2
30+
exit 1
31+
fi

ci/run-docker.sh

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,17 +147,14 @@ esac
147147

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

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

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

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

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

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

0 commit comments

Comments
 (0)