Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flake: fix patch for nix-eval-jobs #256

Merged
merged 3 commits into from
Dec 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
patched = prev.nix-eval-jobs.overrideAttrs (old: {
version = old.version + "-colmena";
patches = (old.patches or []) ++ [
# Allows NIX_PATH to be honored
(final.fetchpatch {
url = "https://github.com/zhaofengli/nix-eval-jobs/commit/6ff5972724230ac2b96eb1ec355cd25ca512ef57.patch";
hash = "sha256-2NiMYpw27N+X7Ixh2HkP3fcWvopDJWQDVjgRdhOL2QQ";
})
(if builtins.compareVersions old.version "2.25.0" >= 0 then
./nix-eval-jobs-unstable.patch
else
./nix-eval-jobs-stable.patch
)
];
});
in {
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/tools.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let
nixosLib = import (pkgs.path + "/nixos/lib") { };

inputClosureOf = pkg: pkgs.runCommand "full-closure" {
refs = pkgs.writeReferencesToFile pkg.drvPath;
refs = pkgs.writeClosure [ pkg.drvPath ];
} ''
touch $out

Expand Down
25 changes: 25 additions & 0 deletions nix-eval-jobs-stable.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 6ff5972724230ac2b96eb1ec355cd25ca512ef57 Mon Sep 17 00:00:00 2001
From: Zhaofeng Li <hello@zhaofeng.li>
Date: Sat, 5 Oct 2024 17:59:04 -0600
Subject: [PATCH] Allow NIX_PATH environment variable

---
src/nix-eval-jobs.cc | 5 -----
1 file changed, 5 deletions(-)

diff --git a/src/nix-eval-jobs.cc b/src/nix-eval-jobs.cc
index de7a2bcf..30de4c53 100644
--- a/src/nix-eval-jobs.cc
+++ b/src/nix-eval-jobs.cc
@@ -342,11 +342,6 @@ void collector(Sync<State> &state_, std::condition_variable &wakeup) {
}

int main(int argc, char **argv) {
-
- /* Prevent undeclared dependencies in the evaluation via
- $NIX_PATH. */
- unsetenv("NIX_PATH");
-
/* We are doing the garbage collection by killing forks */
setenv("GC_DONT_GC", "1", 1);

16 changes: 16 additions & 0 deletions nix-eval-jobs-unstable.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/src/nix-eval-jobs.cc b/src/nix-eval-jobs.cc
index 13d610c..e5e6a0f 100644
--- a/src/nix-eval-jobs.cc
+++ b/src/nix-eval-jobs.cc
@@ -376,11 +376,6 @@ void collector(nix::Sync<State> &state_, std::condition_variable &wakeup) {
} // namespace

auto main(int argc, char **argv) -> int {
-
- /* Prevent undeclared dependencies in the evaluation via
- $NIX_PATH. */
- unsetenv("NIX_PATH"); // NOLINT(concurrency-mt-unsafe)
-
/* We are doing the garbage collection by killing forks */
setenv("GC_DONT_GC", "1", 1); // NOLINT(concurrency-mt-unsafe)

Loading