Skip to content

Commit

Permalink
Merge bitcoin/bitcoin#30940: depends: Fix build with MULTIPROCESS=1
Browse files Browse the repository at this point in the history
… in Guix environment

06b4c33 depends: Fix reproducibility when building with `MULTIPROCESS=1` (Hennadii Stepanov)
d8e3afc depends: Fix build with `MULTIPROCESS=1` in Guix environment (Hennadii Stepanov)

Pull request description:

  In the Guix environment, `${BASEPREFIX}/${HOST}/native/bin` is added to the `PATH` environment variable:https://github.com/bitcoin/bitcoin/blob/33adc7521cc8bb24b941d959022b084002ba7c60/contrib/guix/libexec/build.sh#L233-L234

  This causes CMake to search for package configurations in the `native` subdirectory first.

  Explicitly specifying the top-priority search prefixes for the `Libmultiprocess` and `LibmultiprocessNative` packages resolves bitcoin/bitcoin#30931.

  Can be tested on this [branch](https://github.com/hebasto/bitcoin/commits/240921-guix-mp.DEMO/) with an additional [commit](hebasto/bitcoin@d8ec933):
  ```
  $ uname -m
  x86_64
  $ env MULTIPROCESS=1 HOSTS=x86_64-linux-gnu ./contrib/guix/guix-build
  $ find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
  70d482a09099931345888a918df5ccc78a0c742b1d18bb8a5d442af9b2717867  guix-build-d8ec933456bc/output/dist-archive/bitcoin-d8ec933456bc.tar.gz
  ea9465517c0e1cc559a6a353f404b2bf47447332c918b69410dc51b6c4fbdedc  guix-build-d8ec933456bc/output/x86_64-linux-gnu/SHA256SUMS.part
  f83a296139d0757abc47d053b8fddebc6d2ccc36dabea9b2d52883d23ba923bb  guix-build-d8ec933456bc/output/x86_64-linux-gnu/bitcoin-d8ec933456bc-x86_64-linux-gnu-debug.tar.gz
  81aed48bece8d9bf5327530763c17d73dd66d5a3c666cbaf9381c03d4a660845  guix-build-d8ec933456bc/output/x86_64-linux-gnu/bitcoin-d8ec933456bc-x86_64-linux-gnu.tar.gz
  ```
  ```
  $ uname -m
  aarch64
  $ env MULTIPROCESS=1 HOSTS=x86_64-linux-gnu ./contrib/guix/guix-build
  $ find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum
  70d482a09099931345888a918df5ccc78a0c742b1d18bb8a5d442af9b2717867  guix-build-d8ec933456bc/output/dist-archive/bitcoin-d8ec933456bc.tar.gz
  ea9465517c0e1cc559a6a353f404b2bf47447332c918b69410dc51b6c4fbdedc  guix-build-d8ec933456bc/output/x86_64-linux-gnu/SHA256SUMS.part
  f83a296139d0757abc47d053b8fddebc6d2ccc36dabea9b2d52883d23ba923bb  guix-build-d8ec933456bc/output/x86_64-linux-gnu/bitcoin-d8ec933456bc-x86_64-linux-gnu-debug.tar.gz
  81aed48bece8d9bf5327530763c17d73dd66d5a3c666cbaf9381c03d4a660845  guix-build-d8ec933456bc/output/x86_64-linux-gnu/bitcoin-d8ec933456bc-x86_64-linux-gnu.tar.gz
  ```

ACKs for top commit:
  ryanofsky:
    Code review ACK 06b4c33
  fanquake:
    ACK 06b4c33

Tree-SHA512: b219ff29723bf571784af11b8d41fdc0f3fe7e21a87493909f9fcc695e37f9dbf2f6eb0fda172a1e0060dec4d2aeaa7017b1078c0ea0040cabfbbe3e8a352c6b
  • Loading branch information
fanquake committed Sep 27, 2024
2 parents 89a8e9b + 06b4c33 commit 29d00a1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions depends/packages/capnp.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ define $(package)_set_vars :=
$(package)_config_opts := -DBUILD_TESTING=OFF
$(package)_config_opts += -DWITH_OPENSSL=OFF
$(package)_config_opts += -DWITH_ZLIB=OFF
$(package)_cxxflags += -ffile-prefix-map=$$($(package)_extract_dir)=/usr
endef

define $(package)_config_cmds
Expand Down
1 change: 1 addition & 0 deletions depends/packages/libmultiprocess.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ifneq ($(host),$(build))
$(package)_config_opts := -DCAPNP_EXECUTABLE="$$(native_capnp_prefixbin)/capnp"
$(package)_config_opts += -DCAPNPC_CXX_EXECUTABLE="$$(native_capnp_prefixbin)/capnpc-c++"
endif
$(package)_cxxflags += -ffile-prefix-map=$$($(package)_extract_dir)=/usr
endef

define $(package)_config_cmds
Expand Down
3 changes: 2 additions & 1 deletion depends/toolchain.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ endif()

if("@multiprocess@" STREQUAL "1")
set(WITH_MULTIPROCESS ON CACHE BOOL "")
set(LibmultiprocessNative_DIR "${CMAKE_FIND_ROOT_PATH}/native/lib/cmake/Libmultiprocess" CACHE PATH "")
set(Libmultiprocess_ROOT "${CMAKE_CURRENT_LIST_DIR}" CACHE PATH "")
set(LibmultiprocessNative_ROOT "${CMAKE_CURRENT_LIST_DIR}/native" CACHE PATH "")
else()
set(WITH_MULTIPROCESS OFF CACHE BOOL "")
endif()

0 comments on commit 29d00a1

Please sign in to comment.