Skip to content

Commit 2e51590

Browse files
committed
Merge #8315: gitian: Don't require sudo for Linux.
099d4b0 gitian: use a wrapped gcc/g++ to avoid the need for a system change (Cory Fields)
2 parents ff46dd4 + 099d4b0 commit 2e51590

File tree

1 file changed

+34
-6
lines changed

1 file changed

+34
-6
lines changed

contrib/gitian-descriptors/gitian-linux.yml

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,6 @@ remotes:
3333
files: []
3434
script: |
3535
36-
#unlock sudo
37-
echo "ubuntu" | sudo -S true
38-
39-
sudo mkdir -p /usr/include/i386-linux-gnu/
40-
sudo ln -s /usr/include/x86_64-linux-gnu/asm /usr/include/i386-linux-gnu/asm
41-
4236
WRAP_DIR=$HOME/wrapped
4337
HOSTS="i686-pc-linux-gnu x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu"
4438
CONFIGFLAGS="--enable-glibc-back-compat --enable-reduce-exports --disable-bench --disable-gui-tests"
@@ -90,11 +84,45 @@ script: |
9084
create_per-host_faketime_wrappers "2000-01-01 12:00:00"
9185
export PATH=${WRAP_DIR}:${PATH}
9286
87+
EXTRA_INCLUDES_BASE=$WRAP_DIR/extra_includes
88+
mkdir -p $EXTRA_INCLUDES_BASE
89+
90+
# x86 needs /usr/include/i386-linux-gnu/asm pointed to /usr/include/x86_64-linux-gnu/asm,
91+
# but we can't write there. Instead, create a link here and force it to be included in the
92+
# search paths by wrapping gcc/g++.
93+
94+
mkdir -p $EXTRA_INCLUDES_BASE/i686-pc-linux-gnu
95+
rm -f $WRAP_DIR/extra_includes/i686-pc-linux-gnu/asm
96+
ln -s /usr/include/x86_64-linux-gnu/asm $EXTRA_INCLUDES_BASE/i686-pc-linux-gnu/asm
97+
98+
for prog in gcc g++; do
99+
rm -f ${WRAP_DIR}/${prog}
100+
cat << EOF > ${WRAP_DIR}/${prog}
101+
#!/bin/bash
102+
REAL="`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1`"
103+
for var in "\$@"
104+
do
105+
if [ "\$var" = "-m32" ]; then
106+
export C_INCLUDE_PATH="$EXTRA_INCLUDES_BASE/i686-pc-linux-gnu"
107+
export CPLUS_INCLUDE_PATH="$EXTRA_INCLUDES_BASE/i686-pc-linux-gnu"
108+
break
109+
fi
110+
done
111+
\$REAL \$@
112+
EOF
113+
chmod +x ${WRAP_DIR}/${prog}
114+
done
115+
93116
cd bitcoin
94117
BASEPREFIX=`pwd`/depends
95118
# Build dependencies for each host
96119
for i in $HOSTS; do
120+
EXTRA_INCLUDES="$EXTRA_INCLUDES_BASE/$i"
121+
if [ -d "$EXTRA_INCLUDES" ]; then
122+
export HOST_ID_SALT="$EXTRA_INCLUDES"
123+
fi
97124
make ${MAKEOPTS} -C ${BASEPREFIX} HOST="${i}"
125+
unset HOST_ID_SALT
98126
done
99127
100128
# Faketime for binaries

0 commit comments

Comments
 (0)