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

lib{std,}c++: Fix setup hooks for cross #39947

Merged
merged 1 commit into from May 3, 2018

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented May 3, 2018

Motivation for this change

This was causing trouble with iOS cross compilation and C++. libstdc++ is prebuilt, but CC_FOR_BUILD wrapper's libcxx was adding a -stdlib=libc+.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

CC @kmicklas @ElvishJerricco

@Ericson2314 Ericson2314 requested a review from LnL7 May 3, 2018 22:02
@Ericson2314 Ericson2314 changed the base branch from master to staging May 3, 2018 22:02
@Ericson2314 Ericson2314 merged commit 88d18d2 into NixOS:staging May 3, 2018
@Ericson2314 Ericson2314 deleted the libcxx-cross branch May 3, 2018 22:20
# relative to the depending package. It is brought into scope of the setup hook
# defined as the role of the dependency whose hooks is being run.
case $hostOffset in
-1) local role='BUILD_' ;;
Copy link
Member

Choose a reason for hiding this comment

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

do setup-hooks always run inside of a function?

Copy link
Member Author

Choose a reason for hiding this comment

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

oh shit :D

Copy link
Member Author

Choose a reason for hiding this comment

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

They actually are, but also I should manually unset. I really wished local in a source file did the obvious thing ($1 does!), but that is not the case.

@dtzWill
Copy link
Member

dtzWill commented May 3, 2018

Hooray!

At a glance it seems a lot of setup-hooks (not just these, but elsewhere) have similar code copied around to handle cross properly. Is there perhaps a way that can be abstracted to a single place?
Something to think about / put on the TODO O:).

@Ericson2314
Copy link
Member Author

@dtzWill Yes indeed! I already want to factor out common bits in *-wrapper so I can write a pkgconfig-wrapper without hating myself. [Then we can use that from the other two *-wrappers and get rid of NIX_CXXSTDLIB* altogether. Yay!]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants