I am requesting GCC 8, but I get GCC 7 instead.
$ nix-shell -p gcc8
[nix-shell:~]$ gcc --version
gcc (GCC) 7.3.0
What is going on?
You need to base your environment on stdenvNoCC, instead of stdenv
That means, you may create a shell.nix or default.nix file in your current directory, defining the environment, and then run nix-shell.
with import <nixpkgs> {}; {
qpidEnv = stdenvNoCC.mkDerivation {
name = "my-gcc8-environment";
buildInputs = [
gcc8
go
ruby_2_4
gdb
swig
# libev
#...
];
};
}
Now, it works as expected
$ nix-shell
[nix-shell:~]$ gcc --version
gcc (GCC) 8.1.0
Source: https://groups.google.com/forum/#!topic/nix-devel/of6P-sEtQN0
cmake version 2.8.8? And by the way, from the looks of gcc8 or ruby_2_4 it seems that the version has no standard way of format and it is hard-to-get. Is there an index listing of these various versions?
cmake_2_8 into the package list work? The various ruby etc. packages in the answer are not needed for gcc to work, it is just what environment I needed besides gcc8 at that moments
Use nix run instead. It behaves better, and also has nicer progress indicator when downloading packages.
jdanek@nixos ~ % nix run -f channel:nixos-19.03 gcc8
[jdanek@nixos:~]$ gcc --version
gcc (GCC) 8.3.0