From the NixPkgs manual:
depsBuildBuild
A list of dependencies whose host and target platforms are the new derivation’s build platform. These are programs and libraries used at build time that produce programs and libraries also used at build time. If the dependency doesn’t care about the target platform (i.e. isn’t a compiler or similar tool), put it in
nativeBuildInputs
instead. The most common use of thisbuildPackages.stdenv.cc
, the default C compiler for this role. That example crops up more than one might think in old commonly used C libraries.
https://nixos.org/manual/nixpkgs/unstable/#var-stdenv-depsBuildBuild
However:
Now, for most of Nixpkgs’s history, there were no
pkgs<host><target>
attributes, and most packages have not been refactored to use it explicitly. Prior to those, there were justbuildPackages
,pkgs
, andtargetPackages
. Those are now redefined as aliases topkgsBuildHost
,pkgsHostTarget
, andpkgsTargetTarget
. It is acceptable, even recommended, to use them for libraries to show that the host platform is irrelevant.
https://nixos.org/manual/nixpkgs/unstable/#ssec-cross-dependency-implementation
So as far as I understand it we put packages that are supposed to run on the buildPlatform and produce binaries for the hostPlatform in the dependency list for packages that are supposed to run on and produce binaries for the buildPlatform.
Whattt?
And if we just put stdenv.cc
into there, wouldn’t splicing
just automatically select
pkgsBuildBuild
for us?