Unverified Commit f55926cd authored by K900's avatar K900 Committed by GitHub
Browse files

Revert "nixVersions.nix_2_26: fix cross" (#393428)

parents 80852687 fa29b600
Loading
Loading
Loading
Loading
+186 −245
Original line number Diff line number Diff line
{
  lib,
  config,
  stdenv,
  aws-sdk-cpp,
  boehmgc,
  callPackage,
  fetchFromGitHub,
  fetchpatch2,
  runCommand,
  Security,
  pkgs,
  pkgsi686Linux,
  pkgsStatic,
  nixosTests,

  storeDir ? "/nix/store",
  stateDir ? "/nix/var",
  confDir ? "/etc",
{ lib
, config
, stdenv
, aws-sdk-cpp
, boehmgc
, libgit2
, callPackage
, fetchFromGitHub
, fetchpatch2
, runCommand
, Security
, pkgs
, pkgsi686Linux
, pkgsStatic
, nixosTests

, storeDir ? "/nix/store"
, stateDir ? "/nix/var"
, confDir ? "/etc"
}:
let
  boehmgc-nix_2_3 = boehmgc.override { enableLargeConfig = true; };
@@ -29,15 +29,10 @@ let
  });

  # old nix fails to build with newer aws-sdk-cpp and the patch doesn't apply
  aws-sdk-cpp-old-nix =
    (aws-sdk-cpp.override {
      apis = [
        "s3"
        "transfer"
      ];
  aws-sdk-cpp-old-nix = (aws-sdk-cpp.override {
    apis = [ "s3" "transfer" ];
    customMemoryManagement = false;
    }).overrideAttrs
      (args: rec {
  }).overrideAttrs (args: rec {
    # intentionally overriding postPatch
    version = "1.9.294";

@@ -47,8 +42,7 @@ let
      rev = version;
      hash = "sha256-Z1eRKW+8nVD53GkNyYlZjCcT74MqFqqRMeMc33eIQ9g=";
    };
        postPatch =
          ''
    postPatch = ''
      # Avoid blanket -Werror to evade build failures on less
      # tested compilers.
      substituteInPlace cmake/compiler_settings.cmake \
@@ -75,8 +69,7 @@ let
      rm aws-cpp-sdk-core-tests/aws/auth/AWSAuthSignerTest.cpp
      # TestRandomURLMultiThreaded fails
      rm aws-cpp-sdk-core-tests/http/HttpClientTest.cpp
          ''
          + lib.optionalString aws-sdk-cpp.stdenv.hostPlatform.isi686 ''
    '' + lib.optionalString aws-sdk-cpp.stdenv.hostPlatform.isi686 ''
      # EPSILON is exceeded
      rm aws-cpp-sdk-core-tests/aws/client/AdaptiveRetryStrategyTest.cpp
    '';
@@ -87,31 +80,21 @@ let
    requiredSystemFeatures = [ ];
  });

  aws-sdk-cpp-nix =
    (aws-sdk-cpp.override {
      apis = [
        "s3"
        "transfer"
      ];
  aws-sdk-cpp-nix = (aws-sdk-cpp.override {
    apis = [ "s3" "transfer" ];
    customMemoryManagement = false;
    }).overrideAttrs
      {
  }).overrideAttrs {
    # only a stripped down version is build which takes a lot less resources to build
    requiredSystemFeatures = [ ];
  };

  common =
    args:
    callPackage (import ./common.nix ({ inherit lib fetchFromGitHub; } // args)) {
      inherit
        Security
        storeDir
        stateDir
        confDir
        ;
  common = args:
    callPackage
      (import ./common.nix ({ inherit lib fetchFromGitHub; } // args))
      {
        inherit Security storeDir stateDir confDir;
        boehmgc = boehmgc-nix;
      aws-sdk-cpp =
        if lib.versionAtLeast args.version "2.12pre" then aws-sdk-cpp-nix else aws-sdk-cpp-old-nix;
        aws-sdk-cpp = if lib.versionAtLeast args.version "2.12pre" then aws-sdk-cpp-nix else aws-sdk-cpp-old-nix;
      };

  # https://github.com/NixOS/nix/pull/7585
@@ -123,31 +106,20 @@ let

  # Intentionally does not support overrideAttrs etc
  # Use only for tests that are about the package relation to `pkgs` and/or NixOS.
  addTestsShallowly =
    tests: pkg:
    pkg
    // {
  addTestsShallowly = tests: pkg: pkg // {
    tests = pkg.tests // tests;
    # In case someone reads the wrong attribute
    passthru.tests = pkg.tests // tests;
  };

  addFallbackPathsCheck =
    pkg:
    addTestsShallowly {
      nix-fallback-paths =
        runCommand "test-nix-fallback-paths-version-equals-nix-stable"
          {
            paths = lib.concatStringsSep "\n" (
              builtins.attrValues (import ../../../../nixos/modules/installer/tools/nix-fallback-paths.nix)
            );
          }
          ''
  addFallbackPathsCheck = pkg: addTestsShallowly
    { nix-fallback-paths =
        runCommand "test-nix-fallback-paths-version-equals-nix-stable" {
          paths = lib.concatStringsSep "\n" (builtins.attrValues (import ../../../../nixos/modules/installer/tools/nix-fallback-paths.nix));
        } ''
          # NOTE: name may contain cross compilation details between the pname
          #       and version this is permitted thanks to ([^-]*-)*
            if [[ "" != $(grep -vE 'nix-([^-]*-)*${
              lib.strings.replaceStrings [ "." ] [ "\\." ] pkg.version
            }$' <<< "$paths") ]]; then
          if [[ "" != $(grep -vE 'nix-([^-]*-)*${lib.strings.replaceStrings ["."] ["\\."] pkg.version}$' <<< "$paths") ]]; then
            echo "nix-fallback-paths not up to date with nixVersions.stable (nix-${pkg.version})"
            echo "The following paths are not up to date:"
            grep -v 'nix-${pkg.version}$' <<< "$paths"
@@ -162,51 +134,34 @@ let
            touch $out
          fi
        '';
    } pkg;
    }
    pkg;

  # (meson based packaging)
  # Add passthru tests to the package, and re-expose package set overriding
  # functions. This will not incorporate the tests into the package set.
  # TODO (roberth): add package-set level overriding to the "everything" package.
  addTests =
    selfAttributeName: pkg:
  addTests = selfAttributeName: pkg:
    let
      tests =
        pkg.tests or {}
        // import ./tests.nix {
          inherit
            runCommand
            lib
            stdenv
            pkgs
            pkgsi686Linux
            pkgsStatic
            nixosTests
            ;
          inherit runCommand lib stdenv pkgs pkgsi686Linux pkgsStatic nixosTests;
          inherit (pkg) version src;
          nix = pkg;
          self_attribute_name = selfAttributeName;
        };
    in
    # preserve old pkg, including overrideSource, etc
    pkg
    // {
    pkg // {
      tests = pkg.tests or {} // tests;
      passthru = pkg.passthru or {} // {
        tests =
          lib.warn "nix.passthru.tests is deprecated. Use nix.tests instead." pkg.passthru.tests or { }
          // tests;
        tests = lib.warn "nix.passthru.tests is deprecated. Use nix.tests instead." pkg.passthru.tests or {} // tests;
      };
    };

in
lib.makeExtensible (
  self:
  (
    {
      nix_2_3 =
        (
          (common {
in lib.makeExtensible (self: ({
  nix_2_3 = ((common {
    version = "2.3.18";
    hash = "sha256-jBz2Ub65eFYG+aWgSI3AJYvLSghio77fWQiIW1svA9U=";
    patches = [
@@ -214,10 +169,7 @@ lib.makeExtensible (
    ];
    self_attribute_name = "nix_2_3";
    maintainers = with lib.maintainers; [ flokli ];
          }).override
          { boehmgc = boehmgc-nix_2_3; }
        ).overrideAttrs
          {
  }).override { boehmgc = boehmgc-nix_2_3; }).overrideAttrs {
    # https://github.com/NixOS/nix/issues/10222
    # spurious test/add.sh failures
    enableParallelChecking = false;
@@ -235,13 +187,7 @@ lib.makeExtensible (
    self_attribute_name = "nix_2_25";
  };

      components.nix_2_26 = (
        callPackage ./vendor/2_26/componentized.nix {
          inherit (self.nix_2_24.meta) maintainers;
          selfAttributeName = "nix_2_26";
        }
      );
      nix_2_26 = addTests "nix_2_26" self.components.nix_2_26.nix-everything;
  nix_2_26 = addTests "nix_2_26" (callPackage ./vendor/2_26/componentized.nix { inherit (self.nix_2_24.meta) maintainers; });

  git = common rec {
    version = "2.25.0";
@@ -276,20 +222,15 @@ lib.makeExtensible (

  # Read ./README.md before bumping a major release
  stable = addFallbackPathsCheck self.nix_2_24;
    }
    // lib.optionalAttrs config.allowAliases (
      lib.listToAttrs (
        map (
} // lib.optionalAttrs config.allowAliases (
  lib.listToAttrs (map (
    minor:
    let
      attr = "nix_2_${toString minor}";
    in
    lib.nameValuePair attr (throw "${attr} has been removed")
        ) (lib.range 4 23)
      )
  ) (lib.range 4 23))
  // {
    unstable = throw "nixVersions.unstable has been removed. For bleeding edge (Nix master, roughly weekly updated) use nixVersions.git, otherwise use nixVersions.latest.";
  }
    )
  )
)
)))
+3 −14
Original line number Diff line number Diff line
@@ -7,7 +7,6 @@
  pkgs,
  stdenv,
  maintainers,
  selfAttributeName,
  ...
}:
let
@@ -25,11 +24,7 @@ let
        inherit (nixDependencies) newScope;
      }
      {
        otherSplices = generateSplicesForMkScope [
          "nixVersions"
          "components"
          selfAttributeName
        ];
        otherSplices = generateSplicesForMkScope "nixComponents";
        f = import ./packaging/components.nix {
          inherit
            lib
@@ -50,17 +45,11 @@ let
        inherit newScope; # layered directly on pkgs, unlike nixComponents above
      }
      {
        # Technically this should point to the nixDependencies set only, but
        # this is ok as long as the scopes don't intersect.
        otherSplices = generateSplicesForMkScope [
          "nixVersions"
          "components"
          selfAttributeName
        ];
        otherSplices = generateSplicesForMkScope "nixDependencies";
        f = import ./dependencies.nix {
          inherit pkgs;
          inherit stdenv;
        };
      };
in
nixComponents.overrideSource src
(nixComponents.overrideSource src).nix-everything