-
-
Notifications
You must be signed in to change notification settings - Fork 18.2k
allow fetchpatch everywhere, without restrictions #188587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
afad2fc
a804503
be7ab33
e3e13bf
9d8b7b3
42e4382
b4b5f50
b69ff34
30a099f
0049f31
c90d174
5af5661
64dc3d0
54ec6c5
34f871a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # this file was copied from https://github.com/NixOS/nix and modified to | ||
| # add support for marking fetches as __impure derivations. | ||
|
|
||
| { system ? "" # obsolete | ||
| , url | ||
| , hash ? "" # an SRI hash | ||
|
|
||
| # Legacy hash specification | ||
| , md5 ? "", sha1 ? "", sha256 ? "", sha512 ? "" | ||
| , outputHash ? | ||
| if hash != "" then hash else if sha512 != "" then sha512 else if sha1 != "" then sha1 else if md5 != "" then md5 else sha256 | ||
| , outputHashAlgo ? | ||
| if hash != "" then "" else if sha512 != "" then "sha512" else if sha1 != "" then "sha1" else if md5 != "" then "md5" else "sha256" | ||
|
|
||
| , executable ? false | ||
| , unpack ? false | ||
| , name ? baseNameOf (toString url) | ||
| , impure ? false | ||
| }: | ||
|
|
||
| derivation ({ | ||
| builder = "builtin:fetchurl"; | ||
|
|
||
| # New-style output content requirements. | ||
| outputHashMode = if unpack || executable then "recursive" else "flat"; | ||
|
|
||
| inherit name url executable unpack; | ||
|
|
||
| system = "builtin"; | ||
|
|
||
| # No need to double the amount of network traffic | ||
| preferLocalBuild = true; | ||
|
|
||
| impureEnvVars = [ | ||
| # We borrow these environment variables from the caller to allow | ||
| # easy proxy configuration. This is impure, but a fixed-output | ||
| # derivation like fetchurl is allowed to do so since its result is | ||
| # by definition pure. | ||
| "http_proxy" "https_proxy" "ftp_proxy" "all_proxy" "no_proxy" | ||
| ]; | ||
|
|
||
| # To make "nix-prefetch-url" work. | ||
| urls = [ url ]; | ||
| } // (if impure then { __impure = true; } else { inherit outputHashAlgo outputHash; })) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -104,6 +104,8 @@ let | |
|
|
||
| fetchurlBoot = import ../../build-support/fetchurl/boot.nix { | ||
| inherit system; | ||
| inherit (prevStage) stdenv; | ||
| fetchurl = thisStdenv.fetchurlBoot; | ||
| }; | ||
|
|
||
| cc = if prevStage.gcc-unwrapped == null | ||
|
|
@@ -188,6 +190,17 @@ in | |
| }; | ||
| coreutils = bootstrapTools; | ||
| gnugrep = bootstrapTools; | ||
|
|
||
| fetchpatch = import ../../build-support/fetchpatch/default.nix { | ||
| inherit lib; | ||
| buildPackages.patchutils_0_3_3 = prevStage.patchutils_0_3_3.override { | ||
| forStdenvBootstrap = true; | ||
| # the parts of patchutils used by fetchpatch do not | ||
| # require perl, so we could eliminate this by patching | ||
| # patchutils' build scripts... | ||
| perl = bootstrapTools; | ||
|
Comment on lines
+198
to
+201
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure if bootstrapTools contains anything related to perl. If not then I think it would be cleaner to exclude it like makeWrapper.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The I would love to eliminate |
||
| }; | ||
| }; | ||
| }; | ||
| }) | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.