From 66f29590c080536efcc41308646d85bec8411765 Mon Sep 17 00:00:00 2001 From: Silvan Mosberger Date: Wed, 3 Jan 2024 19:29:29 +0100 Subject: [PATCH] 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. --- pkgs/test/nixpkgs-check-by-name/README.md | 2 ++ pkgs/test/nixpkgs-check-by-name/src/eval.nix | 3 +++ pkgs/test/nixpkgs-check-by-name/tests/mock-nixpkgs.nix | 2 ++ 3 files changed, 7 insertions(+) diff --git a/pkgs/test/nixpkgs-check-by-name/README.md b/pkgs/test/nixpkgs-check-by-name/README.md index 19865ca0952b..871847bd74cc 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 847fab1085d1..e75a28ddbdf7 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 01bb27a48038..cb8066062cc6 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