From a48038d3091ede61d2d58c17450fba47b3499b40 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Mon, 22 Jan 2024 22:47:23 +0100 Subject: [PATCH 1/4] tests.nixpkgs-check-by-name: Minor code improvements - Renames EmptyNonAutoCalled to ManualDefinition and add some docs to better explain what it's for - Don't conflate the Ratchet type with the Context type, keep them apart, making the code a bit cleaner, but also allows adding additional context for a Tight ratchet in the future - Change the signature of to_nixpkgs_problem to align with the other ratchet function signatures --- pkgs/test/nixpkgs-check-by-name/src/eval.rs | 14 +-- .../test/nixpkgs-check-by-name/src/ratchet.rs | 95 ++++++++++++------- 2 files changed, 68 insertions(+), 41 deletions(-) diff --git a/pkgs/test/nixpkgs-check-by-name/src/eval.rs b/pkgs/test/nixpkgs-check-by-name/src/eval.rs index e4584f09d8cd..c3be2c5917d6 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/eval.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/eval.rs @@ -191,13 +191,13 @@ pub fn check_values( CallPackage(CallPackageInfo { is_derivation: true, call_package_variant: Manual { path, empty_arg }, - }) => Success(Loose(ratchet::UsesByName { + }) => Success(Loose(ratchet::CouldUseByName { call_package_path: path, empty_arg, })), }; uses_by_name.map(|x| ratchet::Package { - empty_non_auto_called: Tight, + manual_definition: Tight, uses_by_name: x, }) } @@ -213,7 +213,7 @@ pub fn check_values( // We choose the latter, since we want to move towards pkgs/by-name, not away // from it Success(ratchet::Package { - empty_non_auto_called: Tight, + manual_definition: Tight, uses_by_name: Tight, }) } @@ -248,7 +248,7 @@ pub fn check_values( check_result.and(match &call_package_variant { Auto => Success(ratchet::Package { - empty_non_auto_called: Tight, + manual_definition: Tight, uses_by_name: Tight, }), Manual { path, empty_arg } => { @@ -261,11 +261,7 @@ pub fn check_values( if correct_file { Success(ratchet::Package { // Empty arguments for non-auto-called packages are not allowed anymore. - empty_non_auto_called: if *empty_arg { - Loose(ratchet::EmptyNonAutoCalled) - } else { - Tight - }, + manual_definition: if *empty_arg { Loose(()) } else { Tight }, uses_by_name: Tight, }) } else { diff --git a/pkgs/test/nixpkgs-check-by-name/src/ratchet.rs b/pkgs/test/nixpkgs-check-by-name/src/ratchet.rs index f8c129626cc0..dabc8f67316a 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/ratchet.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/ratchet.rs @@ -33,7 +33,7 @@ impl Nixpkgs { /// The ratchet value for a top-level package pub struct Package { /// The ratchet value for the check for non-auto-called empty arguments - pub empty_non_auto_called: RatchetState, + pub manual_definition: RatchetState, /// The ratchet value for the check for new packages using pkgs/by-name pub uses_by_name: RatchetState, @@ -43,10 +43,10 @@ impl Package { /// Validates the ratchet checks for a top-level package pub fn compare(name: &str, optional_from: Option<&Self>, to: &Self) -> Validation<()> { validation::sequence_([ - RatchetState::::compare( + RatchetState::::compare( name, - optional_from.map(|x| &x.empty_non_auto_called), - &to.empty_non_auto_called, + optional_from.map(|x| &x.manual_definition), + &to.manual_definition, ), RatchetState::::compare( name, @@ -58,13 +58,13 @@ impl Package { } /// The ratchet state of a generic ratchet check. -pub enum RatchetState { +pub enum RatchetState { /// The ratchet is loose, it can be tightened more. /// In other words, this is the legacy state we're trying to move away from. /// Introducing new instances is not allowed but previous instances will continue to be allowed. /// The `Context` is context for error messages in case a new instance of this state is /// introduced - Loose(Context), + Loose(Ratchet::ToContext), /// The ratchet is tight, it can't be tightened any further. /// This is either because we already use the latest state, or because the ratchet isn't /// relevant. @@ -73,40 +73,63 @@ pub enum RatchetState { /// A trait that can convert an attribute-specific error context into a NixpkgsProblem pub trait ToNixpkgsProblem { + /// Context relating to the Nixpkgs that is being transitioned _to_ + type ToContext; + /// How to convert an attribute-specific error context into a NixpkgsProblem - fn to_nixpkgs_problem(name: &str, context: &Self, existed_before: bool) -> NixpkgsProblem; + fn to_nixpkgs_problem( + name: &str, + optional_from: Option<()>, + to: &Self::ToContext, + ) -> NixpkgsProblem; } impl RatchetState { /// Compare the previous ratchet state of an attribute to the new state. /// The previous state may be `None` in case the attribute is new. fn compare(name: &str, optional_from: Option<&Self>, to: &Self) -> Validation<()> { - // If we don't have a previous state, enforce a tight ratchet - let from = optional_from.unwrap_or(&RatchetState::Tight); - match (from, to) { - // Always okay to keep it tight or tighten the ratchet - (_, RatchetState::Tight) => Success(()), - - // Grandfathering policy for a loose ratchet - (RatchetState::Loose { .. }, RatchetState::Loose { .. }) => Success(()), - + match (optional_from, to) { // Loosening a ratchet is now allowed - (RatchetState::Tight, RatchetState::Loose(context)) => { - Context::to_nixpkgs_problem(name, context, optional_from.is_some()).into() + (Some(RatchetState::Tight), RatchetState::Loose(loose_context)) => { + Context::to_nixpkgs_problem(name, Some(()), loose_context).into() } + + // Introducing a loose ratchet is also not allowed + (None, RatchetState::Loose(loose_context)) => { + Context::to_nixpkgs_problem(name, None, loose_context).into() + } + + // Everything else is allowed, including: + // - Loose -> Loose (grandfathering policy for a loose ratchet) + // - -> Tight (always okay to keep or make the ratchet tight) + _ => Success(()), } } } -/// The ratchet value of an attribute -/// for the non-auto-called empty argument check of a single. +/// The ratchet to check whether a top-level attribute has/needs +/// a manual definition, e.g. in all-packages.nix. /// -/// This checks that packages defined in `pkgs/by-name` cannot be overridden -/// with an empty second argument like `callPackage ... { }`. -pub struct EmptyNonAutoCalled; +/// This ratchet is only tight for attributes that: +/// - Are not defined in `pkgs/by-name`, and rely on a manual definition +/// - Are defined in `pkgs/by-name` without any manual definition, +/// (no custom argument overrides) +/// - Are defined with `pkgs/by-name` with a manual definition that can't be removed +/// because it provides custom argument overrides +/// +/// In comparison, this ratchet is loose for attributes that: +/// - Are defined in `pkgs/by-name` with a manual definition +/// that doesn't have any custom argument overrides +pub enum ManualDefinition {} -impl ToNixpkgsProblem for EmptyNonAutoCalled { - fn to_nixpkgs_problem(name: &str, _context: &Self, _existed_before: bool) -> NixpkgsProblem { +impl ToNixpkgsProblem for ManualDefinition { + type ToContext = (); + + fn to_nixpkgs_problem( + name: &str, + _optional_from: Option<()>, + _to: &Self::ToContext, + ) -> NixpkgsProblem { NixpkgsProblem::WrongCallPackage { relative_package_file: structure::relative_file_for_package(name), package_name: name.to_owned(), @@ -119,8 +142,10 @@ impl ToNixpkgsProblem for EmptyNonAutoCalled { /// /// This checks that all new package defined using callPackage must be defined via pkgs/by-name /// It also checks that once a package uses pkgs/by-name, it can't switch back to all-packages.nix +pub enum UsesByName {} + #[derive(Clone)] -pub struct UsesByName { +pub struct CouldUseByName { /// The first callPackage argument, used for better errors pub call_package_path: Option, /// Whether the second callPackage argument is empty, used for better errors @@ -128,18 +153,24 @@ pub struct UsesByName { } impl ToNixpkgsProblem for UsesByName { - fn to_nixpkgs_problem(name: &str, a: &Self, existed_before: bool) -> NixpkgsProblem { - if existed_before { + type ToContext = CouldUseByName; + + fn to_nixpkgs_problem( + name: &str, + optional_from: Option<()>, + to: &Self::ToContext, + ) -> NixpkgsProblem { + if let Some(()) = optional_from { NixpkgsProblem::MovedOutOfByName { package_name: name.to_owned(), - call_package_path: a.call_package_path.clone(), - empty_arg: a.empty_arg, + call_package_path: to.call_package_path.clone(), + empty_arg: to.empty_arg, } } else { NixpkgsProblem::NewPackageNotUsingByName { package_name: name.to_owned(), - call_package_path: a.call_package_path.clone(), - empty_arg: a.empty_arg, + call_package_path: to.call_package_path.clone(), + empty_arg: to.empty_arg, } } } From 5e173ab0f4aefa53538acf12260e69711ce29bae Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Mon, 22 Jan 2024 22:58:33 +0100 Subject: [PATCH 2/4] tests.nixpkgs-check-by-name: Minorly more minimal test files --- .../nixpkgs-check-by-name/tests/no-eval/pkgs/by-name/README.md | 0 .../tests/no-eval/pkgs/by-name/fo/foo/package.nix | 1 - .../tests/override-empty-arg/base/pkgs/by-name/README.md | 1 - 3 files changed, 2 deletions(-) create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/no-eval/pkgs/by-name/README.md delete mode 100644 pkgs/test/nixpkgs-check-by-name/tests/no-eval/pkgs/by-name/fo/foo/package.nix diff --git a/pkgs/test/nixpkgs-check-by-name/tests/no-eval/pkgs/by-name/README.md b/pkgs/test/nixpkgs-check-by-name/tests/no-eval/pkgs/by-name/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/pkgs/test/nixpkgs-check-by-name/tests/no-eval/pkgs/by-name/fo/foo/package.nix b/pkgs/test/nixpkgs-check-by-name/tests/no-eval/pkgs/by-name/fo/foo/package.nix deleted file mode 100644 index a1b92efbbadb..000000000000 --- a/pkgs/test/nixpkgs-check-by-name/tests/no-eval/pkgs/by-name/fo/foo/package.nix +++ /dev/null @@ -1 +0,0 @@ -{ someDrv }: someDrv diff --git a/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/base/pkgs/by-name/README.md b/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/base/pkgs/by-name/README.md index b0d2b34e338a..e69de29bb2d1 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/base/pkgs/by-name/README.md +++ b/pkgs/test/nixpkgs-check-by-name/tests/override-empty-arg/base/pkgs/by-name/README.md @@ -1 +0,0 @@ -(this is just here so the directory can get tracked by git) From 4245e618e7198bcea02b7f14f074963676f59bf1 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Mon, 22 Jan 2024 23:13:58 +0100 Subject: [PATCH 3/4] tests.nixpkgs-check-by-name: Introduce a non-applicable ratchet state Introduces NonApplicable as a state of a ratchet, to be used when the ratchet doesn't make sense to have. This fixes an odd problem where before, changing an attribute to use e.g. `callPackage` suddenly requires moving it to `pkgs/by-name`, when that shouldn't have been required. --- pkgs/test/nixpkgs-check-by-name/src/eval.rs | 8 ++++---- pkgs/test/nixpkgs-check-by-name/src/ratchet.rs | 4 ++++ .../tests/manual-definition/all-packages.nix | 10 ++++++++++ .../tests/manual-definition/base/all-packages.nix | 9 +++++++++ .../tests/manual-definition/base/default.nix | 1 + .../manual-definition/base/pkgs/by-name/README.md | 0 .../tests/manual-definition/base/some-pkg.nix | 1 + .../tests/manual-definition/default.nix | 1 + .../tests/manual-definition/expected | 2 ++ .../pkgs/by-name/no/noEval/package.nix | 1 + .../pkgs/by-name/on/onlyMove/package.nix | 1 + 11 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/manual-definition/all-packages.nix create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/manual-definition/base/all-packages.nix create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/manual-definition/base/default.nix create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/manual-definition/base/pkgs/by-name/README.md create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/manual-definition/base/some-pkg.nix create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/manual-definition/default.nix create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/manual-definition/pkgs/by-name/no/noEval/package.nix create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/manual-definition/pkgs/by-name/on/onlyMove/package.nix diff --git a/pkgs/test/nixpkgs-check-by-name/src/eval.rs b/pkgs/test/nixpkgs-check-by-name/src/eval.rs index c3be2c5917d6..5aa64f9bb00d 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/eval.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/eval.rs @@ -159,8 +159,8 @@ pub fn check_values( let uses_by_name = match attribute_info { // In these cases the package doesn't qualify for being in pkgs/by-name, // so the UsesByName ratchet is already as tight as it can be - NonAttributeSet => Success(Tight), - NonCallPackage => Success(Tight), + NonAttributeSet => Success(NonApplicable), + NonCallPackage => Success(NonApplicable), // This is the case when the `pkgs/by-name`-internal _internalCallByNamePackageFile // is used for a package outside `pkgs/by-name` CallPackage(CallPackageInfo { @@ -176,14 +176,14 @@ pub fn check_values( // In the future we could kind of abuse this behavior to have better // enforcement of conditional aliases, but for now we just need to not // give an error. - Success(Tight) + Success(NonApplicable) } // Only derivations can be in pkgs/by-name, // so this attribute doesn't qualify CallPackage(CallPackageInfo { is_derivation: false, .. - }) => Success(Tight), + }) => Success(NonApplicable), // The case of an attribute that qualifies: // - Uses callPackage diff --git a/pkgs/test/nixpkgs-check-by-name/src/ratchet.rs b/pkgs/test/nixpkgs-check-by-name/src/ratchet.rs index dabc8f67316a..10ecc01d3580 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/ratchet.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/ratchet.rs @@ -69,6 +69,9 @@ pub enum RatchetState { /// This is either because we already use the latest state, or because the ratchet isn't /// relevant. Tight, + /// This ratchet can't be applied. + /// State transitions from/to NonApplicable are always allowed + NonApplicable, } /// A trait that can convert an attribute-specific error context into a NixpkgsProblem @@ -102,6 +105,7 @@ impl RatchetState { // Everything else is allowed, including: // - Loose -> Loose (grandfathering policy for a loose ratchet) // - -> Tight (always okay to keep or make the ratchet tight) + // - Anything involving NotApplicable, where we can't really make any good calls _ => Success(()), } } diff --git a/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/all-packages.nix b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/all-packages.nix new file mode 100644 index 000000000000..07b2caaab4e7 --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/all-packages.nix @@ -0,0 +1,10 @@ +self: super: { + nonAttributeSet = self.callPackage ({ someDrv }: someDrv) { }; + nonCallPackage = self.callPackage ({ someDrv }: someDrv) { }; + internalCallByName = self.callPackage ({ someDrv }: someDrv) { }; + nonDerivation = self.callPackage ({ someDrv }: someDrv) { }; + + onlyMove = self.callPackage ./pkgs/by-name/on/onlyMove/package.nix { }; + + noEval = self.callPackage ./pkgs/by-name/no/noEval/package.nix { }; +} diff --git a/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/base/all-packages.nix b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/base/all-packages.nix new file mode 100644 index 000000000000..75efb5952e7a --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/base/all-packages.nix @@ -0,0 +1,9 @@ +self: super: { + nonAttributeSet = null; + nonCallPackage = self.someDrv; + internalCallByName = self._internalCallByNamePackageFile ./some-pkg.nix; + nonDerivation = self.callPackage ({ }: { }) { }; + + onlyMove = self.callPackage ({ someDrv }: someDrv) { }; + noEval = throw "foo"; +} diff --git a/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/base/default.nix b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/base/default.nix new file mode 100644 index 000000000000..861260cdca4b --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/base/default.nix @@ -0,0 +1 @@ +import { root = ./.; } diff --git a/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/base/pkgs/by-name/README.md b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/base/pkgs/by-name/README.md new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/base/some-pkg.nix b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/base/some-pkg.nix new file mode 100644 index 000000000000..a1b92efbbadb --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/base/some-pkg.nix @@ -0,0 +1 @@ +{ someDrv }: someDrv diff --git a/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/default.nix b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/default.nix new file mode 100644 index 000000000000..861260cdca4b --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/default.nix @@ -0,0 +1 @@ +import { root = ./.; } diff --git a/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected new file mode 100644 index 000000000000..29d33f7dbdc0 --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/expected @@ -0,0 +1,2 @@ +pkgs.noEval: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage pkgs/by-name/no/noEval/package.nix { ... }` with a non-empty second argument. +pkgs.onlyMove: This attribute is manually defined (most likely in pkgs/top-level/all-packages.nix), which is only allowed if the definition is of the form `pkgs.callPackage pkgs/by-name/on/onlyMove/package.nix { ... }` with a non-empty second argument. diff --git a/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/pkgs/by-name/no/noEval/package.nix b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/pkgs/by-name/no/noEval/package.nix new file mode 100644 index 000000000000..a1b92efbbadb --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/pkgs/by-name/no/noEval/package.nix @@ -0,0 +1 @@ +{ someDrv }: someDrv diff --git a/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/pkgs/by-name/on/onlyMove/package.nix b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/pkgs/by-name/on/onlyMove/package.nix new file mode 100644 index 000000000000..a1b92efbbadb --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/manual-definition/pkgs/by-name/on/onlyMove/package.nix @@ -0,0 +1 @@ +{ someDrv }: someDrv From 553b1ab654498ab84ef6e5f8d35f482f96eca0cb Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Mon, 22 Jan 2024 23:16:46 +0100 Subject: [PATCH 4/4] tests.nixpkgs-check-by-name: Don't enforce for fixed evals Stops enforcing that packages whose evaluation gets fixed have to be moved to `pkgs/by-name`. This didn't really cause problems before, but I don't think it's great behavior, and now that NonApplicable is a thing, we can easily make this work, whereas before it would've been a larger change. --- pkgs/test/nixpkgs-check-by-name/src/eval.rs | 27 +++++++++++-------- .../tests/no-eval/all-packages.nix | 2 ++ .../tests/no-eval/base/all-packages.nix | 3 +++ .../tests/no-eval/base/default.nix | 1 + .../tests/no-eval/base/pkgs/by-name/README.md | 0 5 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/no-eval/base/all-packages.nix create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/no-eval/base/default.nix create mode 100644 pkgs/test/nixpkgs-check-by-name/tests/no-eval/base/pkgs/by-name/README.md diff --git a/pkgs/test/nixpkgs-check-by-name/src/eval.rs b/pkgs/test/nixpkgs-check-by-name/src/eval.rs index 5aa64f9bb00d..dd30cb9045e5 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/eval.rs +++ b/pkgs/test/nixpkgs-check-by-name/src/eval.rs @@ -202,19 +202,24 @@ pub fn check_values( }) } NonByName(EvalFailure) => { - // This is a bit of an odd case: We don't even _know_ whether this attribute - // would qualify for using pkgs/by-name. We can either: - // - Assume it's not using pkgs/by-name, which has the problem that if a - // package evaluation gets broken temporarily, the fix can remove it from - // pkgs/by-name again - // - Assume it's using pkgs/by-name already, which has the problem that if a - // package evaluation gets broken temporarily, fixing it requires a move to - // pkgs/by-name - // We choose the latter, since we want to move towards pkgs/by-name, not away - // from it + // We don't know anything about this attribute really Success(ratchet::Package { + // We'll assume that we can't remove any manual definitions, which has the + // minimal drawback that if there was a manual definition that could've + // been removed, fixing the package requires removing the definition, no + // big deal, that's a minor edit. manual_definition: Tight, - uses_by_name: Tight, + + // Regarding whether this attribute could `pkgs/by-name`, we don't really + // know, so return NonApplicable, which has the effect that if a + // package evaluation gets broken temporarily, the fix can remove it from + // pkgs/by-name again. For now this isn't our problem, but in the future we + // might have another check to enforce that evaluation must not be broken. + // The alternative of assuming that it's using `pkgs/by-name` already + // has the problem that if a package evaluation gets broken temporarily, + // fixing it requires a move to pkgs/by-name, which could happen more + // often and isn't really justified. + uses_by_name: NonApplicable, }) } ByName(Missing) => NixpkgsProblem::UndefinedAttr { diff --git a/pkgs/test/nixpkgs-check-by-name/tests/no-eval/all-packages.nix b/pkgs/test/nixpkgs-check-by-name/tests/no-eval/all-packages.nix index e2831c2d542e..38762c6de1cc 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/no-eval/all-packages.nix +++ b/pkgs/test/nixpkgs-check-by-name/tests/no-eval/all-packages.nix @@ -1,3 +1,5 @@ self: super: { iDontEval = throw "I don't eval"; + + futureEval = self.callPackage ({ someDrv }: someDrv) { }; } diff --git a/pkgs/test/nixpkgs-check-by-name/tests/no-eval/base/all-packages.nix b/pkgs/test/nixpkgs-check-by-name/tests/no-eval/base/all-packages.nix new file mode 100644 index 000000000000..ac763b454eb0 --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/no-eval/base/all-packages.nix @@ -0,0 +1,3 @@ +self: super: { + futureEval = throw "foo"; +} diff --git a/pkgs/test/nixpkgs-check-by-name/tests/no-eval/base/default.nix b/pkgs/test/nixpkgs-check-by-name/tests/no-eval/base/default.nix new file mode 100644 index 000000000000..861260cdca4b --- /dev/null +++ b/pkgs/test/nixpkgs-check-by-name/tests/no-eval/base/default.nix @@ -0,0 +1 @@ +import { root = ./.; } diff --git a/pkgs/test/nixpkgs-check-by-name/tests/no-eval/base/pkgs/by-name/README.md b/pkgs/test/nixpkgs-check-by-name/tests/no-eval/base/pkgs/by-name/README.md new file mode 100644 index 000000000000..e69de29bb2d1