Skip to content

Commit 8db318c

Browse files
committed
Install zstd in dist builder image.
Build libzstd from source because the EPEL package is built without fPIC.
1 parent 7bb345e commit 8db318c

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

src/ci/docker/host-x86_64/dist-x86_64-linux/Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ COPY host-x86_64/dist-x86_64-linux/build-clang.sh /tmp/
6262
RUN ./build-clang.sh
6363
ENV CC=clang CXX=clang++
6464

65+
# rustc's LLVM needs zstd.
66+
COPY scripts/zstd.sh /tmp/
67+
RUN ./zstd.sh
68+
6569
COPY scripts/sccache.sh /scripts/
6670
RUN sh /scripts/sccache.sh
6771

src/ci/docker/scripts/zstd.sh

+29
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)