Skip to content
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

treewide: add warning comment to “boot” packages … #91636

Merged
merged 2 commits into from Jul 31, 2020

Conversation

matthewbauer
Copy link
Member

This adds a warning to the top of each “boot” package that reads:

Note: this package is used for bootstrapping fetchurl, and thus cannot
use fetchpatch! All mutable patches (generated by GitHub or cgit) that
are needed here should be included directly in Nixpkgs as files.

This makes it clear to maintainer that they may need to treat this
package a little differently than others. Importantly, we can’t use
fetchpatch here due to using <nix/fetchurl.nix>. To avoid having stale
hashes, we need to include patches that are subject to changing
overtime (for instance, gitweb’s patches contain a version number at
the bottom).

Also fixes attr:

Unfortunately the output of git.savannah.nongnu.org changes with each
gitweb update. This means that the current has
“0gja54fz79a9ma6b4mprnjxq77l5yg2z9xknlwhmkcrfnam02qxp” is no longer
correct:

$ nix-prefetch-url
https://git.savannah.nongnu.org/cgit/attr.git/patch/\?id=14adc898a36948267bfe5c63b399996879e94c98
1g8sky52rjg9fpmrddza1af89s9qd4bzsbxqb7mc5bv8gyh10s1k

Normally, we use fetchpatch to strip this out, but unfortunately attr
cannot use fetchpatch due to being used in bootstrapping fetchurl.
That is, it can’t use a custom postFetch since <nix/fetchurl.nix>
doesn’t support that.

Unfortunately the output of git.savannah.nongnu.org changes with each
gitweb update. This means that the current has
“0gja54fz79a9ma6b4mprnjxq77l5yg2z9xknlwhmkcrfnam02qxp” is no longer
correct:

$ nix-prefetch-url
https://git.savannah.nongnu.org/cgit/attr.git/patch/\?id=14adc898a36948267bfe5c63b399996879e94c98
1g8sky52rjg9fpmrddza1af89s9qd4bzsbxqb7mc5bv8gyh10s1k

Normally, we use fetchpatch to strip this out, but unfortunately attr
cannot use fetchpatch due to being used in bootstrapping fetchurl.
That is, it can’t use a custom postFetch since <nix/fetchurl.nix>
doesn’t support that.

To solve this problem, just inline the patch for now.
This adds a warning to the top of each “boot” package that reads:

  Note: this package is used for bootstrapping fetchurl, and thus cannot
  use fetchpatch! All mutable patches (generated by GitHub or cgit) that
  are needed here should be included directly in Nixpkgs as files.

This makes it clear to maintainer that they may need to treat this
package a little differently than others. Importantly, we can’t use
fetchpatch here due to using <nix/fetchurl.nix>. To avoid having stale
hashes, we need to include patches that are subject to changing
overtime (for instance, gitweb’s patches contain a version number at
the bottom).
@Ericson2314
Copy link
Member

Ericson2314 commented Jul 8, 2020

(offtopic) It would be great to allow impure derivations be depended upon by fixed-output derivations, and fetchpatch use that so it works either way.

CC @edolstra

@matthewbauer matthewbauer changed the base branch from master to staging July 8, 2020 22:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants