Skip to content

Commit fc6c17b

Browse files
committed
build: make sure we can overwrite config.{guess,sub}
Since ea7b852 (bitcoin#26422), autogen.sh overwrites the build-aux/config.{guess, sub} files (installed there by autoreconf) with the depends/config.{guess, sub} files if these are newer. The autoreconf tool copies them from it's share/autoconf/build-aux/ directory. Specifically on NixOS, the share/autoconf/build-aux/ files are located in the nix-store and are read-only. autoreconf preserves the read-only permissions when copying. Overwriting them with our depends/config.{guess, sub} subsequently fails. To make sure we can overwrite the files, we set write permissions to the current user and group before overwriting. This fixes the problem on NixOS. fixes bitcoin#27873: Can't copy to 'build-aux/config.guess' in autoconf.sh: Permission denied
1 parent 8de9bb7 commit fc6c17b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

autogen.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,14 @@ command -v autoreconf >/dev/null || \
1616
autoreconf --install --force --warnings=all
1717

1818
if expr "'$(build-aux/config.guess --timestamp)" \< "'$(depends/config.guess --timestamp)" > /dev/null; then
19+
chmod ug+w build-aux/config.guess
20+
chmod ug+w src/secp256k1/build-aux/config.guess
1921
cp depends/config.guess build-aux
2022
cp depends/config.guess src/secp256k1/build-aux
2123
fi
2224
if expr "'$(build-aux/config.sub --timestamp)" \< "'$(depends/config.sub --timestamp)" > /dev/null; then
25+
chmod ug+w build-aux/config.sub
26+
chmod ug+w src/secp256k1/build-aux/config.sub
2327
cp depends/config.sub build-aux
2428
cp depends/config.sub src/secp256k1/build-aux
2529
fi

0 commit comments

Comments
 (0)