When building with any of the devkitNix.stdenv* stdenv's, the derivation's nativeBuildInputs are completely ignored, e.g.:
devkitNix.stdenvA64.stdenv.mkDerivation(finalAttrs: {
nativeBuildInputs = [ cmake ];
})
nativeBuildInputs ends up just being [ devkitA64 ].
This is because addAttrsToDerivation doesn't handle merging lists well, it just overwrites them:
stdenvA64 = pkgs.stdenvAdapters.addAttrsToDerivation {
nativeBuildInputs = [ devkitA64 ];
env.DEVKITPRO = devkitA64 + "/opt/devkitpro";
} pkgs.stdenvNoCC;
You can confirm this by commenting nativeBuildInputs = [ devkitA64 ]; - the build fails of course, but nativeBuildInputs now contains cmake.
I'm not sure what the best solution here is tbh.
If this is addAttrsToDerivation:
addAttrsToDerivation =
extraAttrs: stdenv:
stdenv.override (old: {
mkDerivationFromStdenv = extendMkDerivationArgs old (_: extraAttrs);
});
immediately above it is propagateBuildInputs, so maybe this could be tweaked to do the same except with nativeBuildInputs?
propagateBuildInputs =
stdenv:
stdenv.override (old: {
mkDerivationFromStdenv = extendMkDerivationArgs old (args: {
propagatedBuildInputs = (args.propagatedBuildInputs or [ ]) ++ (args.buildInputs or [ ]);
buildInputs = [ ];
});
});
When building with any of the
devkitNix.stdenv*stdenv's, the derivation'snativeBuildInputsare completely ignored, e.g.:nativeBuildInputsends up just being[ devkitA64 ].This is because
addAttrsToDerivationdoesn't handle merging lists well, it just overwrites them:You can confirm this by commenting
nativeBuildInputs = [ devkitA64 ];- the build fails of course, butnativeBuildInputsnow containscmake.I'm not sure what the best solution here is tbh.
If this is
addAttrsToDerivation:immediately above it is
propagateBuildInputs, so maybe this could be tweaked to do the same except withnativeBuildInputs?