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

Don't set cxx_stdlib when nativeTools on linux #32498

Merged
merged 1 commit into from Dec 17, 2017
Merged

Conversation

dylex
Copy link
Contributor

@dylex dylex commented Dec 9, 2017

There are no gcc paths with nativeTools, and cc isn't set.

When attempting to use nativeTools on linux, an error is produced trying to expand cc.gcc to set default_cxx_stdlib_compile. I'm guessing this would only happen on obscure unsupported linux architectures. In this case, however, I purposefully want to use nativeTools for a special build, so I'm using:

import <nixpkgs> { stdenvStages = import <nixpkgs/pkgs/stdenv/native> };

which produces:

value is null while a set was expected, at .../nixpkgs/pkgs/build-support/cc-wrapper/default.nix:50:27

If there is a better way to make this work (creating a native tools-based stdenv on linux), that's fine, too.
I realize there are reasons against and risks in doing this, but it is not meant to build a full system.

I don't believe this will break any normal use case, but I'm not entirely sure.

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.

@@ -46,7 +46,7 @@ let
# The wrapper scripts use 'cat' and 'grep', so we may need coreutils.
coreutils_bin = if nativeTools then "" else getBin coreutils;

default_cxx_stdlib_compile=optionalString (targetPlatform.isLinux && !(cc.isGNU or false))
default_cxx_stdlib_compile=optionalString (!nativeTools && targetPlatform.isLinux && !(cc.isGNU or false))
Copy link
Member

@Mic92 Mic92 Dec 9, 2017

Choose a reason for hiding this comment

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

gcc should usually not receive these arguments because of !cc.isGNU. Do you mean clang?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do I mean clang where? In this case it's just about when cc is null (so we don't really know what the compiler is).

There are no gcc paths on nativeTools, and cc isn't set.
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

5 participants