Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure all jobset attributes evaluate, and check that in CT #269356

Merged
merged 14 commits into from Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion lib/tests/release.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,17 @@ let
in
pkgs.symlinkJoin {
name = "nixpkgs-lib-tests";
paths = map testWithNix nixVersions;
paths = map testWithNix nixVersions ++

#
# TEMPORARY MIGRATION MECHANISM
#
# This comment and the expression which follows it should be
# removed as part of resolving this issue:
#
# https://github.com/NixOS/nixpkgs/issues/272591
#
[(import ../../pkgs/test/release {})]
;

}
1 change: 1 addition & 0 deletions lib/types.nix
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ let
;
outer_types =
rec {
__attrsFailEvaluation = true;
isType = type: x: (x._type or "") == type;

setType = typeName: value: value // {
Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/editors/eclipse/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,6 @@ in rec {

### Plugins

plugins = callPackage ./plugins.nix { };
plugins = callPackage ./plugins.nix { } // { __attrsFailEvaluation = true; };

}
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,4 @@ self: let

in elpaDevelPackages // { inherit elpaBuild; });

in generateElpa { }
in (generateElpa { }) // { __attrsFailEvaluation = true; }
Original file line number Diff line number Diff line change
Expand Up @@ -181,4 +181,4 @@ self: let

in elpaPackages // { inherit elpaBuild; });

in generateElpa { }
in (generateElpa { }) // { __attrsFailEvaluation = true; }
Original file line number Diff line number Diff line change
Expand Up @@ -113,4 +113,6 @@ in
emacsSessionManagement = self.session-management-for-emacs;
rectMark = self.rect-mark;
sunriseCommander = self.sunrise-commander;

__attrsFailEvaluation = true;
}
Original file line number Diff line number Diff line change
Expand Up @@ -735,4 +735,5 @@ let
in lib.mapAttrs (n: v: if lib.hasAttr n overrides then overrides.${n} else v) super);

in
generateMelpa { }
(generateMelpa { })
// { __attrsFailEvaluation = true; }
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ self: let
generated ? ./nongnu-generated.nix
}: let

imported = import generated {
imported = (import generated {
callPackage = pkgs: args: self.callPackage pkgs (args // {
# Use custom elpa url fetcher with fallback/uncompress
fetchurl = buildPackages.callPackage ./fetchelpa.nix { };
});
};
}) // { __attrsFailEvaluation = true; };

super = imported;

Expand Down
2 changes: 1 addition & 1 deletion pkgs/applications/editors/jetbrains/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,6 @@ rec {

webstorm = mkJetBrainsProduct { pname = "webstorm"; extraBuildInputs = [ stdenv.cc.cc musl ]; };

plugins = callPackage ./plugins { };
plugins = callPackage ./plugins { } // { __attrsFailEvaluation = true; };

}
3 changes: 3 additions & 0 deletions pkgs/desktops/gnome/extensions/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ let
lib.trivial.pipe extensions [
(map (extension: lib.nameValuePair extension.extensionUuid extension))
builtins.listToAttrs
(attrs: attrs // { __attrsFailEvaluation = true; })
];

# Map the list of extensions to an attrset based on the pname as key, which is more human readable than the UUID
Expand Down Expand Up @@ -66,6 +67,7 @@ in rec {

# Keep the last three versions in here
gnomeExtensions = lib.trivial.pipe (gnome43Extensions // gnome44Extensions // gnome45Extensions) [
(v: builtins.removeAttrs v [ "__attrsFailEvaluation" ])
# Apply some custom patches for automatically packaged extensions
(callPackage ./extensionOverrides.nix {})
# Add all manually packaged extensions
Expand All @@ -88,4 +90,5 @@ in rec {
# Make the set "public"
lib.recurseIntoAttrs
];

}
2 changes: 1 addition & 1 deletion pkgs/development/compilers/chicken/4/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ let
callPackage = newScope self;

self = {
pkgs = self;
pkgs = self // { recurseForDerivations = false; };

fetchegg = callPackage ./fetchegg { };

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/rust/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ in
bootRustPlatform = makeRustPlatform bootstrapRustPackages;
in {
# Packages suitable for build-time, e.g. `build.rs`-type stuff.
buildRustPackages = (selectRustPackage buildPackages).packages.stable;
buildRustPackages = (selectRustPackage buildPackages).packages.stable // { __attrsFailEvaluation = true; };
# Analogous to stdenv
rustPlatform = makeRustPlatform self.buildRustPackages;
rustc-unwrapped = self.callPackage ./rustc.nix ({
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/compilers/swift/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ let
darwin = pkgs.darwin.overrideScope (_: prev: {
inherit apple_sdk;
inherit (apple_sdk) Libsystem LibsystemCross libcharset libunwind objc4 configd IOKit Security;
CF = apple_sdk.CoreFoundation;
CF = apple_sdk.CoreFoundation // { __attrsFailEvaluation = true; };
__attrsFailEvaluation = true;
});
xcodebuild = pkgs.xcbuild.override {
inherit (apple_sdk.frameworks) CoreServices CoreGraphics ImageIO;
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/haskell-modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ let

haskellPackages = pkgs.callPackage makePackageSet {
package-set = initialPackages;
inherit stdenv haskellLib ghc buildHaskellPackages extensible-self all-cabal-hashes;
inherit stdenv haskellLib ghc extensible-self all-cabal-hashes;
buildHaskellPackages = buildHaskellPackages // { __attrsFailEvaluation = true; };
};

platformConfigurations = lib.optionals stdenv.hostPlatform.isAarch [
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/haskell-modules/make-package-set.nix
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ in package-set { inherit pkgs lib callPackage; } self // {
Type: [str] -> drv -> drv
*/
generateOptparseApplicativeCompletions =
self.callPackage (
(self.callPackage (
{ stdenv }:

commands:
Expand All @@ -623,7 +623,7 @@ in package-set { inherit pkgs lib callPackage; } self // {
if stdenv.buildPlatform.canExecute stdenv.hostPlatform
then lib.foldr haskellLib.__generateOptparseApplicativeCompletion pkg commands
else pkg
) { };
) { }) // { __attrsFailEvaluation = true; };

/*
Modify given Haskell package to force GHC to employ the LLVM
Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/interpreters/lua-5/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ let
inherit (luaPackages) requiredLuaModules;
};
withPackages = import ./with-packages.nix { inherit buildEnv luaPackages;};
pkgs = luaPackages;
pkgs = let lp = luaPackages;
in lp // { luaPackages = lp.luaPackages // { __attrsFailEvaluation = true; }; };
interpreter = "${self}/bin/${executable}";
inherit executable luaversion;
luaOnBuild = luaOnBuildForHost.override { inherit packageOverrides; self = luaOnBuild; };
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/libraries/qt-5/5.15/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Check for any minor version changes.

let

srcs = import ./srcs.nix { inherit lib fetchgit fetchFromGitHub; };
srcs = import ./srcs.nix { inherit lib fetchgit fetchFromGitHub; } // { __attrsFailEvaluation = true; };

qtCompatVersion = srcs.qtbase.version;

Expand Down
2 changes: 2 additions & 0 deletions pkgs/test/cuda/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ rec {
cuda-library-samples_cudatoolkit_11_3
cuda-library-samples_cudatoolkit_11_4
;

__attrsFailEvaluation = true;
}
4 changes: 2 additions & 2 deletions pkgs/test/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ with pkgs;

macOSSierraShared = callPackage ./macos-sierra-shared {};

cross = callPackage ./cross {};
cross = callPackage ./cross {} // { __attrsFailEvaluation = true; };

php = recurseIntoAttrs (callPackages ./php {});

pkg-config = recurseIntoAttrs (callPackage ../top-level/pkg-config/tests.nix { });
pkg-config = recurseIntoAttrs (callPackage ../top-level/pkg-config/tests.nix { }) // { __recurseIntoDerivationForReleaseJobs = true; };

buildRustCrate = callPackage ../build-support/rust/build-rust-crate/test { };
importCargoLock = callPackage ../build-support/rust/test/import-cargo-lock { };
Expand Down
46 changes: 46 additions & 0 deletions pkgs/test/release/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Adapted from lib/tests/release.nix
{ pkgs-path ? ../../..
, pkgs ? import pkgs-path {}
, lib ? pkgs.lib
, nix ? pkgs.nix
}:

#
# This verifies that release-attrpaths-superset.nix does not encounter
# infinite recursion or non-tryEval-able failures.
#
pkgs.runCommand "all-attrs-eval-under-tryEval" {
nativeBuildInputs = [
nix
pkgs.gitMinimal
] ++ lib.optional pkgs.stdenv.isLinux pkgs.inotify-tools;
strictDeps = true;
}
''
datadir="${nix}/share"
export TEST_ROOT=$(pwd)/test-tmp
export HOME=$(mktemp -d)
export NIX_BUILD_HOOK=
export NIX_CONF_DIR=$TEST_ROOT/etc
export NIX_LOCALSTATE_DIR=$TEST_ROOT/var
export NIX_LOG_DIR=$TEST_ROOT/var/log/nix
export NIX_STATE_DIR=$TEST_ROOT/var/nix
export NIX_STORE_DIR=$TEST_ROOT/store
export PAGER=cat
cacheDir=$TEST_ROOT/binary-cache

nix-store --init

cp -r ${pkgs-path + "/lib"} lib
cp -r ${pkgs-path + "/pkgs"} pkgs
cp -r ${pkgs-path + "/default.nix"} default.nix
cp -r ${pkgs-path + "/nixos"} nixos
cp -r ${pkgs-path + "/maintainers"} maintainers
cp -r ${pkgs-path + "/.version"} .version
cp -r ${pkgs-path + "/doc"} doc
echo "Running pkgs/top-level/release-attrpaths-superset.nix"
nix-instantiate --eval --strict --json pkgs/top-level/release-attrpaths-superset.nix -A names > /dev/null

mkdir $out
echo success > $out/${nix.version}
''
Loading