From 60678e068cf968fa542fccee8cd268b92eecf403 Mon Sep 17 00:00:00 2001 From: Will Bush Date: Thu, 29 Aug 2024 00:01:05 -0500 Subject: [PATCH] Rename to nixpkgs-vet --- CONTRIBUTING.md | 2 +- Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 8 ++++---- default.nix | 6 +++--- nixpkgs-check.nix | 14 +++++++------- package.nix | 14 +++++++------- scripts/release.sh | 2 +- src/eval.rs | 10 +++++----- tests/non-by-name-trace/README.md | 2 +- 10 files changed, 31 insertions(+), 31 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2b47d54..7a005d7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,7 @@ # Contributor documentation [@infinisil](https://github.com/infinisil) is the admin and main developer of this repository, -while everybody in [@NixOS/nixpkgs-check-by-name](https://github.com/orgs/NixOS/teams/nixpkgs-check-by-name) has write access. +while everybody in [@NixOS/nixpkgs-vet](https://github.com/orgs/NixOS/teams/nixpkgs-vet) has write access. ## Development diff --git a/Cargo.lock b/Cargo.lock index 82aa5b7..ed3b554 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -248,7 +248,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] -name = "nixpkgs-check-by-name" +name = "nixpkgs-vet" version = "0.1.2" dependencies = [ "anyhow", diff --git a/Cargo.toml b/Cargo.toml index ef5413a..c8cf3d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "nixpkgs-check-by-name" +name = "nixpkgs-vet" version = "0.1.2" edition = "2021" diff --git a/README.md b/README.md index 6a15df5..4613849 100644 --- a/README.md +++ b/README.md @@ -27,12 +27,12 @@ There is no guarantee that the derivation succeeds on systems that don't have [p but it can be attempted with ```bash -nix-build https://github.com/NixOS/nixpkgs-check-by-name/tarball/master -A build +nix-build https://github.com/NixOS/nixpkgs-vet/tarball/master -A build ``` ## Prebuilt store paths -The [GitHub releases](https://github.com/NixOS/nixpkgs-check-by-name/releases) +The [GitHub releases](https://github.com/NixOS/nixpkgs-vet/releases) contain a [gzip](https://en.wikipedia.org/wiki/Gzip)-compressed [Nix Archive](https://nixos.org/manual/nix/stable/command-ref/nix-store/export.html) of the [build closure](https://nixos.org/manual/nix/stable/glossary#gloss-closure) @@ -54,11 +54,11 @@ and is therefore much faster and less storage intensive. ## Binary interface The store path acquired from the above methods contains -a `system`-specific binary under `$storePath/bin/nixpkgs-check-by-name`. +a `system`-specific binary under `$storePath/bin/nixpkgs-vet`. The public interface of this binary is printed by calling ```bash -result/bin/nixpkgs-check-by-name --help +result/bin/nixpkgs-vet --help ``` ## Validity checks diff --git a/default.nix b/default.nix index 1bdc348..bb51019 100644 --- a/default.nix +++ b/default.nix @@ -51,8 +51,8 @@ let }; shell = pkgs.mkShell { - env.NIX_CHECK_BY_NAME_NIX_PACKAGE = lib.getBin defaultNixPackage; - env.NIX_CHECK_BY_NAME_NIXPKGS_LIB = "${nixpkgs}/lib"; + env.NIXPKGS_VET_NIX_PACKAGE = lib.getBin defaultNixPackage; + env.NIXPKGS_VET_NIXPKGS_LIB = "${nixpkgs}/lib"; env.RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}"; inputsFrom = [ packages.build ]; nativeBuildInputs = with pkgs; [ @@ -156,7 +156,7 @@ let # Tests the tool on the pinned Nixpkgs tree with stable Nix. This is a good sanity check. nixpkgsCheck = pkgs.callPackage ./nixpkgs-check.nix { inherit initNix nixpkgs; - nixpkgs-check-by-name = packages.build; + nixpkgs-vet = packages.build; nix = pkgs.nixVersions.stable; }; diff --git a/nixpkgs-check.nix b/nixpkgs-check.nix index 3ffe24b..ad6ec8f 100644 --- a/nixpkgs-check.nix +++ b/nixpkgs-check.nix @@ -1,7 +1,7 @@ { lib, runCommand, - nixpkgs-check-by-name, + nixpkgs-vet, initNix, nixpkgs, nix, @@ -28,14 +28,14 @@ let mkNixpkgsCheck = name: nix: - runCommand "test-nixpkgs-check-by-name-with-${nix.name}" + runCommand "test-nixpkgs-vet-with-${nix.name}" { nativeBuildInputs = [ - nixpkgs-check-by-name + nixpkgs-vet nix ]; - env.NIX_CHECK_BY_NAME_NIX_PACKAGE = lib.getBin nix; + env.NIXPKGS_VET_NIX_PACKAGE = lib.getBin nix; passthru = { # Allow running against all other Nix versions. @@ -47,9 +47,9 @@ let } '' ${initNix} - # This is what nixpkgs-check-by-name uses - export NIX_CHECK_BY_NAME_NIX_PACKAGE=${lib.getBin nix} - ${nixpkgs-check-by-name}/bin/.nixpkgs-check-by-name-wrapped --base "${nixpkgs}" "${nixpkgs}" + # This is what nixpkgs-vet uses + export NIXPKGS_VET_NIX_PACKAGE=${lib.getBin nix} + ${nixpkgs-vet}/bin/.nixpkgs-vet-wrapped --base "${nixpkgs}" "${nixpkgs}" touch $out ''; in diff --git a/package.nix b/package.nix index fb57bd2..bc1f75e 100644 --- a/package.nix +++ b/package.nix @@ -24,7 +24,7 @@ let fs = lib.fileset; in rustPlatform.buildRustPackage { - pname = "nixpkgs-check-by-name"; + pname = "nixpkgs-vet"; inherit version; src = fs.toSource { @@ -44,8 +44,8 @@ rustPlatform.buildRustPackage { makeWrapper ]; - env.NIX_CHECK_BY_NAME_NIX_PACKAGE = lib.getBin nix; - env.NIX_CHECK_BY_NAME_NIXPKGS_LIB = "${path}/lib"; + env.NIXPKGS_VET_NIX_PACKAGE = lib.getBin nix; + env.NIXPKGS_VET_NIXPKGS_LIB = "${path}/lib"; checkPhase = '' # This path will be symlinked to the current version that is being tested @@ -54,8 +54,8 @@ rustPlatform.buildRustPackage { # For initNix export PATH=$nixPackage/bin:$PATH - # This is what nixpkgs-check-by-name uses - export NIX_CHECK_BY_NAME_NIX_PACKAGE=$nixPackage + # This is what nixpkgs-vet uses + export NIXPKGS_VET_NIX_PACKAGE=$nixPackage ${lib.concatMapStringsSep "\n" (nix: '' ln -s ${lib.getBin nix} "$nixPackage" @@ -69,7 +69,7 @@ rustPlatform.buildRustPackage { cargo clippy --all-targets -- -D warnings ''; postInstall = '' - wrapProgram $out/bin/nixpkgs-check-by-name \ - --set NIX_CHECK_BY_NAME_NIX_PACKAGE ${lib.getBin nix} + wrapProgram $out/bin/nixpkgs-vet \ + --set NIXPKGS_VET_NIX_PACKAGE ${lib.getBin nix} ''; } diff --git a/scripts/release.sh b/scripts/release.sh index d0c4a0a..194da1d 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -14,7 +14,7 @@ nixeval() { system=x86_64-linux root=$(git rev-parse --show-toplevel) rev=$(git -C "$root" rev-parse HEAD) -repository=${GITHUB_REPOSITORY:-NixOS/nixpkgs-check-by-name} +repository=${GITHUB_REPOSITORY:-NixOS/nixpkgs-vet} # Get the version from the Cargo.toml file version=$(nixeval "$root" -A version) diff --git a/src/eval.rs b/src/eval.rs index 8094d5c..db9152e 100644 --- a/src/eval.rs +++ b/src/eval.rs @@ -139,8 +139,8 @@ fn mutate_nix_instatiate_arguments_based_on_cfg( command.arg(&format!("test-nixpkgs={}", mock_nixpkgs_path.display())); // Retrieve the path to the real nixpkgs lib, then wire it up to `import `. - let nixpkgs_lib = env::var("NIX_CHECK_BY_NAME_NIXPKGS_LIB") - .with_context(|| "Could not get environment variable NIX_CHECK_BY_NAME_NIXPKGS_LIB")?; + let nixpkgs_lib = env::var("NIXPKGS_VET_NIXPKGS_LIB") + .with_context(|| "Could not get environment variable NIXPKGS_VET_NIXPKGS_LIB")?; command.arg("-I"); command.arg(&format!("test-nixpkgs/lib={nixpkgs_lib}")); @@ -157,7 +157,7 @@ pub fn check_values( package_names: Vec, ) -> validation::Result { let work_dir = Builder::new() - .prefix("nixpkgs-check-by-name") + .prefix("nixpkgs-vet") .tempdir() .with_context(|| "Failed to create a working directory")?; @@ -179,8 +179,8 @@ pub fn check_values( fs::write(&eval_nix_path, EVAL_NIX)?; // Pinning Nix in this way makes the tool more reproducible - let nix_package = env::var("NIX_CHECK_BY_NAME_NIX_PACKAGE") - .with_context(|| "Could not get environment variable NIX_CHECK_BY_NAME_NIX_PACKAGE")?; + let nix_package = env::var("NIXPKGS_VET_NIX_PACKAGE") + .with_context(|| "Could not get environment variable NIXPKGS_VET_NIX_PACKAGE")?; // With restrict-eval, only paths in NIX_PATH can be accessed. We explicitly specify them here. let mut command = process::Command::new(format!("{nix_package}/bin/nix-instantiate")); diff --git a/tests/non-by-name-trace/README.md b/tests/non-by-name-trace/README.md index 5aa2d79..8683f3b 100644 --- a/tests/non-by-name-trace/README.md +++ b/tests/non-by-name-trace/README.md @@ -1,2 +1,2 @@ This test makes sure that if evaluating top-level attributes give warnings, they won't end up in -the output, see https://github.com/NixOS/nixpkgs-check-by-name/issues/30 for more context +the output, see https://github.com/NixOS/nixpkgs-vet/issues/30 for more context