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" "nixpkgs": "nixpkgs_6"
}, },
"locked": { "locked": {
"lastModified": 1635424607, "lastModified": 1636141290,
"narHash": "sha256-Yumem7c3rcngTaPtUc/yms3Imi5P6dVMPmy0GnHyCWw=", "narHash": "sha256-mQ+qS1oTnxBDWUUT1kr7QzjUz4K35JDFdO8ELsfCEgk=",
"owner": "NixOS", "owner": "tweag",
"repo": "nix", "repo": "nix",
"rev": "bc4b7521f4a72de1d7a9db0b5be76885e0729e7c", "rev": "9d4dcff37a14c5bab98761e417a2335a9ac68c96",
"type": "github" "type": "github"
}, },
"original": { "original": {
"id": "nix", "owner": "tweag",
"type": "indirect" "ref": "balsoft/allow-references-in-addPath",
"repo": "nix",
"type": "github"
} }
}, },
"nix-direnv": { "nix-direnv": {

View File

@ -6,6 +6,7 @@
inputs = { inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; 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"; lambda-launcher.url = "github:balsoft/lambda-launcher";
deploy-rs.url = "github:serokell/deploy-rs"; deploy-rs.url = "github:serokell/deploy-rs";
flake-compat = { flake-compat = {

View File

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

View File

@ -40,20 +40,3 @@ index e04954d45..5649bd01a 100644
globals.dryRun = false; globals.dryRun = false;
globals.preserveInstalled = false; globals.preserveInstalled = false;
globals.removeAll = 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)"