-
Notifications
You must be signed in to change notification settings - Fork 37.7k
depends: Split boost into build/host packages + bump + cleanup #19764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Could improve the documentation of these changes by including why each change was made, in addition to what was done. https://chris.beams.io/posts/git-commit/#why-not-how Speaking as someone who is only so familiar with the build system who would like to learn more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK. Looks like a good cleanup. Bit of a bummer (for slower systems) that we'll have to extract Boost twice now. Do you think using bcp
is on the roadmap after this?
@@ -9,7 +9,7 @@ define $(package)_set_vars | |||
$(package)_config_opts_release=variant=release | |||
$(package)_config_opts_debug=variant=debug | |||
$(package)_config_opts=--layout=tagged --build-type=complete --user-config=user-config.jam | |||
$(package)_config_opts+=threading=multi link=static -sNO_BZIP2=1 -sNO_ZLIB=1 | |||
$(package)_config_opts+=threading=multi link=static -sNO_COMPRESSION=1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even though this option shouldn't affect us, given we don't build iostreams, this is a nice simplification. Easier to pass sNO_COMPRESSION
and not worry about new types being added in future, as we were already missing NO_LZMA
and NO_ZSTD
.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
ce84a8f
to
8c38443
Compare
@Empact I updated the description with more justification and context, please let me know if anything's unclear! |
Concept ACK.
Very true, I had completely forgotten about this overhead when we discussed this. +1 for looking into reducing the size of the contents of the tarballs. Also, it's worth investigating switching from the boost .tar.bz2 to the .tar.gz. Maybe that can make up for some of the slowdown at the cost of a size increase? |
Concept ACK. It would be nice to document |
7a89f2e build: Fix target name (Hennadii Stepanov) Pull request description: It seems like a typo :) This PR: - fixes errors when building a package in depends for `HOST=x86_64-apple-darwin16` (fix #19799) - is a correct alternative to d25e0e3 from #19764 ACKs for top commit: icota: tACK 7a89f2e dongcarl: Code Review ACK 7a89f2e theuni: ACK 7a89f2e. Tree-SHA512: a0bcbc6805d3450e201476ef1e22e0eb53903db1586c5515314c19afd337bded887e56de0fbe62feaf359b2de15dbccd49a44f1a8b566b4c64f5ae3d94a2ab6d
7a89f2e build: Fix target name (Hennadii Stepanov) Pull request description: It seems like a typo :) This PR: - fixes errors when building a package in depends for `HOST=x86_64-apple-darwin16` (fix bitcoin#19799) - is a correct alternative to bitcoin@d25e0e3 from bitcoin#19764 ACKs for top commit: icota: tACK bitcoin@7a89f2e dongcarl: Code Review ACK 7a89f2e theuni: ACK 7a89f2e. Tree-SHA512: a0bcbc6805d3450e201476ef1e22e0eb53903db1586c5515314c19afd337bded887e56de0fbe62feaf359b2de15dbccd49a44f1a8b566b4c64f5ae3d94a2ab6d
8c38443
to
68d53e8
Compare
Rebased over #19868 and dropped my solution. |
Concept ACK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basic code review ACK 68d53e8. I was looking at this and didn't dig into all the details of all the changes, but did think they all look safe and sane and were well motivated.
I guess most ideally the boost build system would accept different build and host toolchains in its configuration, and use the right tools for the right things, so everything could be built in one package. But I guess its bootstrap script isn't really written to work this way, so the separate native b2 package makes sense and is a reasonable way to get the right compiler used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, great PR description 👍 . However in 6cba51e you've forgotten to remove the unused_var_in_process.patch
file.
68d53e8
to
207f820
Compare
We already have $(package)_ar, so just use that instead
207f820
to
f190343
Compare
Pushed a pure-rebase. Still ready for merge! |
Concept and code review ACK f190343 |
This was forgotten in bitcoin#19764.
0918eb4 doc: Document current boost dependency as 1.71.0 (Wladimir J. van der Laan) Pull request description: This was forgotten in bitcoin#19764. ACKs for top commit: practicalswift: ACK 0918eb4 fanquake: ACK 0918eb4 Tree-SHA512: bd4a39b96b95adeb725767b283f4cf04d9f0d6ac352e7dc67f88cf575b00a24c6d3f4bf51fe362e0c89aeebb6c7e8e9add9f9f17e843121efd30f8edef6128bc
…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
0918eb4 doc: Document current boost dependency as 1.71.0 (Wladimir J. van der Laan) Pull request description: This was forgotten in bitcoin#19764. ACKs for top commit: practicalswift: ACK 0918eb4 fanquake: ACK 0918eb4 Tree-SHA512: bd4a39b96b95adeb725767b283f4cf04d9f0d6ac352e7dc67f88cf575b00a24c6d3f4bf51fe362e0c89aeebb6c7e8e9add9f9f17e843121efd30f8edef6128bc
Boost build backports Cherry-picked from the following upstream PRs: - bitcoin/bitcoin#17087 - bitcoin/bitcoin#17231 - bitcoin/bitcoin#17928 - bitcoin/bitcoin#18820 - bitcoin/bitcoin#19764 Kudos to @dongcarl for all the excellent upstream depends system hackery!
de7766c Build: Update Boost download URL (Fuzzbawls) 7be66c9 Doc: document updated boost version in dependencies.md (Fuzzbawls) bcb77b6 depends: boost: Specify cflags+compileflags (Carl Dong) b8f8574 depends: boost: Remove unnecessary _archiver_ (Carl Dong) 29fdbd9 depends: boost: Cleanup toolset selection (Carl Dong) 28393b6 depends: boost: Cleanup architecture/address-model (Carl Dong) 6af3ffa depends: boost: Disable all compression (Carl Dong) 0f09788 depends: boost: Split into non-/native packages (Carl Dong) de97b06 depends: boost: Bump to 1.71.0 (Carl Dong) 19f474b depends: boost: Refer to version in URL (Carl Dong) 7d4257c depends: Propagate only specific CLI variables to sub-makes (Carl Dong) fcbf870 depends: boost: Use clang toolset if clang in CXX (Carl Dong) aad5009 depends: boost: Split target-os from toolset (Carl Dong) fae749b depends: boost: Specify toolset to bootstrap.sh (Carl Dong) c2bfedb depends: Propagate well-known vars into depends (Carl Dong) 091ae4a depends: Consistent use of package variable (Peter Bushnell) 635bdc1 depends: fix boost mac cross build with clang 9+ (Cory Fields) d796365 build: Add variable printing target to Makefiles (Carl Dong) Pull request description: Backports the following upstream PRs to clean up and update the Boost dependency - bitcoin#17087 - bitcoin#17231 - bitcoin#17928 - bitcoin#18820 - bitcoin#19764 ACKs for top commit: random-zebra: ACK de7766c furszy: no code changes after rebase, utACK de7766c and merging.. Tree-SHA512: 4abe88718892bce40a2df023e99a26a16ce3c5d470f55e70d6c6cca117ee8b8bb29968be6d40873bc9ece3f9df769bea248cbb38c1c5c2f318016702533f2736
The bare minimum necessary change for bitcoin#19764. Marked as "partial merge" for attribution only, otherwise considered unmerged
merge bitcoin#18820, bitcoin#19764, bitcoin#13686, bitcoin#17538, bitcoin#18405: zmq backports, boost depends split
7a89f2e build: Fix target name (Hennadii Stepanov) Pull request description: It seems like a typo :) This PR: - fixes errors when building a package in depends for `HOST=x86_64-apple-darwin16` (fix bitcoin#19799) - is a correct alternative to bitcoin@d25e0e3 from bitcoin#19764 ACKs for top commit: icota: tACK bitcoin@7a89f2e dongcarl: Code Review ACK 7a89f2e theuni: ACK 7a89f2e. Tree-SHA512: a0bcbc6805d3450e201476ef1e22e0eb53903db1586c5515314c19afd337bded887e56de0fbe62feaf359b2de15dbccd49a44f1a8b566b4c64f5ae3d94a2ab6d
7a89f2e build: Fix target name (Hennadii Stepanov) Pull request description: It seems like a typo :) This PR: - fixes errors when building a package in depends for `HOST=x86_64-apple-darwin16` (fix bitcoin#19799) - is a correct alternative to bitcoin@d25e0e3 from bitcoin#19764 ACKs for top commit: icota: tACK bitcoin@7a89f2e dongcarl: Code Review ACK 7a89f2e theuni: ACK 7a89f2e. Tree-SHA512: a0bcbc6805d3450e201476ef1e22e0eb53903db1586c5515314c19afd337bded887e56de0fbe62feaf359b2de15dbccd49a44f1a8b566b4c64f5ae3d94a2ab6d
7a89f2e build: Fix target name (Hennadii Stepanov) Pull request description: It seems like a typo :) This PR: - fixes errors when building a package in depends for `HOST=x86_64-apple-darwin16` (fix bitcoin#19799) - is a correct alternative to bitcoin@d25e0e3 from bitcoin#19764 ACKs for top commit: icota: tACK bitcoin@7a89f2e dongcarl: Code Review ACK 7a89f2e theuni: ACK 7a89f2e. Tree-SHA512: a0bcbc6805d3450e201476ef1e22e0eb53903db1586c5515314c19afd337bded887e56de0fbe62feaf359b2de15dbccd49a44f1a8b566b4c64f5ae3d94a2ab6d
This PR improves the robustness of our boost package in depends, most notably:
1.70.0
to1.71.0
, because1.71.0
:bitcoin/depends/packages/boost.mk
Line 36 in f8462a6
Upstream boost patched it out in boostorg/process@d20b64c, which was first included in the
1.71.0
releaseb2
which allows us to override itsCXX
andCXXFLAGS
. Previously, choosing a toolset while buildingb2
such asclang
orgcc
would forceb2
's build system to invoke the compiler as a bare, hardcodedclang
orgcc
. However, ourdepends
build system often want to customize this behaviour, adding extra flags or invoking the compiler by an alternate name. So this is useful.CXX
was introduced: boostorg/build@374f965CXXFLAGS
was introduced: boostorg/build@5d49abcnative_b2
andboost
, better representing what actually happens.depends
build system, we have a distinction betweennative
packages and non-native
packages. The output ofnative
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 independs
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 calledb2
, which is run on the machine that's performing the build. This means thatb2
is anative
package which is being built in an environment set up for the non-native
packageboost
. This reveals a hidden unintended behavior in ourdepends
build system: for linux->darwin cross builds, we usegcc
fornative
packages, andclang
for non-native
packages. Butb2
was actually being built usingclang
, since it was being built in an environment set up for non-native
packages.theuni you might be interested in taking a look