Unverified Commit a0a35b6c authored by sternenseemann's avatar sternenseemann Committed by GitHub
Browse files

Fix cross eval issues (#362546)

parents d6b7f323 276fe40f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ stdenvNoCC.mkDerivation {
    fileset = ../../lib;
  };

  buildInputs = [
  nativeBuildInputs = [
    nixdoc
    nix
  ];
+1 −1
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@ invalidateFetcherByDrvHash (
    {
      nativeBuildInputs = [
        cacert
        (python3.withPackages (p: [
        (python3.pythonOnBuildForHost.withPackages (p: [
          p.aiohttp
          p.rich
          p.structlog
+8 −3
Original line number Diff line number Diff line
{ # 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;
  }
+4 −4
Original line number Diff line number Diff line
@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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}"
    }"
  ];

Loading