···66 clippy,
77 mkShell,
88 makeWrapper,
99+ runCommand,
910}:
1011let
1112 runtimeExprPath = ./src/eval.nix;
1213 nixpkgsLibPath = ../../../lib;
1414+1515+ # Needed to make Nix evaluation work inside nix builds
1616+ initNix = ''
1717+ export TEST_ROOT=$(pwd)/test-tmp
1818+ export NIX_CONF_DIR=$TEST_ROOT/etc
1919+ export NIX_LOCALSTATE_DIR=$TEST_ROOT/var
2020+ export NIX_LOG_DIR=$TEST_ROOT/var/log/nix
2121+ export NIX_STATE_DIR=$TEST_ROOT/var/nix
2222+ export NIX_STORE_DIR=$TEST_ROOT/store
2323+2424+ # Ensure that even if tests run in parallel, we don't get an error
2525+ # We'd run into https://github.com/NixOS/nix/issues/2706 unless the store is initialised first
2626+ nix-store --init
2727+ '';
2828+1329 package =
1430 rustPlatform.buildRustPackage {
1531 name = "nixpkgs-check-by-name";
···2238 makeWrapper
2339 ];
2440 env.NIX_CHECK_BY_NAME_EXPR_PATH = "${runtimeExprPath}";
2525- # Needed to make Nix evaluation work inside the nix build
2626- preCheck = ''
2727- export TEST_ROOT=$(pwd)/test-tmp
2828- export NIX_CONF_DIR=$TEST_ROOT/etc
2929- export NIX_LOCALSTATE_DIR=$TEST_ROOT/var
3030- export NIX_LOG_DIR=$TEST_ROOT/var/log/nix
3131- export NIX_STATE_DIR=$TEST_ROOT/var/nix
3232- export NIX_STORE_DIR=$TEST_ROOT/store
3333-3434- export NIXPKGS_LIB_PATH=${nixpkgsLibPath}
3535-3636- # Ensure that even if tests run in parallel, we don't get an error
3737- # We'd run into https://github.com/NixOS/nix/issues/2706 unless the store is initialised first
3838- nix-store --init
3939- '';
4141+ env.NIXPKGS_LIB_PATH = "${nixpkgsLibPath}";
4242+ preCheck = initNix;
4043 postCheck = ''
4144 cargo fmt --check
4245 cargo clippy -- -D warnings
···5053 env.NIXPKGS_LIB_PATH = toString nixpkgsLibPath;
5154 inputsFrom = [ package ];
5255 };
5656+5757+ # Tests the tool on the current Nixpkgs tree, this is a good sanity check
5858+ passthru.tests.nixpkgs = runCommand "test-nixpkgs-check-by-name" {
5959+ nativeBuildInputs = [
6060+ package
6161+ nix
6262+ ];
6363+ nixpkgsPath = lib.cleanSource ../../..;
6464+ } ''
6565+ ${initNix}
6666+ nixpkgs-check-by-name --base "$nixpkgsPath" "$nixpkgsPath"
6767+ touch $out
6868+ '';
5369 };
5470in
5571package
+13-4
pkgs/test/nixpkgs-check-by-name/src/eval.rs
···168168 // so the UsesByName ratchet is already as tight as it can be
169169 NonAttributeSet => Success(Tight),
170170 NonCallPackage => Success(Tight),
171171- // This is an odd case when _internalCallByNamePackageFile is used to define a package.
171171+ // This is the case when the `pkgs/by-name`-internal _internalCallByNamePackageFile
172172+ // is used for a package outside `pkgs/by-name`
172173 CallPackage(CallPackageInfo {
173174 call_package_variant: Auto,
174175 ..
175175- }) => NixpkgsProblem::InternalCallPackageUsed {
176176- attr_name: attribute_name.clone(),
176176+ }) => {
177177+ // With the current detection mechanism, this also triggers for aliases
178178+ // to pkgs/by-name packages, and there's no good method of
179179+ // distinguishing alias vs non-alias.
180180+ // Using `config.allowAliases = false` at least currently doesn't work
181181+ // because there's nothing preventing people from defining aliases that
182182+ // are present even with that disabled.
183183+ // In the future we could kind of abuse this behavior to have better
184184+ // enforcement of conditional aliases, but for now we just need to not
185185+ // give an error.
186186+ Success(Tight)
177187 }
178178- .into(),
179188 // Only derivations can be in pkgs/by-name,
180189 // so this attribute doesn't qualify
181190 CallPackage(CallPackageInfo {
···7777 else
7878 [ ];
79798080+ # A list optionally containing the `aliases.nix` file from the test case as an overlay
8181+ # But only if config.allowAliases is not false
8282+ optionalAliasesOverlay =
8383+ if (config.allowAliases or true) && builtins.pathExists (root + "/aliases.nix") then
8484+ [ (import (root + "/aliases.nix")) ]
8585+ else
8686+ [ ];
8787+8088 # All the overlays in the right order, including the user-supplied ones
8189 allOverlays =
8290 [
8391 autoCalledPackages
8492 ]
8593 ++ optionalAllPackagesOverlay
9494+ ++ optionalAliasesOverlay
8695 ++ overlays;
87968897 # Apply all the overlays in order to the base fixed-point function pkgsFun
+5-3
pkgs/tools/admin/pgadmin/default.nix
···14141515let
1616 pname = "pgadmin";
1717- version = "8.1";
1818- yarnHash = "sha256-KAiY5TX2O8mxP7PjIJstYEzCBbqDgT+CpEhreuAGW/U=";
1717+ version = "8.2";
1818+ yarnHash = "sha256-uMSgpkYoLD32VYDAkjywC9bZjm7UKA0hhwVNc/toEbA=";
19192020 src = fetchFromGitHub {
2121 owner = "pgadmin-org";
2222 repo = "pgadmin4";
2323 rev = "REL-${lib.versions.major version}_${lib.versions.minor version}";
2424- hash = "sha256-zzS/fydNOXpIWdyLtWQhY+hVpneca+3wD88DmZEkS8s=";
2424+ hash = "sha256-RfpZXy265kwpMsWUBDVfbL/0eX0By79I4VNkG8zwVOs=";
2525 };
26262727 # keep the scope, as it is used throughout the derivation and tests
···181181 google-auth-oauthlib
182182 google-api-python-client
183183 keyring
184184+ typer
185185+ rich
184186 ];
185187186188 passthru.tests = {