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

gcc10 resolving to gcc 9.3.0 #89500

Closed
Mindavi opened this issue Jun 4, 2020 · 2 comments
Closed

gcc10 resolving to gcc 9.3.0 #89500

Mindavi opened this issue Jun 4, 2020 · 2 comments

Comments

@Mindavi
Copy link
Contributor

Mindavi commented Jun 4, 2020

Describe the bug

When I try to install gcc10 using nix-shell --pure -p gcc10, it seems to install gcc10. However, it's not available in the path and somehow gcc 9.3.0 is available in the path.

To Reproduce
Steps to reproduce the behavior:

nix-shell --pure -p gcc10
gcc --version

Expected behavior

I'd expect that gcc10 is available in the path after making a shell with the command listed above.

Actual behavior

$ gcc --version
gcc (GCC) 9.3.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Additional context

It seems like gcc10 is actually added to my store when running the command. I see that /nix/store/hzzgaw8ga9sfa8nk97h3xdmrhbdc55lj-gcc-10.1.0 is created and it indeed contains gcc10. However, I'd expect that making a pure shell with gcc10 would not result in the gcc9 package being available.

I also don't have gcc installed in my profile (nixos/configuration).

What's weird is that doing this does resolve to gcc10:

#shell.nix
with import <nixpkgs> {}; {
  qpidEnv = stdenvNoCC.mkDerivation {
    name = "gcc10-environment";
    buildInputs = [
      pkgs.gcc10
    ];
  };
}

Notify maintainers

@Synthetica9 @vnucat (can't tag, don't know why...)

Metadata

  • system: "x86_64-linux"
  • host os: Linux 5.6.15-hardened, NixOS, 20.09pre227577.135073a87b7 (Nightingale)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.3.5
  • channels(rick): ""
  • channels(root): "nixos-20.09pre228204.467ce5a9f45, nixpkgs-20.09pre228204.467ce5a9f45"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
@symphorien
Copy link
Member

The pure shell contains stdenv and gcc10. But stdenv itself contains gcc9. You must use gcc10Stdenv instead of stdenv. This cannot be done on the command line only, you must use a file:

with import <nixpkgs> {};
gcc10Stdenv.mkDerivation {
name="foo";
buildInputs = [];
}

and then nix-shell thefile.nix.

@Mindavi
Copy link
Contributor Author

Mindavi commented Jun 4, 2020

Okay, I guess this isn't an issue then. The behavior did feel confusing though. I did not expect gcc9 slipping in like that.

Thanks for the information!

@Mindavi Mindavi closed this as completed Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants