[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
49/118: Allow $NIX_BUILD_HOOK to be relative to Nix libexec directory
From: |
Ludovic Courtès |
Subject: |
49/118: Allow $NIX_BUILD_HOOK to be relative to Nix libexec directory |
Date: |
Tue, 19 May 2015 14:45:35 +0000 |
civodul pushed a commit to branch nix
in repository guix.
commit e196eecbe6552d5afed89ad480544c90cf959922
Author: Eelco Dolstra <address@hidden>
Date: Fri Jul 11 13:55:06 2014 +0200
Allow $NIX_BUILD_HOOK to be relative to Nix libexec directory
---
src/libstore/build.cc | 6 ++++--
src/libstore/globals.cc | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 1870abe..d594706 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -590,7 +590,9 @@ HookInstance::HookInstance()
{
debug("starting build hook");
- Path buildHook = absPath(getEnv("NIX_BUILD_HOOK"));
+ Path buildHook = getEnv("NIX_BUILD_HOOK");
+ if (string(buildHook, 0, 1) != "/") buildHook = settings.nixLibexecDir +
"/nix/" + buildHook;
+ buildHook = canonPath(buildHook);
/* Create a pipe to get the output of the child. */
fromHook.create();
@@ -1503,7 +1505,7 @@ void DerivationGoal::buildDone()
HookReply DerivationGoal::tryBuildHook()
{
- if (!settings.useBuildHook || getEnv("NIX_BUILD_HOOK") == "") return
rpDecline;
+ if (!settings.useBuildHook) return rpDecline;
if (!worker.hook)
worker.hook = std::shared_ptr<HookInstance>(new HookInstance);
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc
index 8bffdd7..b9d028b 100644
--- a/src/libstore/globals.cc
+++ b/src/libstore/globals.cc
@@ -38,7 +38,7 @@ Settings::Settings()
thisSystem = SYSTEM;
maxSilentTime = 0;
buildTimeout = 0;
- useBuildHook = true;
+ useBuildHook = getEnv("NIX_BUILD_HOOK") != "";
printBuildTrace = false;
reservedSize = 1024 * 1024;
fsyncMetadata = true;
- 45/118: nix-copy-closure -s: Do substitutions via ‘nix-store --serve’, (continued)
- 45/118: nix-copy-closure -s: Do substitutions via ‘nix-store --serve’, Ludovic Courtès, 2015/05/19
- 40/118: Remove maybeVfork, Ludovic Courtès, 2015/05/19
- 50/118: Fix closure size display, Ludovic Courtès, 2015/05/19
- 38/118: Fix security hole in ‘nix-store --serve’, Ludovic Courtès, 2015/05/19
- 43/118: Remove tabs, Ludovic Courtès, 2015/05/19
- 35/118: Don't build on Ubuntu 10.10, Ludovic Courtès, 2015/05/19
- 44/118: nix-copy-closure: Fix --dry-run, Ludovic Courtès, 2015/05/19
- 47/118: Replace message "importing path <...>" with "exporting path <...>", Ludovic Courtès, 2015/05/19
- 37/118: Add a test for the SSH substituter, Ludovic Courtès, 2015/05/19
- 39/118: nix-copy-closure: Fix race condition, Ludovic Courtès, 2015/05/19
- 49/118: Allow $NIX_BUILD_HOOK to be relative to Nix libexec directory,
Ludovic Courtès <=
- 52/118: Fix test, Ludovic Courtès, 2015/05/19
- 42/118: Refactoring: Move all fork handling into a higher-order function, Ludovic Courtès, 2015/05/19
- 41/118: nix-copy-closure: Restore compression and the progress viewer, Ludovic Courtès, 2015/05/19
- 54/118: build-remote.pl: Don't keep a shell process around, Ludovic Courtès, 2015/05/19
- 57/118: Manual: Typo, Ludovic Courtès, 2015/05/19
- 53/118: build-remote.pl: Fix build log, Ludovic Courtès, 2015/05/19
- 66/118: nix-daemon: Show name of connecting user, Ludovic Courtès, 2015/05/19
- 58/118: Pass *_proxy vars to bootstrap fetchurl, Ludovic Courtès, 2015/05/19
- 56/118: Remove cruft, Ludovic Courtès, 2015/05/19
- 48/118: Fix broken Pid constructor, Ludovic Courtès, 2015/05/19