Install zstd in dist builder image. · rust-lang/rust@8db318c (original) (raw)

File tree

2 files changed

lines changed

2 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -62,6 +62,10 @@ COPY host-x86_64/dist-x86_64-linux/build-clang.sh /tmp/
62 62 RUN ./build-clang.sh
63 63 ENV CC=clang CXX=clang++
64 64
65 +# rustc's LLVM needs zstd.
66 +COPY scripts/zstd.sh /tmp/
67 +RUN ./zstd.sh
68 +
65 69 COPY scripts/sccache.sh /scripts/
66 70 RUN sh /scripts/sccache.sh
67 71
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
1 +#!/bin/bash
2 +set -ex
3 +
4 +hide_output() {
5 +set +x
6 + on_err="
7 +echo ERROR: An error was encountered with the build.
8 +cat /tmp/zstd_build.log
9 +exit 1
10 +"
11 +trap "$on_err" ERR
12 + bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
13 + PING_LOOP_PID=$!
14 +"$@" &> /tmp/zstd_build.log
15 +trap - ERR
16 +kill $PING_LOOP_PID
17 + rm /tmp/zstd_build.log
18 +set -x
19 +}
20 +
21 +ZSTD=1.5.6
22 +curl -L https://github.com/facebook/zstd/releases/download/v$ZSTD/zstd-$ZSTD.tar.gz | tar xzf -
23 +
24 +cd zstd-$ZSTD
25 +CFLAGS=-fPIC hide_output make -j$(nproc) VERBOSE=1
26 +hide_output make install
27 +
28 +cd ..
29 +rm -rf zstd-$ZSTD