aboutsummaryrefslogtreecommitdiff
path: root/build-aux/pre-inst-env.in
blob: 14315d40d47166eedd54a61b3087f9c8f43caa41 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/sh

# GNU Guix --- Functional package management for GNU
# Copyright © 2012, 2013, 2014, 2015, 2017 Ludovic Courtès <ludo@gnu.org>
# Copyright © 2017 Eric Bavier <bavier@cray.com>
#
# This file is part of GNU Guix.
#
# GNU Guix is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or (at
# your option) any later version.
#
# GNU Guix is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

# Usage: ./pre-inst-env COMMAND ARG...
#
# Run COMMAND in a pre-installation environment.  Typical use is
# "./pre-inst-env guix build hello".

# By default we may end up with absolute directory names that contain '..',
# which get into $GUILE_LOAD_PATH, leading to '..' in the module file names
# recorded by Guile.  To avoid that, make sure we get a real absolute
# directory name.  Additionally, use '-P' to get the canonical directory name
# so that Guile's 'relative' %file-port-name-canonicalization can actually
# work (see <http://bugs.gnu.org/17935>.)
abs_top_srcdir="`cd "@abs_top_srcdir@" > /dev/null; pwd -P`"
abs_top_builddir="`cd "@abs_top_builddir@" > /dev/null; pwd -P`"

GUILE_LOAD_COMPILED_PATH="$abs_top_builddir${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_LOAD_COMPILED_PATH"
GUILE_LOAD_PATH="$abs_top_builddir:$abs_top_srcdir${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH"
export GUILE_LOAD_COMPILED_PATH GUILE_LOAD_PATH

# Define $PATH so that `guix' and friends are easily found.

PATH="$abs_top_builddir/scripts:$abs_top_builddir:$PATH"
export PATH

# Daemon helpers.

NIX_ROOT_FINDER="$abs_top_builddir/nix/scripts/list-runtime-roots"
NIX_SUBSTITUTERS="$abs_top_builddir/nix/scripts/substitute"
NIX_LIBEXEC_DIR="@abs_top_builddir@/nix/scripts" # for 'guix-authenticate'

export NIX_ROOT_FINDER NIX_SUBSTITUTERS NIX_LIBEXEC_DIR

NIX_BUILD_HOOK="$abs_top_builddir/nix/scripts/offload"
@BUILD_DAEMON_OFFLOAD_TRUE@export NIX_BUILD_HOOK
@BUILD_DAEMON_OFFLOAD_FALSE@# No offloading support.
@BUILD_DAEMON_OFFLOAD_FALSE@unset NIX_BUILD_HOOK

# The 'guix-register' program.
GUIX_REGISTER="$abs_top_builddir/guix-register"
export GUIX_REGISTER

# The following variables need only be defined when compiling Guix
# modules, but we define them to be on the safe side in case of
# auto-compilation.

NIX_HASH="@NIX_HASH@"
export NIX_HASH

# Define $GUIX_UNINSTALLED to prevent `guix' from
# prepending @guilemoduledir@ to the Guile load paths.

GUIX_UNINSTALLED=1
export GUIX_UNINSTALLED

exec "$@"
35510d37cc6b84bec480ef5fa1'>daemon: Fix the displayed GC estimated progress....Ludovic Courtès 2020-01-12daemon: Account for deleted store files when deduplication is on....Ludovic Courtès 2019-11-29daemon: 'pathExists' uses 'statx' when available....Ludovic Courtès 2019-11-27daemon: 'deletePath' uses 'statx' when available....Ludovic Courtès 2019-11-27daemon: GC remove-unused-links phase uses 'statx' when available....Ludovic Courtès 2019-11-26daemon: boost::format: Fix typo "referred"....Vagrant Cascadian 2019-11-26guix build, daemon: Rename "--no-build-hook" to "--no-offload"....Ludovic Courtès 2019-11-22daemon: GC displays how much it has collected....Ludovic Courtès 2019-11-13daemon: Don't include <linux/fs.h>....Ludovic Courtès 2019-11-04daemon: Unregister build hook from the worker's children upon build failure....Ludovic Courtès 2019-10-16daemon: Make 'profiles/per-user' non-world-writable....Ludovic Courtès 2019-10-16daemon: Remove traces of 'NIX_ROOT_FINDER'....Ludovic Courtès 2019-09-28daemon: Strictly respect timeouts for 'guix offload'....Ludovic Courtès 2019-09-16daemon: Include 'config.h' in 'nix-daemon.cc'....Timothy Sample 2019-09-08daemon: Remove 'NIX_LIBEXEC_DIR'....Ludovic Courtès 2019-09-08daemon: Run 'guix substitute' directly and assume a single substituter....Ludovic Courtès 2019-09-08daemon: Run 'guix offload' directly....Ludovic Courtès 2019-09-08daemon: Run 'guix perform-download' directly....Ludovic Courtès 2019-09-08daemon: Run 'guix authenticate' directly....Ludovic Courtès 2019-09-08daemon: Invoke 'guix gc --list-busy' instead of 'list-runtime-roots'....Ludovic Courtès 2019-08-30daemon: Don't reply on 'st_blocks'....Eelco Dolstra 2019-06-13daemon: Replace "illegal" by "invalid" in error messages....Ludovic Courtès