Skip to content

Commit

Permalink
flake: fix patch for nix-eval-jobs
Browse files Browse the repository at this point in the history
We carry a custom patch for nix-eval-jobs that causes the tool to not
unset the `NIX_PATH` environment variable anymore. The patch does not
apply anymore starting with d0bcdae (clang-tidy: use trailing return
type, 2024-11-10) because surrounding code has changed. Other than that
the patch still applies.

The mentioned commit was released with nix-eval-jobs v2.25.0, which
nixos-unstable has recently upgraded to. Adapt the patch to unbreak the
build.

Fixes #255.
  • Loading branch information
pks-t authored and zhaofengli committed Dec 16, 2024
1 parent a7cadad commit 5b124f7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
6 changes: 1 addition & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@
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";
})
./nix-eval-jobs.patch
];
});
in {
Expand Down
16 changes: 16 additions & 0 deletions nix-eval-jobs.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)

0 comments on commit 5b124f7

Please sign in to comment.