diff options
Diffstat (limited to 'contrib/guix')
-rw-r--r-- | contrib/guix/INSTALL.md | 13 | ||||
-rw-r--r-- | contrib/guix/README.md | 1 | ||||
-rwxr-xr-x | contrib/guix/libexec/build.sh | 55 | ||||
-rw-r--r-- | contrib/guix/libexec/prelude.bash | 2 | ||||
-rw-r--r-- | contrib/guix/manifest.scm | 19 |
5 files changed, 36 insertions, 54 deletions
diff --git a/contrib/guix/INSTALL.md b/contrib/guix/INSTALL.md index 35ea83e585..10f5835bb8 100644 --- a/contrib/guix/INSTALL.md +++ b/contrib/guix/INSTALL.md @@ -671,6 +671,8 @@ More information: https://github.com/python/cpython/issues/81765 OpenSSL includes tests that will fail once some certificate has expired. The workarounds from the GnuTLS section immediately below can be used. +For openssl-1.1.1l use 2022-05-01 as the date. + ### GnuTLS: test-suite FAIL: status-request-revoked *The derivation is likely identified by: `/gnu/store/vhphki5sg9xkdhh2pbc8gi6vhpfzryf0-gnutls-3.6.12.drv`* @@ -705,11 +707,12 @@ authorized. This workaround was described [here](https://issues.guix.gnu.org/44559#5). Basically: -2. Turn off NTP -3. Set system time to 2020-10-01 -4. guix build --no-substitutes /gnu/store/vhphki5sg9xkdhh2pbc8gi6vhpfzryf0-gnutls-3.6.12.drv -5. Set system time back to accurate current time -6. Turn NTP back on + +1. Turn off NTP +2. Set system time to 2020-10-01 +3. guix build --no-substitutes /gnu/store/vhphki5sg9xkdhh2pbc8gi6vhpfzryf0-gnutls-3.6.12.drv +4. Set system time back to accurate current time +5. Turn NTP back on For example, diff --git a/contrib/guix/README.md b/contrib/guix/README.md index 6fb647f8a9..5e05e1016e 100644 --- a/contrib/guix/README.md +++ b/contrib/guix/README.md @@ -261,6 +261,7 @@ details. - `guix` build commands as in `guix shell --cores="$JOBS"` - `make` as in `make --jobs="$JOBS"` + - `cmake` as in `cmake --build build -j "$JOBS"` - `xargs` as in `xargs -P"$JOBS"` See [here](#controlling-the-number-of-threads-used-by-guix-build-commands) for diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh index fa6933b332..3184cd4afe 100755 --- a/contrib/guix/libexec/build.sh +++ b/contrib/guix/libexec/build.sh @@ -206,13 +206,13 @@ mkdir -p "$OUTDIR" ########################### # CONFIGFLAGS -CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests --disable-fuzz-binary" +CONFIGFLAGS="-DREDUCE_EXPORTS=ON -DBUILD_BENCH=OFF -DBUILD_GUI_TESTS=OFF -DBUILD_FUZZ_BINARY=OFF" # CFLAGS HOST_CFLAGS="-O2 -g" HOST_CFLAGS+=$(find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -ffile-prefix-map={}=/usr" \;) case "$HOST" in - *linux*) HOST_CFLAGS+=" -ffile-prefix-map=${PWD}=." ;; + *linux*) HOST_CFLAGS+=" -ffile-prefix-map=${DISTSRC}/src=." ;; *mingw*) HOST_CFLAGS+=" -fno-ident" ;; *darwin*) unset HOST_CFLAGS ;; esac @@ -230,8 +230,6 @@ case "$HOST" in *mingw*) HOST_LDFLAGS="-Wl,--no-insert-timestamp" ;; esac -# Make $HOST-specific native binaries from depends available in $PATH -export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}" mkdir -p "$DISTSRC" ( cd "$DISTSRC" @@ -239,38 +237,31 @@ mkdir -p "$DISTSRC" # Extract the source tarball tar --strip-components=1 -xf "${GIT_ARCHIVE}" - ./autogen.sh - # Configure this DISTSRC for $HOST # shellcheck disable=SC2086 - env CONFIG_SITE="${BASEPREFIX}/${HOST}/share/config.site" \ - ./configure --prefix=/ \ - --disable-ccache \ - --disable-maintainer-mode \ - --disable-dependency-tracking \ - ${CONFIGFLAGS} \ - ${HOST_CFLAGS:+CFLAGS="${HOST_CFLAGS}"} \ - ${HOST_CXXFLAGS:+CXXFLAGS="${HOST_CXXFLAGS}"} \ - ${HOST_LDFLAGS:+LDFLAGS="${HOST_LDFLAGS}"} - - sed -i.old 's/-lstdc++ //g' config.status libtool + env CFLAGS="${HOST_CFLAGS}" CXXFLAGS="${HOST_CXXFLAGS}" LDFLAGS="${HOST_LDFLAGS}" \ + cmake -S . -B build \ + --toolchain "${BASEPREFIX}/${HOST}/toolchain.cmake" \ + -DWITH_CCACHE=OFF \ + ${CONFIGFLAGS} # Build Bitcoin Core - make --jobs="$JOBS" ${V:+V=1} + cmake --build build -j "$JOBS" ${V:+--verbose} # Check that symbol/security checks tools are sane. - make test-security-check ${V:+V=1} + cmake --build build --target test-security-check ${V:+--verbose} # Perform basic security checks on a series of executables. - make -C src --jobs=1 check-security ${V:+V=1} + cmake --build build -j 1 --target check-security ${V:+--verbose} # Check that executables only contain allowed version symbols. - make -C src --jobs=1 check-symbols ${V:+V=1} + cmake --build build -j 1 --target check-symbols ${V:+--verbose} mkdir -p "$OUTDIR" # Make the os-specific installers case "$HOST" in *mingw*) - make deploy ${V:+V=1} BITCOIN_WIN_INSTALLER="${OUTDIR}/${DISTNAME}-win64-setup-unsigned.exe" + cmake --build build -j "$JOBS" -t deploy ${V:+--verbose} + mv build/bitcoin-win64-setup.exe "${OUTDIR}/${DISTNAME}-win64-setup-unsigned.exe" ;; esac @@ -282,20 +273,25 @@ mkdir -p "$DISTSRC" # Install built Bitcoin Core to $INSTALLPATH case "$HOST" in *darwin*) - make install-strip DESTDIR="${INSTALLPATH}" ${V:+V=1} + # This workaround can be dropped for CMake >= 3.27. + # See the upstream commit 689616785f76acd844fd448c51c5b2a0711aafa2. + find build -name 'cmake_install.cmake' -exec sed -i 's| -u -r | |g' {} + + + cmake --install build --strip --prefix "${INSTALLPATH}" ${V:+--verbose} ;; *) - make install DESTDIR="${INSTALLPATH}" ${V:+V=1} + cmake --install build --prefix "${INSTALLPATH}" ${V:+--verbose} ;; esac case "$HOST" in *darwin*) - make deploydir ${V:+V=1} + cmake --build build --target deploy ${V:+--verbose} + mv build/dist/Bitcoin-Core.zip "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.zip" mkdir -p "unsigned-app-${HOST}" cp --target-directory="unsigned-app-${HOST}" \ contrib/macdeploy/detached-sig-create.sh - mv --target-directory="unsigned-app-${HOST}" dist + mv --target-directory="unsigned-app-${HOST}" build/dist ( cd "unsigned-app-${HOST}" find . -print0 \ @@ -304,23 +300,18 @@ mkdir -p "$DISTSRC" | gzip -9n > "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.tar.gz" \ || ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.tar.gz" && exit 1 ) ) - make deploy ${V:+V=1} OSX_ZIP="${OUTDIR}/${DISTNAME}-${HOST}-unsigned.zip" ;; esac ( cd installed - # Prune libtool and object archives - find . -name "lib*.la" -delete - find . -name "lib*.a" -delete - case "$HOST" in *darwin*) ;; *) # Split binaries from their debug symbols { find "${DISTNAME}/bin" -type f -executable -print0 - } | xargs -0 -P"$JOBS" -I{} "${DISTSRC}/contrib/devtools/split-debug.sh" {} {} {}.dbg + } | xargs -0 -P"$JOBS" -I{} "${DISTSRC}/build/split-debug.sh" {} {} {}.dbg ;; esac diff --git a/contrib/guix/libexec/prelude.bash b/contrib/guix/libexec/prelude.bash index 9cc151c706..428fc41e73 100644 --- a/contrib/guix/libexec/prelude.bash +++ b/contrib/guix/libexec/prelude.bash @@ -51,7 +51,7 @@ fi time-machine() { # shellcheck disable=SC2086 guix time-machine --url=https://git.savannah.gnu.org/git/guix.git \ - --commit=7bf1d7aeaffba15c4f680f93ae88fbef25427252 \ + --commit=53396a22afc04536ddf75d8f82ad2eafa5082725 \ --cores="$JOBS" \ --keep-failed \ --fallback \ diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm index 1a47e91b49..e5ebecbf93 100644 --- a/contrib/guix/manifest.scm +++ b/contrib/guix/manifest.scm @@ -1,5 +1,4 @@ (use-modules (gnu packages) - (gnu packages autotools) ((gnu packages bash) #:select (bash-minimal)) (gnu packages bison) ((gnu packages certs) #:select (nss-certs)) @@ -22,7 +21,6 @@ ((gnu packages tls) #:select (openssl)) ((gnu packages version-control) #:select (git-minimal)) (guix build-system cmake) - (guix build-system gnu) (guix build-system python) (guix build-system trivial) (guix download) @@ -92,17 +90,7 @@ chain for " target " development.")) (home-page (package-home-page xgcc)) (license (package-license xgcc))))) -(define base-gcc - (package - (inherit gcc-12) ;; 12.3.0 - (version "12.4.0") - (source (origin - (method url-fetch) - (uri (string-append "mirror://gnu/gcc/gcc-" - version "/gcc-" version ".tar.xz")) - (sha256 - (base32 - "0xcida8l2wykvvzvpcrcn649gj0ijn64gwxbplacpg6c0hk6akvh")))))) +(define base-gcc gcc-12) ;; 12.4.0 (define base-linux-kernel-headers linux-libre-headers-6.1) @@ -446,6 +434,7 @@ inspecting signatures in Mach-O binaries.") "--enable-default-ssp=yes", "--enable-default-pie=yes", "--enable-standard-branch-protection=yes", + "--enable-cet=yes", building-on))) ((#:phases phases) `(modify-phases ,phases @@ -480,6 +469,7 @@ inspecting signatures in Mach-O binaries.") `(append ,flags ;; https://www.gnu.org/software/libc/manual/html_node/Configuring-and-compiling.html (list "--enable-stack-protector=all", + "--enable-cet", "--enable-bind-now", "--disable-werror", building-on))) @@ -522,9 +512,6 @@ inspecting signatures in Mach-O binaries.") gcc-toolchain-12 cmake-minimal gnu-make - libtool - autoconf-2.71 - automake pkg-config ;; Scripting python-minimal ;; (3.10) |