Skip to content
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

boost: fix cross-compile support #114411

Merged
merged 2 commits into from
Mar 3, 2021
Merged

boost: fix cross-compile support #114411

merged 2 commits into from
Mar 3, 2021

Conversation

oxalica
Copy link
Contributor

@oxalica oxalica commented Feb 25, 2021

Motivation for this change

Fixes cross-compile support for boost. Fixes #96336.

This PR is just to speed up #105478 since it is stalled for months. Changes requested are applied.

Tested to be built successfully: (on 8d46a65f63226c50d3c73ea309e7e35453c7d5fc)

  • boost{15x,16x,17x} (not changed)
  • pkgsCross.aarch64-multiplatform.boost{15x,16x,17x}
  • pkgsCross.riscv64.boost17x

Related: #101651
Closes: #105478

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

cc @hlandau @veprbl @r-burns

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Feb 25, 2021
@oxalica oxalica changed the base branch from master to staging February 26, 2021 07:39
@ofborg ofborg bot added 6.topic: cinnamon Desktop environment 6.topic: emacs Text editor 6.topic: GNOME GNOME desktop environment and its underlying platform 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 6.topic: ocaml 6.topic: policy discussion 6.topic: printing 6.topic: python 6.topic: rust 6.topic: stdenv Standard environment 6.topic: steam Steam game store/launcher (store.steampowered.com) labels Feb 26, 2021
@ofborg ofborg bot removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Feb 26, 2021
@Mic92
Copy link
Member

Mic92 commented Feb 26, 2021

@Mic92 Oops, sorry for it. I should rebase before switching merge target... Now rebased.

You can also write rebase staging with a leading / to make a bot do the rebase.

@r-burns
Copy link
Contributor

r-burns commented Feb 26, 2021

I thought only committers can do the rebase bot command, no?

@oxalica
Copy link
Contributor Author

oxalica commented Feb 27, 2021

@veprbl

... or have --with-bjam=${boost-build}/bin/b2

I just realized that there is already boost-build in nixpkgs. I tried to upgrade it and it successfully builds boost.
I prefer this approach, but it will cause a mass rebuild once boost-build is upgraded (if a new boost release requires a new boost-build).

Otherwise, if we want to minimize rebuilds when adding a new boost version, maybe we should apply this:

+ sed '2iexport CXX=$CXX_FOR_BUILD' -i ./tools/build/src/engine/build.sh

What do you think?

@veprbl
Copy link
Member

veprbl commented Feb 27, 2021

Supporting build with external boost-build may put extra burden on maintainers, so I, personally, would not call for that. I think it would only be viable if we extracted the exact boost-build version that corresponds to each given boost version (e.g. by looking at the submodule versions at https://github.com/boostorg/boost/tree/master/tools). That should prevent possible incompatibilities.

@oxalica
Copy link
Contributor Author

oxalica commented Mar 1, 2021

I changed to patch ./tools/build/src/engine/build.sh instead, to keep using in-tree boost-build.
The reason why I use sed instead of add a patch is to avoid multiple version-specific patches required.

If this is acceptable, we can rebase it back to master, since it doesn't break non-cross build anymore.

@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux and removed 10.rebuild-darwin: 501+ 10.rebuild-darwin: 501-1000 10.rebuild-linux: 501+ 10.rebuild-linux: 5001+ labels Mar 1, 2021
@veprbl
Copy link
Member

veprbl commented Mar 2, 2021

/rebase master

@github-actions github-actions bot changed the base branch from staging to master March 2, 2021 02:05
@github-actions github-actions bot closed this Mar 2, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2021

Rebased, please reopen the pull request to restart CI

@veprbl veprbl reopened this Mar 2, 2021
Copy link
Member

@Mic92 Mic92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not tested but change looks minimal invasive.

@veprbl veprbl merged commit 74e20c9 into NixOS:master Mar 3, 2021
@oxalica oxalica deleted the fix/boost-riscv branch March 4, 2021 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

boost: Doesn't cross compile
6 participants