Skip to content

Commit cd6cb97

Browse files
committed
Merge #17409: build: Avoid hardcoded libfaketime dir in gitian
3333629 doc: Explain $LIB in LD_PRELOAD in gitian descriptors (MarcoFalke) fab9850 scripted-diff: Avoid hardcoded libfaketime dir in gitian (MarcoFalke) Pull request description: Without this gitian prints warnings for me: ``` ERROR: ld.so: object '/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' from LD_PRELOAD cannot be preloaded (cannot open shared object file): ignored. ``` ``` $ ls /usr/lib/aarch64-linux-gnu/faketime/libfaketime.so.1 /usr/lib/aarch64-linux-gnu/faketime/libfaketime.so.1 ``` ACKs for top commit: laanwj: ACK 3333629 Tree-SHA512: 3e7c4471b69c2ae38c29d0cc0db8b9eae0912085299d7f5ac67eeb4b6a2fdc7eb23d806eeeae0b0c2da22d6d1ba82513cab23652876b97aada9928b2c7d38e7e
2 parents 8237889 + 3333629 commit cd6cb97

File tree

5 files changed

+16
-13
lines changed

5 files changed

+16
-13
lines changed

contrib/gitian-descriptors/gitian-linux.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ distro: "ubuntu"
55
suites:
66
- "bionic"
77
architectures:
8-
- "amd64"
8+
- "linux64"
99
packages:
1010
- "curl"
1111
- "g++-aarch64-linux-gnu"
@@ -59,11 +59,12 @@ script: |
5959
mkdir -p ${BASE_CACHE} ${SOURCES_PATH}
6060
fi
6161
62+
# Use $LIB in LD_PRELOAD to avoid hardcoding the dir (See `man ld.so`)
6263
function create_global_faketime_wrappers {
6364
for prog in ${FAKETIME_PROGS}; do
6465
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${prog}
6566
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
66-
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
67+
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${prog}
6768
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
6869
echo "\$REAL \$@" >> $WRAP_DIR/${prog}
6970
chmod +x ${WRAP_DIR}/${prog}
@@ -77,7 +78,7 @@ script: |
7778
then
7879
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog}
7980
echo "REAL=\`which -a ${i}-${prog}-8 | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
80-
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
81+
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${i}-${prog}
8182
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
8283
echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
8384
chmod +x ${WRAP_DIR}/${i}-${prog}

contrib/gitian-descriptors/gitian-osx-signer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ distro: "ubuntu"
44
suites:
55
- "bionic"
66
architectures:
7-
- "amd64"
7+
- "linux64"
88
packages:
99
- "faketime"
1010
remotes:
@@ -24,7 +24,7 @@ script: |
2424
for prog in ${FAKETIME_PROGS}; do
2525
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${prog}
2626
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
27-
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
27+
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${prog}
2828
echo "export FAKETIME=\"${REFERENCE_DATETIME}\"" >> ${WRAP_DIR}/${prog}
2929
echo "\$REAL \$@" >> $WRAP_DIR/${prog}
3030
chmod +x ${WRAP_DIR}/${prog}

contrib/gitian-descriptors/gitian-osx.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ distro: "ubuntu"
55
suites:
66
- "bionic"
77
architectures:
8-
- "amd64"
8+
- "linux64"
99
packages:
1010
- "ca-certificates"
1111
- "curl"
@@ -55,11 +55,12 @@ script: |
5555
5656
export ZERO_AR_DATE=1
5757
58+
# Use $LIB in LD_PRELOAD to avoid hardcoding the dir (See `man ld.so`)
5859
function create_global_faketime_wrappers {
5960
for prog in ${FAKETIME_PROGS}; do
6061
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${prog}
6162
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
62-
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
63+
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${prog}
6364
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
6465
echo "\$REAL \$@" >> $WRAP_DIR/${prog}
6566
chmod +x ${WRAP_DIR}/${prog}
@@ -71,7 +72,7 @@ script: |
7172
for prog in ${FAKETIME_HOST_PROGS}; do
7273
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog}
7374
echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
74-
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
75+
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${i}-${prog}
7576
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
7677
echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
7778
chmod +x ${WRAP_DIR}/${i}-${prog}

contrib/gitian-descriptors/gitian-win-signer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ distro: "ubuntu"
44
suites:
55
- "bionic"
66
architectures:
7-
- "amd64"
7+
- "linux64"
88
packages:
99
# Once osslsigncode supports openssl 1.1, we can change this back to libssl-dev
1010
- "libssl1.0-dev"

contrib/gitian-descriptors/gitian-win.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ distro: "ubuntu"
55
suites:
66
- "bionic"
77
architectures:
8-
- "amd64"
8+
- "linux64"
99
packages:
1010
- "curl"
1111
- "g++"
@@ -48,11 +48,12 @@ script: |
4848
mkdir -p ${BASE_CACHE} ${SOURCES_PATH}
4949
fi
5050
51+
# Use $LIB in LD_PRELOAD to avoid hardcoding the dir (See `man ld.so`)
5152
function create_global_faketime_wrappers {
5253
for prog in ${FAKETIME_PROGS}; do
5354
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${prog}
5455
echo "REAL=\`which -a ${prog} | grep -v ${WRAP_DIR}/${prog} | head -1\`" >> ${WRAP_DIR}/${prog}
55-
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${prog}
56+
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${prog}
5657
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${prog}
5758
echo "\$REAL \$@" >> $WRAP_DIR/${prog}
5859
chmod +x ${WRAP_DIR}/${prog}
@@ -64,7 +65,7 @@ script: |
6465
for prog in ${FAKETIME_HOST_PROGS}; do
6566
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog}
6667
echo "REAL=\`which -a ${i}-${prog} | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
67-
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
68+
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${i}-${prog}
6869
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
6970
echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}
7071
chmod +x ${WRAP_DIR}/${i}-${prog}
@@ -79,7 +80,7 @@ script: |
7980
for prog in gcc g++; do
8081
echo '#!/usr/bin/env bash' > ${WRAP_DIR}/${i}-${prog}
8182
echo "REAL=\`which -a ${i}-${prog}-posix | grep -v ${WRAP_DIR}/${i}-${prog} | head -1\`" >> ${WRAP_DIR}/${i}-${prog}
82-
echo 'export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' >> ${WRAP_DIR}/${i}-${prog}
83+
echo "export LD_PRELOAD='/usr/\$LIB/faketime/libfaketime.so.1'" >> ${WRAP_DIR}/${i}-${prog}
8384
echo "export FAKETIME=\"$1\"" >> ${WRAP_DIR}/${i}-${prog}
8485
echo "export COMPILER_PATH=${WRAP_DIR}/${i}" >> ${WRAP_DIR}/${i}-${prog}
8586
echo "\$REAL \$@" >> $WRAP_DIR/${i}-${prog}

0 commit comments

Comments
 (0)