splice.nix: make pkgs splicedPackages when required
This will make `pkgs` used in `callPackage`, and `pkgsCross.X.pkgs` have packages with `__spliced`.3029741718/pkgs/development/interpreters/python/passthrufun.nix (L37)d2bd9a39de/pkgs/top-level/python-packages.nix (L10720)``` nix-repl> pkgsCross.aarch64-multiplatform.python3Packages.protobuf4.protobuf.__spliced error: … while evaluating the attribute 'aarch64-multiplatform.python3Packages.protobuf4.protobuf.__spliced' at /home/artturin/nixgits/my-nixpkgs/.worktree/1/pkgs/development/python-modules/protobuf/4.nix:119:13: 118| passthru = { 119| inherit protobuf; | ^ 120| }; error: attribute '__spliced' missing at «string»:1:1: 1| pkgsCross.aarch64-multiplatform.python3Packages.protobuf4.protobuf.__spliced | ^ ``` to ``` nix-repl> pkgsCross.aarch64-multiplatform.python3Packages.protobuf4.protobuf.__spliced { buildBuild = «derivation /nix/store/s7da5mfvx4h1n86j78knaj9cprglxqz6-protobuf-25.4.drv»; buildHost = «derivation /nix/store/s7da5mfvx4h1n86j78knaj9cprglxqz6-protobuf-25.4.drv»; buildTarget = «repeated»; hostHost = «derivation /nix/store/mszvybzs4zxh43awyrjnybsfcb265n9r-protobuf-aarch64-unknown-linux-gnu-25.4.drv»; hostTarget = «repeated»; } ``` Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
This commit is contained in:
committed by
Wolfgang Walther
parent
1d4ca026bc
commit
2494e3664f
@@ -2,6 +2,8 @@
|
||||
lib,
|
||||
stdenv,
|
||||
pkgs,
|
||||
overrideCC,
|
||||
buildPackages,
|
||||
targetPackages,
|
||||
callPackage,
|
||||
isl_0_20,
|
||||
@@ -62,7 +64,7 @@ let
|
||||
)
|
||||
&& stdenv.cc.isGNU
|
||||
then
|
||||
pkgs."gcc${majorVersion}Stdenv"
|
||||
overrideCC stdenv buildPackages."gcc${majorVersion}"
|
||||
else
|
||||
stdenv;
|
||||
}
|
||||
|
||||
@@ -27,11 +27,11 @@ lib.makeScope newScope (
|
||||
else
|
||||
buildPackages.gccWithoutTargetLibc.override (old: {
|
||||
bintools = old.bintools.override {
|
||||
libc = pkgs.libc;
|
||||
libc = pkgs.pkgsHostTarget.libc;
|
||||
noLibc = pkgs.libc == null;
|
||||
nativeLibc = false;
|
||||
};
|
||||
libc = pkgs.libc;
|
||||
libc = pkgs.pkgsHostTarget.libc;
|
||||
noLibc = pkgs.libc == null;
|
||||
nativeLibc = false;
|
||||
})
|
||||
|
||||
@@ -6320,7 +6320,7 @@ with pkgs;
|
||||
null;
|
||||
bintoolsNoLibc = wrapBintoolsWith {
|
||||
bintools = bintools-unwrapped;
|
||||
libc = targetPackages.preLibcHeaders;
|
||||
libc = targetPackages.preLibcHeaders or preLibcHeaders;
|
||||
};
|
||||
bintools = wrapBintoolsWith {
|
||||
bintools = bintools-unwrapped;
|
||||
|
||||
@@ -173,6 +173,8 @@ in
|
||||
|
||||
newScope = extra: lib.callPackageWith (pkgsForCall // extra);
|
||||
|
||||
pkgs = if actuallySplice then splicedPackages // { recurseForDerivations = false; } else pkgs;
|
||||
|
||||
# prefill 2 fields of the function for convenience
|
||||
makeScopeWithSplicing = lib.makeScopeWithSplicing splicePackages pkgs.newScope;
|
||||
makeScopeWithSplicing' = lib.makeScopeWithSplicing' {
|
||||
|
||||
Reference in New Issue
Block a user