Set SKIP_CC_CVMFS=1 in nix-shell pure mode to avoid CVMFS pollution
This commit is contained in:
16
README.md
16
README.md
@@ -170,19 +170,9 @@ channel to the clusters until fixed.
|
||||
|
||||
The `nix-shell` command can be used to enter a non-sandboxed version
|
||||
of the build environment from the top-level directory. Passing the
|
||||
`--pure` option causes it to purge the environment. RHEL and Fedora
|
||||
do not guard against multiple evaluations of the */etc/profile.d*
|
||||
scripts though, so the default *~/.bashrc* will restore it unless it
|
||||
is modified to not source */etc/bashrc* when `__ETC_PROFILE_SOURCED`
|
||||
is set
|
||||
|
||||
```bash
|
||||
sed -i -e 's|^\(\s*\)\(\. /etc/bashrc\)\s*$|\1test -n "$__ETC_PROFILE_SOURCED" \|\| \2|' ~/.bashrc
|
||||
```
|
||||
|
||||
With this one-time change, a purged simulated build environment can be
|
||||
entered by running
|
||||
|
||||
`--pure` option causes it to purge the environment (RHEL and Fedora do
|
||||
not guard against multiple evaluations of the */etc/profile.d* scripts
|
||||
via `__ETC_PROFILE_SOURCED` so this may not be 100% effective)
|
||||
|
||||
```bash
|
||||
nix-shell --pure --attr attribute
|
||||
|
||||
@@ -35,7 +35,7 @@ self: super: pkgs: with pkgs; {
|
||||
sambamba = callPackage ./sambamba { };
|
||||
|
||||
nixStable = super.nixStable.overrideAttrs
|
||||
( attrs: { patches = attrs.patches or [] ++ [ ./nix/remote.patch ]; } );
|
||||
( attrs: { patches = attrs.patches or [] ++ [ ./nix/remote.patch ./nix/cvmfs.patch ]; } );
|
||||
nix = super.nix.overrideAttrs
|
||||
( attrs: { patches = attrs.patches or [] ++ [ ./nix/remote.patch ]; } );
|
||||
( attrs: { patches = attrs.patches or [] ++ [ ./nix/remote.patch ./nix/cvmfs.patch ]; } );
|
||||
}
|
||||
|
||||
12
pkgs/nix/cvmfs.patch
Normal file
12
pkgs/nix/cvmfs.patch
Normal file
@@ -0,0 +1,12 @@
|
||||
diff --git a/scripts/nix-build.in b/scripts/nix-build.in
|
||||
index bb61e1c..d58d687 100755
|
||||
--- a/scripts/nix-build.in
|
||||
+++ b/scripts/nix-build.in
|
||||
@@ -276,6 +276,7 @@ foreach my $expr (@exprs) {
|
||||
}
|
||||
# NixOS hack: prevent /etc/bashrc from sourcing /etc/profile.
|
||||
$ENV{'__ETC_PROFILE_SOURCED'} = 1;
|
||||
+ $ENV{'SKIP_CC_CVMFS'} = 1;
|
||||
}
|
||||
$ENV{'NIX_BUILD_TOP'} = $ENV{'TMPDIR'} = $ENV{'TEMPDIR'} = $ENV{'TMP'} = $ENV{'TEMP'} = $tmp;
|
||||
$ENV{'NIX_STORE'} = $Nix::Config::storeDir;
|
||||
Reference in New Issue
Block a user