Skip to content

Commit 7ebbee5

Browse files
committed
Merge #19764: depends: Split boost into build/host packages + bump + cleanup
f190343 depends: boost: Specify cflags+compileflags (Carl Dong) b2328b7 depends: boost: Remove unnecessary _archiver_ (Carl Dong) ab9e047 depends: boost: Cleanup toolset selection (Carl Dong) 86002e7 depends: boost: Cleanup architecture/address-model (Carl Dong) d7048fa depends: boost: Disable all compression (Carl Dong) 9cf2ee5 depends: boost: Split into non-/native packages (Carl Dong) a57b498 depends: boost: Bump to 1.71.0 (Carl Dong) 800655f depends: boost: Refer to version in URL (Carl Dong) Pull request description: This PR improves the robustness of our boost package in depends, most notably: 1. Bumps boost from `1.70.0` to `1.71.0`, because `1.71.0`: 1. Removes the need to patch out the unused variable. https://github.com/bitcoin/bitcoin/blob/f8462a6d2794be728cf8550f45d19a354aae59cf/depends/packages/boost.mk#L36 Upstream boost patched it out in boostorg/process@d20b64c, which was first included in the `1.71.0` release 2. Comes packaged with a version of `b2` which allows us to override its `CXX` and `CXXFLAGS`. Previously, choosing a toolset while building `b2` such as `clang` or `gcc` would force `b2`'s build system to invoke the compiler as a bare, hardcoded `clang` or `gcc`. However, our `depends` build system often want to customize this behaviour, adding extra flags or invoking the compiler by an alternate name. So this is useful. 1. Commit where `CXX` was introduced: boostorg/build@374f965 2. Commit where `CXXFLAGS` was introduced: boostorg/build@5d49abc 2. The boost package is now split into `native_b2` and `boost`, better representing what actually happens. - In our `depends` build system, we have a distinction between `native` packages and non-`native` packages. The output of `native` packages are meant to be used on the machine that's performing the build, and the output of non-`native` packages are meant to be used on/for the machine that will ultimately be running bitcoin. Previously, `boost` existed in `depends` as a non-`native` package, but that's partly inaccurate because the `./bootstrap.sh` invocation in its `$(package)_config_cmds` stage actually produced a binary called `b2`, which is run on the machine that's performing the build. This means that `b2` is a `native` package which is being built in an environment set up for the non-`native` package `boost`. This reveals a hidden unintended behavior in our `depends` build system: for linux->darwin cross builds, we use `gcc` for `native` packages, and `clang` for non-`native` packages. But `b2` was actually being built using `clang`, since it was being built in an environment set up for non-`native` packages. theuni you might be interested in taking a look ACKs for top commit: laanwj: Concept and code review ACK f190343 Tree-SHA512: f8b728a34da4f0a9a985a819a5762f2fc2689ea24c7eba1d24d26dfbd4c59f202227c699b0a4069dab10b6329cf9f4c6dd95082685776ee43dd5f7b659acdef1
2 parents cb89e18 + f190343 commit 7ebbee5

File tree

4 files changed

+38
-43
lines changed

4 files changed

+38
-43
lines changed

depends/packages/boost.mk

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,45 @@
11
package=boost
2-
$(package)_version=1_70_0
3-
$(package)_download_path=https://dl.bintray.com/boostorg/release/1.70.0/source/
2+
$(package)_version=1_71_0
3+
$(package)_download_path=https://dl.bintray.com/boostorg/release/$(subst _,.,$($(package)_version))/source/
44
$(package)_file_name=boost_$($(package)_version).tar.bz2
5-
$(package)_sha256_hash=430ae8354789de4fd19ee52f3b1f739e1fba576f0aded0897c3c2bc00fb38778
6-
$(package)_patches=unused_var_in_process.patch
5+
$(package)_sha256_hash=d73a8da01e8bf8c7eda40b4c84915071a8c8a0df4a6734537ddde4a8580524ee
6+
$(package)_dependencies=native_b2
77

88
define $(package)_set_vars
99
$(package)_config_opts_release=variant=release
1010
$(package)_config_opts_debug=variant=debug
1111
$(package)_config_opts=--layout=tagged --build-type=complete --user-config=user-config.jam
12-
$(package)_config_opts+=threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1
12+
$(package)_config_opts+=threading=multi link=static -sNO_COMPRESSION=1
1313
$(package)_config_opts_linux=target-os=linux threadapi=pthread runtime-link=shared
1414
$(package)_config_opts_darwin=target-os=darwin runtime-link=shared
1515
$(package)_config_opts_mingw32=target-os=windows binary-format=pe threadapi=win32 runtime-link=static
16-
$(package)_config_opts_x86_64_mingw32=address-model=64
17-
$(package)_config_opts_i686_mingw32=address-model=32
18-
$(package)_config_opts_i686_linux=address-model=32 architecture=x86
19-
$(package)_config_opts_i686_android=address-model=32
20-
$(package)_config_opts_aarch64_android=address-model=64
21-
$(package)_config_opts_x86_64_android=address-model=64
22-
$(package)_config_opts_armv7a_android=address-model=32
23-
$(package)_toolset_$(host_os)=gcc
24-
$(package)_toolset_darwin=clang
16+
$(package)_config_opts_x86_64=architecture=x86 address-model=64
17+
$(package)_config_opts_i686=architecture=x86 address-model=32
18+
$(package)_config_opts_aarch64=address-model=64
19+
$(package)_config_opts_armv7a=address-model=32
2520
ifneq (,$(findstring clang,$($(package)_cxx)))
26-
$(package)_toolset_$(host_os)=clang
21+
$(package)_toolset_$(host_os)=clang
22+
else
23+
$(package)_toolset_$(host_os)=gcc
2724
endif
28-
$(package)_archiver_$(host_os)=$($(package)_ar)
2925
$(package)_config_libraries=filesystem,system,thread,test
3026
$(package)_cxxflags=-std=c++11 -fvisibility=hidden
3127
$(package)_cxxflags_linux=-fPIC
3228
$(package)_cxxflags_android=-fPIC
3329
endef
3430

3531
define $(package)_preprocess_cmds
36-
patch -p1 < $($(package)_patch_dir)/unused_var_in_process.patch && \
37-
echo "using $($(package)_toolset_$(host_os)) : : $($(package)_cxx) : <cxxflags>\"$($(package)_cxxflags) $($(package)_cppflags)\" <linkflags>\"$($(package)_ldflags)\" <archiver>\"$($(package)_archiver_$(host_os))\" <striper>\"$(host_STRIP)\" <ranlib>\"$(host_RANLIB)\" <rc>\"$(host_WINDRES)\" : ;" > user-config.jam
32+
echo "using $($(package)_toolset_$(host_os)) : : $($(package)_cxx) : <cflags>\"$($(package)_cflags)\" <cxxflags>\"$($(package)_cxxflags)\" <compileflags>\"$($(package)_cppflags)\" <linkflags>\"$($(package)_ldflags)\" <archiver>\"$($(package)_ar)\" <striper>\"$(host_STRIP)\" <ranlib>\"$(host_RANLIB)\" <rc>\"$(host_WINDRES)\" : ;" > user-config.jam
3833
endef
3934

4035
define $(package)_config_cmds
41-
./bootstrap.sh --without-icu --with-libraries=$($(package)_config_libraries) --with-toolset=$($(package)_toolset_$(host_os))
36+
./bootstrap.sh --without-icu --with-libraries=$($(package)_config_libraries) --with-toolset=$($(package)_toolset_$(host_os)) --with-bjam=b2
4237
endef
4338

4439
define $(package)_build_cmds
45-
./b2 -d2 -j2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) toolset=$($(package)_toolset_$(host_os)) stage
40+
b2 -d2 -j2 -d1 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) toolset=$($(package)_toolset_$(host_os)) stage
4641
endef
4742

4843
define $(package)_stage_cmds
49-
./b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) toolset=$($(package)_toolset_$(host_os)) install
44+
b2 -d0 -j4 --prefix=$($(package)_staging_prefix_dir) $($(package)_config_opts) toolset=$($(package)_toolset_$(host_os)) install
5045
endef

depends/packages/native_b2.mk

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package=native_b2
2+
$(package)_version=$(boost_version)
3+
$(package)_download_path=$(boost_download_path)
4+
$(package)_file_name=$(boost_file_name)
5+
$(package)_sha256_hash=$(boost_sha256_hash)
6+
$(package)_build_subdir=tools/build/src/engine
7+
ifneq (,$(findstring clang,$($(package)_cxx)))
8+
$(package)_toolset_$(host_os)=clang
9+
else
10+
$(package)_toolset_$(host_os)=gcc
11+
endif
12+
13+
define $(package)_build_cmds
14+
CXX="$($(package)_cxx)" CXXFLAGS="$($(package)_cxxflags)" ./build.sh "$($(package)_toolset_$(host_os))"
15+
endef
16+
17+
define $(package)_stage_cmds
18+
mkdir -p "$($(package)_staging_prefix_dir)"/bin/ && \
19+
cp b2 "$($(package)_staging_prefix_dir)"/bin/
20+
endef

depends/packages/packages.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ multiprocess_native_packages = native_libmultiprocess native_capnp
2222

2323
darwin_native_packages = native_ds_store native_mac_alias
2424

25+
$(host_arch)_$(host_os)_native_packages += native_b2
26+
2527
ifneq ($(build_os),darwin)
2628
darwin_native_packages += native_cctools native_cdrkit native_libdmg-hfsplus
2729
endif

depends/patches/boost/unused_var_in_process.patch

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)