diff options
author | Silvan Mosberger <silvan.mosberger@tweag.io> | 2024-01-03 19:29:29 +0100 |
---|---|---|
committer | Silvan Mosberger <silvan.mosberger@tweag.io> | 2024-01-05 01:05:44 +0100 |
commit | 66f29590c080536efcc41308646d85bec8411765 (patch) | |
tree | 5c44892409be508c6cc8ba33f555e0dda61720be /pkgs/test | |
parent | 5b7ae79ef0dc40df8c6da2a31a90b8aad5cb88df (diff) |
tests.nixpkgs-check-by-name: Set evaluation system to x86_64-linux
This was previously a checking impurity that could produce different results when run on different systems.
Diffstat (limited to 'pkgs/test')
-rw-r--r-- | pkgs/test/nixpkgs-check-by-name/README.md | 2 | ||||
-rw-r--r-- | pkgs/test/nixpkgs-check-by-name/src/eval.nix | 3 | ||||
-rw-r--r-- | pkgs/test/nixpkgs-check-by-name/tests/mock-nixpkgs.nix | 2 |
3 files changed, 7 insertions, 0 deletions
diff --git a/pkgs/test/nixpkgs-check-by-name/README.md b/pkgs/test/nixpkgs-check-by-name/README.md index 19865ca0952b5..871847bd74cca 100644 --- a/pkgs/test/nixpkgs-check-by-name/README.md +++ b/pkgs/test/nixpkgs-check-by-name/README.md @@ -28,6 +28,8 @@ These checks are performed by this tool: - Each package directory must not refer to files outside itself using symlinks or Nix path expressions. ### Nix evaluation checks + +Evaluate Nixpkgs with `system` set to `x86_64-linux` and check that: - For each package directory, the `pkgs.${name}` attribute must be defined as `callPackage pkgs/by-name/${shard}/${name}/package.nix args` for some `args`. - For each package directory, `pkgs.lib.isDerivation pkgs.${name}` must be `true`. diff --git a/pkgs/test/nixpkgs-check-by-name/src/eval.nix b/pkgs/test/nixpkgs-check-by-name/src/eval.nix index 847fab1085d17..e75a28ddbdf71 100644 --- a/pkgs/test/nixpkgs-check-by-name/src/eval.nix +++ b/pkgs/test/nixpkgs-check-by-name/src/eval.nix @@ -54,6 +54,9 @@ let # Don't let the users home directory influence this result config = { }; overlays = [ overlay ]; + # We check evaluation and callPackage only for x86_64-linux. + # Not ideal, but hard to fix + system = "x86_64-linux"; }; attrInfo = name: value: diff --git a/pkgs/test/nixpkgs-check-by-name/tests/mock-nixpkgs.nix b/pkgs/test/nixpkgs-check-by-name/tests/mock-nixpkgs.nix index 01bb27a480388..cb8066062cc64 100644 --- a/pkgs/test/nixpkgs-check-by-name/tests/mock-nixpkgs.nix +++ b/pkgs/test/nixpkgs-check-by-name/tests/mock-nixpkgs.nix @@ -19,6 +19,8 @@ It returns a Nixpkgs-like function that can be auto-called and evaluates to an a overlays ? [], # Passed by the checker to make sure a real Nixpkgs isn't influenced by impurities config ? {}, + # Passed by the checker to make sure a real Nixpkgs isn't influenced by impurities + system ? null, }: let |