Hey, I’m working on packaging gccrs and gcobol for nixos, like how gccgo is already packaged. You can see my work in gccrs, gcobol: improve support and package by sempiternal-aurora · Pull Request #507407 · NixOS/nixpkgs · GitHub . However, I’m running into evaluation issues with gccrs. When I override gcc.cc with withRust = true, I get an evaluation error, but overriding gcc15 has no similar problems, even though they are the same package? Can someone help me look at this, I’m extremely confused.
The problem seems to inherantly come from the optionals langRust [ cargo ] in pkgs/development/compilers/gcc/common/dependencies.nix, added in gcc: provide build support for gccrs by nagy · Pull Request #332738 · NixOS/nixpkgs · GitHub . Removing this fixes the evaluation, but breaks the gccrs build as it needs cargo for some rust in the code. Is there some problem with how the dependencies are specified, is there a circular import problem where we’re overriding the gcc that is used to build the rust system somehow? The full trace just doesn’t give me a lot to go on from what I can see. Any help is highly appreciated.
error:
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:37:12:
36|
37| strict = derivationStrict drvAttrs;
| ^
38|
… while evaluating derivation 'gccrs-wrapper-15.2.0'
whose name attribute is located at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/pkgs/stdenv/generic/make-derivation.nix:536:13
… while evaluating attribute 'cc' of derivation 'gccrs-wrapper-15.2.0'
… while calling the 'getAttr' builtin
at <nix/derivation-internal.nix>:50:17:
49| value = commonAttrs // {
50| outPath = builtins.getAttr outputName strict;
| ^
51| drvPath = strict.drvPath;
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:37:12:
36|
37| strict = derivationStrict drvAttrs;
| ^
38|
… while evaluating derivation 'gccrs-15.2.0'
whose name attribute is located at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/pkgs/stdenv/generic/make-derivation.nix:536:13
… while evaluating attribute 'nativeBuildInputs' of derivation 'gccrs-15.2.0'
at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/pkgs/stdenv/generic/make-derivation.nix:585:13:
584| depsBuildBuild = elemAt (elemAt dependencies 0) 0;
585| nativeBuildInputs = elemAt (elemAt dependencies 0) 1;
| ^
586| depsBuildTarget = elemAt (elemAt dependencies 0) 2;
… while calling the 'getAttr' builtin
at <nix/derivation-internal.nix>:50:17:
49| value = commonAttrs // {
50| outPath = builtins.getAttr outputName strict;
| ^
51| drvPath = strict.drvPath;
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:37:12:
36|
37| strict = derivationStrict drvAttrs;
| ^
38|
… while evaluating derivation 'cargo-1.94.0'
whose name attribute is located at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/pkgs/stdenv/generic/make-derivation.nix:536:13
… while evaluating attribute 'buildInputs' of derivation 'cargo-1.94.0'
at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/pkgs/stdenv/generic/make-derivation.nix:588:13:
587| depsHostHost = elemAt (elemAt dependencies 1) 0;
588| buildInputs = elemAt (elemAt dependencies 1) 1;
| ^
589| depsTargetTarget = elemAt (elemAt dependencies 2) 0;
… while calling the 'getAttr' builtin
at <nix/derivation-internal.nix>:50:17:
49| value = commonAttrs // {
50| outPath = builtins.getAttr outputName strict;
| ^
51| drvPath = strict.drvPath;
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:37:12:
36|
37| strict = derivationStrict drvAttrs;
| ^
38|
… while evaluating derivation 'curl-8.18.0'
whose name attribute is located at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/pkgs/stdenv/generic/make-derivation.nix:536:13
… while evaluating attribute 'configureFlags' of derivation 'curl-8.18.0'
at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/pkgs/stdenv/generic/make-derivation.nix:599:13:
598| # This parameter is sometimes a string, sometimes null, and sometimes a list, yuck
599| configureFlags =
| ^
600| configureFlags
… from call site
at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/pkgs/by-name/cu/curlMinimal/package.nix:190:6:
189| (lib.withFeature pslSupport "libpsl")
190| (lib.withFeatureAs brotliSupport "brotli" (lib.getDev brotli))
| ^
191| (lib.withFeatureAs gnutlsSupport "gnutls" (lib.getDev gnutls))
… while calling 'withFeatureAs'
at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/lib/strings.nix:2485:20:
2484| withFeatureAs =
2485| flag: feature: value:
| ^
2486| withFeature flag feature + optionalString flag "=${value}";
… from call site
at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/lib/strings.nix:2486:32:
2485| flag: feature: value:
2486| withFeature flag feature + optionalString flag "=${value}";
| ^
2487|
… while calling 'optionalString'
at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/lib/strings.nix:767:26:
766| */
767| optionalString = cond: string: if cond then string else "";
| ^
768|
… while calling the 'getAttr' builtin
at <nix/derivation-internal.nix>:50:17:
49| value = commonAttrs // {
50| outPath = builtins.getAttr outputName strict;
| ^
51| drvPath = strict.drvPath;
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:37:12:
36|
37| strict = derivationStrict drvAttrs;
| ^
38|
… while evaluating derivation 'brotli-1.2.0'
whose name attribute is located at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/pkgs/stdenv/generic/make-derivation.nix:536:13
… while evaluating attribute 'nativeBuildInputs' of derivation 'brotli-1.2.0'
at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/pkgs/stdenv/generic/make-derivation.nix:585:13:
584| depsBuildBuild = elemAt (elemAt dependencies 0) 0;
585| nativeBuildInputs = elemAt (elemAt dependencies 0) 1;
| ^
586| depsBuildTarget = elemAt (elemAt dependencies 0) 2;
… while calling the 'getAttr' builtin
at <nix/derivation-internal.nix>:50:17:
49| value = commonAttrs // {
50| outPath = builtins.getAttr outputName strict;
| ^
51| drvPath = strict.drvPath;
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:37:12:
36|
37| strict = derivationStrict drvAttrs;
| ^
38|
… while evaluating derivation 'cmake-4.1.2'
whose name attribute is located at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/pkgs/stdenv/generic/make-derivation.nix:536:13
… while evaluating attribute 'buildInputs' of derivation 'cmake-4.1.2'
at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/pkgs/stdenv/generic/make-derivation.nix:588:13:
587| depsHostHost = elemAt (elemAt dependencies 1) 0;
588| buildInputs = elemAt (elemAt dependencies 1) 1;
| ^
589| depsTargetTarget = elemAt (elemAt dependencies 2) 0;
… while calling the 'getAttr' builtin
at <nix/derivation-internal.nix>:50:17:
49| value = commonAttrs // {
50| outPath = builtins.getAttr outputName strict;
| ^
51| drvPath = strict.drvPath;
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:37:12:
36|
37| strict = derivationStrict drvAttrs;
| ^
38|
… while evaluating derivation 'curl-8.18.0'
whose name attribute is located at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/pkgs/stdenv/generic/make-derivation.nix:536:13
… while evaluating attribute 'propagatedBuildInputs' of derivation 'curl-8.18.0'
at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/pkgs/stdenv/generic/make-derivation.nix:595:13:
594| depsHostHostPropagated = elemAt (elemAt propagatedDependencies 1) 0;
595| propagatedBuildInputs = elemAt (elemAt propagatedDependencies 1) 1;
| ^
596| depsTargetTargetPropagated = elemAt (elemAt propagatedDependencies 2) 0;
… while calling the 'getAttr' builtin
at <nix/derivation-internal.nix>:50:17:
49| value = commonAttrs // {
50| outPath = builtins.getAttr outputName strict;
| ^
51| drvPath = strict.drvPath;
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:37:12:
36|
37| strict = derivationStrict drvAttrs;
| ^
38|
… while evaluating derivation 'nghttp2-1.67.1'
whose name attribute is located at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/pkgs/stdenv/generic/make-derivation.nix:536:13
… while evaluating attribute 'buildInputs' of derivation 'nghttp2-1.67.1'
at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/pkgs/stdenv/generic/make-derivation.nix:588:13:
587| depsHostHost = elemAt (elemAt dependencies 1) 0;
588| buildInputs = elemAt (elemAt dependencies 1) 1;
| ^
589| depsTargetTarget = elemAt (elemAt dependencies 2) 0;
… while calling the 'getAttr' builtin
at <nix/derivation-internal.nix>:50:17:
49| value = commonAttrs // {
50| outPath = builtins.getAttr outputName strict;
| ^
51| drvPath = strict.drvPath;
… while calling the 'derivationStrict' builtin
at <nix/derivation-internal.nix>:37:12:
36|
37| strict = derivationStrict drvAttrs;
| ^
38|
… while evaluating derivation 'libev-4.33'
whose name attribute is located at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/pkgs/stdenv/generic/make-derivation.nix:536:13
… while evaluating attribute 'patches' of derivation 'libev-4.33'
at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/pkgs/stdenv/generic/make-derivation.nix:610:21:
609|
610| inherit patches;
| ^
611|
… while calling a functor (an attribute set with a '__functor' attribute)
at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/pkgs/by-name/li/libev/package.nix:26:6:
25| patches = [
26| (fetchpatch {
| ^
27| url = "https://raw.githubusercontent.com/freebsd/freebsd-ports/21a6f0f5829384117dfc1ed11ad67954562ef7d6/devel/libev/files/patch-ev.c";
… from call site
at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/lib/trivial.nix:1081:5:
1080| # TODO: Should we add call-time "type" checking like built in?
1081| __functor = self: f;
| ^
1082| __functionArgs = args;
… while calling anonymous lambda
at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/pkgs/build-support/fetchpatch/default.nix:13:1:
12|
13| {
| ^
14| relative ? null,
… from call site
at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/pkgs/build-support/fetchpatch/default.nix:41:1:
40| in
41| lib.throwIfNot (excludes == [ ] || includes == [ ])
| ^
42| "fetchpatch: cannot use excludes and includes simultaneously"
error: function 'anonymous lambda' called with unexpected argument 'nativeBuildInputs'
at /nix/store/dkz5lh7c0m6rpj93cd3nc8j65zvar1m1-source/pkgs/build-support/fetchurl/boot.nix:10:1:
9|
10| {
| ^
11| url ? builtins.head urls,