Skip to content

Commit a0a35b6

Browse files
Fix cross eval issues (#362546)
2 parents d6b7f32 + 276fe40 commit a0a35b6

File tree

14 files changed

+34
-34
lines changed

14 files changed

+34
-34
lines changed

doc/doc-support/lib-function-docs.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ stdenvNoCC.mkDerivation {
9595
fileset = ../../lib;
9696
};
9797

98-
buildInputs = [
98+
nativeBuildInputs = [
9999
nixdoc
100100
nix
101101
];

doc/tests/manpage-urls.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ invalidateFetcherByDrvHash (
1717
{
1818
nativeBuildInputs = [
1919
cacert
20-
(python3.withPackages (p: [
20+
(python3.pythonOnBuildForHost.withPackages (p: [
2121
p.aiohttp
2222
p.rich
2323
p.structlog

lib/tests/release.nix

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
11
{ # The pkgs used for dependencies for the testing itself
22
# Don't test properties of pkgs.lib, but rather the lib in the parent directory
33
pkgs ? import ../.. {} // { lib = throw "pkgs.lib accessed, but the lib tests should use nixpkgs' lib path directly!"; },
4+
# For testing someone may edit impure.nix to return cross pkgs, use `pkgsBuildBuild` directly so everything here works.
5+
pkgsBB ? pkgs.pkgsBuildBuild,
46
nix ? pkgs-nixVersions.stable,
57
nixVersions ? [ pkgs-nixVersions.minimum nix pkgs-nixVersions.latest ],
6-
pkgs-nixVersions ? import ./nix-for-tests.nix { inherit pkgs; },
8+
pkgs-nixVersions ? import ./nix-for-tests.nix { pkgs = pkgsBB; },
79
}:
810

911
let
1012
lib = import ../.;
1113
testWithNix = nix:
12-
import ./test-with-nix.nix { inherit lib nix pkgs; };
14+
import ./test-with-nix.nix {
15+
inherit lib nix;
16+
pkgs = pkgsBB;
17+
};
1318

1419
in
15-
pkgs.symlinkJoin {
20+
pkgsBB.symlinkJoin {
1621
name = "nixpkgs-lib-tests";
1722
paths = map testWithNix nixVersions;
1823
}

pkgs/applications/networking/cluster/k3s/builder.nix

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,25 +138,25 @@ let
138138
s:
139139
mutFirstChar lib.toLower (lib.concatMapStrings (mutFirstChar lib.toUpper) (lib.splitString "-" s));
140140

141-
# finds the images archive for the desired architecture, aborts in case no suitable archive is found
141+
# finds the images archive for the desired architecture, throws in case no suitable archive is found
142142
findImagesArchive =
143143
arch:
144144
let
145145
imagesVersionsNames = builtins.attrNames imagesVersions;
146146
in
147147
lib.findFirst (
148148
n: lib.hasInfix arch n
149-
) (abort "k3s: no airgap images for ${arch} available") imagesVersionsNames;
149+
) (throw "k3s: no airgap images for ${arch} available") imagesVersionsNames;
150150

151151
# a shortcut that provides the images archive for the host platform. Currently only supports
152-
# aarch64 (arm64) and x86_64 (amd64), aborts on other architectures.
152+
# aarch64 (arm64) and x86_64 (amd64), throws on other architectures.
153153
airgapImages = fetchurl (
154154
if stdenv.hostPlatform.isAarch64 then
155155
imagesVersions.${findImagesArchive "arm64"}
156156
else if stdenv.hostPlatform.isx86_64 then
157157
imagesVersions.${findImagesArchive "amd64"}
158158
else
159-
abort "k3s: airgap images cannot be found automatically for architecture ${stdenv.hostPlatform.linuxArch}, consider using an image archive with an explicit architecture."
159+
throw "k3s: airgap images cannot be found automatically for architecture ${stdenv.hostPlatform.linuxArch}, consider using an image archive with an explicit architecture."
160160
);
161161

162162
# so, k3s is a complicated thing to package

pkgs/by-name/de/debase/package.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ stdenv.mkDerivation rec {
7272
else if stdenv.hostPlatform.isAarch64 then
7373
"arm64"
7474
else
75-
abort "unsupported system: ${stdenv.system}"
75+
throw "unsupported system: ${stdenv.system}"
7676
}"
7777
];
7878

pkgs/by-name/fr/frr/package.nix

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,9 @@
3333
, nettools
3434
, nixosTests
3535

36-
# FRR's configure.ac gets SNMP options by executing net-snmp-config on the build host
37-
# This leads to compilation errors when cross compiling.
38-
# E.g. net-snmp-config for x86_64 does not return the ARM64 paths.
39-
#
40-
# SNMP_LIBS="`${NETSNMP_CONFIG} --agent-libs`"
41-
# SNMP_CFLAGS="`${NETSNMP_CONFIG} --base-cflags`"
42-
, snmpSupport ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
43-
44-
# other general options besides snmp support
36+
37+
# general options
38+
, snmpSupport ? true
4539
, rpkiSupport ? true
4640
, numMultipath ? 64
4741
, watchfrrSupport ? true
@@ -81,9 +75,6 @@
8175
, ospfApi ? true
8276
}:
8377

84-
lib.warnIf (!(stdenv.buildPlatform.canExecute stdenv.hostPlatform))
85-
"cannot enable SNMP support due to cross-compilation issues with net-snmp-config"
86-
8778
stdenv.mkDerivation (finalAttrs: {
8879
pname = "frr";
8980
version = "10.1";
@@ -194,6 +185,9 @@ stdenv.mkDerivation (finalAttrs: {
194185
(lib.strings.enableFeature ospfApi "ospfapi")
195186
# Cumulus options
196187
(lib.strings.enableFeature cumulusSupport "cumulus")
188+
] ++ lib.optionals snmpSupport [
189+
# Used during build for paths, `dev` has build shebangs so can be run during build.
190+
"NETSNMP_CONFIG=${lib.getDev net-snmp}/bin/net-snmp-config"
197191
];
198192

199193
postPatch = ''

pkgs/by-name/ni/nim-unwrapped-2_2/package.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ let
4545
else if isx86_64 then
4646
"amd64"
4747
else
48-
abort "no Nim CPU support known for ${config}";
48+
throw "no Nim CPU support known for ${config}";
4949

5050
parseOs =
5151
platform:
@@ -72,7 +72,7 @@ let
7272
else if isiOS then
7373
"iOS"
7474
else
75-
abort "no Nim OS support known for ${config}";
75+
throw "no Nim OS support known for ${config}";
7676

7777
parsePlatform = p: {
7878
cpu = parseCpu p;

pkgs/by-name/re/reposilite/plugins.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
makeScopeWithSplicing',
44
}:
55
makeScopeWithSplicing' {
6-
otherSplices = generateSplicesForMkScope;
6+
otherSplices = generateSplicesForMkScope "reposilitePlugins";
77
f =
88
self:
99
{

pkgs/by-name/sa/saleae-logic/package.nix

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ let
2222

2323
in
2424

25-
assert stdenv.hostPlatform.system == "x86_64-linux";
26-
2725
stdenv.mkDerivation rec {
2826
pname = "saleae-logic";
2927
version = "1.2.18";
@@ -92,7 +90,7 @@ stdenv.mkDerivation rec {
9290
homepage = "https://www.saleae.com/";
9391
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
9492
license = licenses.unfree;
95-
platforms = platforms.linux;
93+
platforms = intersectLists platforms.x86_64 platforms.linux;
9694
maintainers = [ maintainers.bjornfor ];
9795
};
9896
}

pkgs/by-name/vi/virtual-ans/package.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
4646
startScript = if stdenv.hostPlatform.isx86_32 then "START_LINUX_X86"
4747
else if stdenv.hostPlatform.isx86_64 then "START_LINUX_X86_64"
4848
#else if stdenv.hostPlatform.isDarwin then "START_MACOS.app" # disabled because I cannot test on Darwin
49-
else abort "Unsupported platform: ${stdenv.hostPlatform.linuxArch}.";
49+
else throw "Unsupported platform: ${stdenv.hostPlatform.linuxArch}.";
5050

5151
linuxExecutable = if stdenv.hostPlatform.isx86_32 then "pixilang_linux_x86"
5252
else if stdenv.hostPlatform.isx86_64 then "pixilang_linux_x86_64"

0 commit comments

Comments
 (0)