Fix cross eval issues (#362546)

This commit is contained in:
sternenseemann 2024-12-14 22:14:52 +01:00 committed by GitHub
commit a0a35b6c24
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 33 additions and 33 deletions

View file

@ -95,7 +95,7 @@ stdenvNoCC.mkDerivation {
fileset = ../../lib;
};
buildInputs = [
nativeBuildInputs = [
nixdoc
nix
];

View file

@ -17,7 +17,7 @@ invalidateFetcherByDrvHash (
{
nativeBuildInputs = [
cacert
(python3.withPackages (p: [
(python3.pythonOnBuildForHost.withPackages (p: [
p.aiohttp
p.rich
p.structlog

View file

@ -1,18 +1,23 @@
{ # The pkgs used for dependencies for the testing itself
# Don't test properties of pkgs.lib, but rather the lib in the parent directory
pkgs ? import ../.. {} // { lib = throw "pkgs.lib accessed, but the lib tests should use nixpkgs' lib path directly!"; },
# For testing someone may edit impure.nix to return cross pkgs, use `pkgsBuildBuild` directly so everything here works.
pkgsBB ? pkgs.pkgsBuildBuild,
nix ? pkgs-nixVersions.stable,
nixVersions ? [ pkgs-nixVersions.minimum nix pkgs-nixVersions.latest ],
pkgs-nixVersions ? import ./nix-for-tests.nix { inherit pkgs; },
pkgs-nixVersions ? import ./nix-for-tests.nix { pkgs = pkgsBB; },
}:
let
lib = import ../.;
testWithNix = nix:
import ./test-with-nix.nix { inherit lib nix pkgs; };
import ./test-with-nix.nix {
inherit lib nix;
pkgs = pkgsBB;
};
in
pkgs.symlinkJoin {
pkgsBB.symlinkJoin {
name = "nixpkgs-lib-tests";
paths = map testWithNix nixVersions;
}

View file

@ -138,7 +138,7 @@ let
s:
mutFirstChar lib.toLower (lib.concatMapStrings (mutFirstChar lib.toUpper) (lib.splitString "-" s));
# finds the images archive for the desired architecture, aborts in case no suitable archive is found
# finds the images archive for the desired architecture, throws in case no suitable archive is found
findImagesArchive =
arch:
let
@ -146,17 +146,17 @@ let
in
lib.findFirst (
n: lib.hasInfix arch n
) (abort "k3s: no airgap images for ${arch} available") imagesVersionsNames;
) (throw "k3s: no airgap images for ${arch} available") imagesVersionsNames;
# a shortcut that provides the images archive for the host platform. Currently only supports
# aarch64 (arm64) and x86_64 (amd64), aborts on other architectures.
# aarch64 (arm64) and x86_64 (amd64), throws on other architectures.
airgapImages = fetchurl (
if stdenv.hostPlatform.isAarch64 then
imagesVersions.${findImagesArchive "arm64"}
else if stdenv.hostPlatform.isx86_64 then
imagesVersions.${findImagesArchive "amd64"}
else
abort "k3s: airgap images cannot be found automatically for architecture ${stdenv.hostPlatform.linuxArch}, consider using an image archive with an explicit architecture."
throw "k3s: airgap images cannot be found automatically for architecture ${stdenv.hostPlatform.linuxArch}, consider using an image archive with an explicit architecture."
);
# so, k3s is a complicated thing to package

View file

@ -72,7 +72,7 @@ stdenv.mkDerivation rec {
else if stdenv.hostPlatform.isAarch64 then
"arm64"
else
abort "unsupported system: ${stdenv.system}"
throw "unsupported system: ${stdenv.system}"
}"
];

View file

@ -33,15 +33,9 @@
, nettools
, nixosTests
# FRR's configure.ac gets SNMP options by executing net-snmp-config on the build host
# This leads to compilation errors when cross compiling.
# E.g. net-snmp-config for x86_64 does not return the ARM64 paths.
#
# SNMP_LIBS="`${NETSNMP_CONFIG} --agent-libs`"
# SNMP_CFLAGS="`${NETSNMP_CONFIG} --base-cflags`"
, snmpSupport ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
# other general options besides snmp support
# general options
, snmpSupport ? true
, rpkiSupport ? true
, numMultipath ? 64
, watchfrrSupport ? true
@ -81,9 +75,6 @@
, ospfApi ? true
}:
lib.warnIf (!(stdenv.buildPlatform.canExecute stdenv.hostPlatform))
"cannot enable SNMP support due to cross-compilation issues with net-snmp-config"
stdenv.mkDerivation (finalAttrs: {
pname = "frr";
version = "10.1";
@ -194,6 +185,9 @@ stdenv.mkDerivation (finalAttrs: {
(lib.strings.enableFeature ospfApi "ospfapi")
# Cumulus options
(lib.strings.enableFeature cumulusSupport "cumulus")
] ++ lib.optionals snmpSupport [
# Used during build for paths, `dev` has build shebangs so can be run during build.
"NETSNMP_CONFIG=${lib.getDev net-snmp}/bin/net-snmp-config"
];
postPatch = ''

View file

@ -45,7 +45,7 @@ let
else if isx86_64 then
"amd64"
else
abort "no Nim CPU support known for ${config}";
throw "no Nim CPU support known for ${config}";
parseOs =
platform:
@ -72,7 +72,7 @@ let
else if isiOS then
"iOS"
else
abort "no Nim OS support known for ${config}";
throw "no Nim OS support known for ${config}";
parsePlatform = p: {
cpu = parseCpu p;

View file

@ -3,7 +3,7 @@
makeScopeWithSplicing',
}:
makeScopeWithSplicing' {
otherSplices = generateSplicesForMkScope;
otherSplices = generateSplicesForMkScope "reposilitePlugins";
f =
self:
{

View file

@ -22,8 +22,6 @@ let
in
assert stdenv.hostPlatform.system == "x86_64-linux";
stdenv.mkDerivation rec {
pname = "saleae-logic";
version = "1.2.18";
@ -92,7 +90,7 @@ stdenv.mkDerivation rec {
homepage = "https://www.saleae.com/";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
platforms = platforms.linux;
platforms = intersectLists platforms.x86_64 platforms.linux;
maintainers = [ maintainers.bjornfor ];
};
}

View file

@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
startScript = if stdenv.hostPlatform.isx86_32 then "START_LINUX_X86"
else if stdenv.hostPlatform.isx86_64 then "START_LINUX_X86_64"
#else if stdenv.hostPlatform.isDarwin then "START_MACOS.app" # disabled because I cannot test on Darwin
else abort "Unsupported platform: ${stdenv.hostPlatform.linuxArch}.";
else throw "Unsupported platform: ${stdenv.hostPlatform.linuxArch}.";
linuxExecutable = if stdenv.hostPlatform.isx86_32 then "pixilang_linux_x86"
else if stdenv.hostPlatform.isx86_64 then "pixilang_linux_x86_64"

View file

@ -541,7 +541,7 @@ in stdenv.mkDerivation {
";
buildProject lldb llvm-project/lldb
${lib.optionalString stdenv.hostPlatform.isDarwin ''
${lib.optionalString stdenv.targetPlatform.isDarwin ''
# Need to do a standalone build of concurrency for Darwin back deployment.
# Based on: utils/swift_build_support/swift_build_support/products/backdeployconcurrency.py
cmakeFlags="

View file

@ -802,7 +802,7 @@ stdenv.mkDerivation ({
buildInputs =
otherBuildInputsSystem;
LANG = "en_US.UTF-8";
LOCALE_ARCHIVE = lib.optionalString (stdenv.hostPlatform.libc == "glibc") "${buildPackages.glibcLocales}/lib/locale/locale-archive";
LOCALE_ARCHIVE = lib.optionalString (stdenv.buildPlatform.libc == "glibc") "${buildPackages.glibcLocales}/lib/locale/locale-archive";
"NIX_${ghcCommandCaps}" = "${ghcEnv}/bin/${ghcCommand}";
"NIX_${ghcCommandCaps}PKG" = "${ghcEnv}/bin/${ghcCommand}-pkg";
# TODO: is this still valid?

View file

@ -204,7 +204,7 @@ let
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
"--disable-toolbox-glue"
] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
"PYTHON_FOR_BUILD=${lib.getBin buildPackages.python}/bin/python"
"PYTHON_FOR_BUILD=${lib.getBin buildPackages.python27}/bin/python"
"ac_cv_buggy_getaddrinfo=no"
# Assume little-endian IEEE 754 floating point when cross compiling
"ac_cv_little_endian_double=yes"
@ -239,7 +239,7 @@ let
nativeBuildInputs =
[ autoreconfHook ]
++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform)
[ buildPackages.stdenv.cc buildPackages.python ];
[ buildPackages.stdenv.cc buildPackages.python27 ];
mkPaths = paths: {
C_INCLUDE_PATH = lib.makeSearchPathOutput "dev" "include" paths;

View file

@ -14,6 +14,7 @@
}:
assert stdenv.cc.isGNU;
with pkgs;
# rebuild gcc using the "final" stdenv
let gcc-stageCompare = (gcc-unwrapped.override {
@ -25,7 +26,9 @@ let gcc-stageCompare = (gcc-unwrapped.override {
}).overrideAttrs(_: {
NIX_OUTPATH_USED_AS_RANDOM_SEED = stdenv.cc.cc.out;
});
in (runCommand "gcc-stageCompare" {} ''
in
assert lib.assertMsg (gcc-stageCompare ? checksum) "tests-stdenv-gcc-stageCompare: No `checksum` output in `gcc-stageCompare` see conditional in `gcc/common/checksum.nix`";
(runCommand "gcc-stageCompare" {} ''
diff -sr ${pkgs.gcc-unwrapped.checksum}/checksums ${gcc-stageCompare.checksum}/checksums && touch $out
'').overrideAttrs (a: {
meta = (a.meta or { }) // { platforms = lib.platforms.linux; };