Use a proper-ish fix for the path cannot have references thingy

This commit is contained in:
Alexander Bantyev 2021-11-06 18:18:37 +03:00
parent 237289130c
commit d427a483e2
Signed by: balsoft
GPG Key ID: E081FF12ADCB4AD5
5 changed files with 10 additions and 39 deletions

View File

@ -370,16 +370,18 @@
"nixpkgs": "nixpkgs_6"
},
"locked": {
"lastModified": 1635424607,
"narHash": "sha256-Yumem7c3rcngTaPtUc/yms3Imi5P6dVMPmy0GnHyCWw=",
"owner": "NixOS",
"lastModified": 1636141290,
"narHash": "sha256-mQ+qS1oTnxBDWUUT1kr7QzjUz4K35JDFdO8ELsfCEgk=",
"owner": "tweag",
"repo": "nix",
"rev": "bc4b7521f4a72de1d7a9db0b5be76885e0729e7c",
"rev": "9d4dcff37a14c5bab98761e417a2335a9ac68c96",
"type": "github"
},
"original": {
"id": "nix",
"type": "indirect"
"owner": "tweag",
"ref": "balsoft/allow-references-in-addPath",
"repo": "nix",
"type": "github"
}
},
"nix-direnv": {

View File

@ -6,6 +6,7 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nix.url = "github:tweag/nix?ref=balsoft/allow-references-in-addPath";
lambda-launcher.url = "github:balsoft/lambda-launcher";
deploy-rs.url = "github:serokell/deploy-rs";
flake-compat = {

View File

@ -24,9 +24,7 @@
];
package = inputs.nix.defaultPackage.${pkgs.system}.overrideAttrs (oa: {
patches = [ ./nix.patch ./unset-is-macho.patch ] ++ oa.patches or [ ];
# HAHA
doInstallCheck = false;
patches = [ ./nix.patch ] ++ oa.patches or [ ];
});
extraOptions = ''

View File

@ -40,20 +40,3 @@ index e04954d45..5649bd01a 100644
globals.dryRun = false;
globals.preserveInstalled = false;
globals.removeAll = false;
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index f27331534..386a664d9 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -1862,9 +1862,9 @@ static void addPath(
if (state.store->isInStore(path)) {
auto [storePath, subPath] = state.store->toStorePath(path);
auto info = state.store->queryPathInfo(storePath);
- if (!info->references.empty())
- throw EvalError("store path '%s' is not allowed to have references",
- state.store->printStorePath(storePath));
+ // if (!info->references.empty())
+ // throw EvalError("store path '%s' is not allowed to have references",
+ // state.store->printStorePath(storePath));
path = state.store->toRealPath(storePath) + subPath;
}

View File

@ -1,13 +0,0 @@
diff --git a/src/nix/get-env.sh b/src/nix/get-env.sh
index 42c806450..a8563c772 100644
--- a/src/nix/get-env.sh
+++ b/src/nix/get-env.sh
@@ -8,6 +8,8 @@ if [[ -n $stdenv ]]; then
source $stdenv/setup
fi
+unset -f isMachO
+
# Better to use compgen, but stdenv bash doesn't have it.
__vars="$(declare -p)"
__functions="$(declare -F)"