prefer-remote-fetch: use override instead of knowledge of build helper internals#457313
prefer-remote-fetch: use override instead of knowledge of build helper internals#457313philiptaron wants to merge 2 commits intoNixOS:masterfrom
Conversation
…r internals Replaces NixOS#457086
|
I am wondering if setting Edit: Well, no, actually, I don’t think it saves a round‐trip at all, it’s just a choice between uploading and downloading, right? When they’re symmetric it shouldn’t matter, and when they’re asymmetric download is pretty much invariably faster. So the only time you’d want |
I take no position on the overlay. Shipping this sort of overlay without any tests and with the current implementation seems unwise... and these aren't the only fetchers with But if it's here, it shouldn't grub around like it currently does. |
|
Right, for sure, no objection to making these less hacky. I am just wondering if the better (but less conservative, so longer‐term) approach, rather than introducing public API to all our fetchers, would be to drop |
|
I prefer making all configurations go through the This is harder for packages, as there's little mechanisms we could use to expose the supported attributes. For build helpers, however, we have function arguments. PR #457426 proposes a |
|
Or how about adding a new |
|
I've pushed an extra commit to fix eval for fetchurl and now my system evaluates again. |
There was a problem hiding this comment.
I prefer making all configurations go through the
overrideAttrs-related interface and reserving theoverride-related interface forcallPackagepurposes.
Rightly or wrongly, callPackage args are commonly used to configure high-level aspects of packages, like { withFoo ? true, withBar ? false, enableXyz ? true, }:.
I don't want to block a PR for continuing to use a pattern that is prevalent throughout nixpkgs. AFAIK there's been no discussion, guidance, or documentation around discouraging this pattern either?
In #457086 (review), @philiptaron complained this has no tests. So I'm slightly confused to see no tests added here 😉
Not blocking though, as this is a clear simplification even without test coverage.
| }: | ||
|
|
||
| let | ||
| cpPreferLocalBuild = preferLocalBuild; |
There was a problem hiding this comment.
This should be consistent with the rest of the PR:
| cpPreferLocalBuild = preferLocalBuild; | |
| preferLocalBuildDefault = preferLocalBuild; |
| # Doing the download on a remote machine just duplicates network | ||
| # traffic, so don't do that by default |
There was a problem hiding this comment.
This comment should be moved to where the default is now set. I.e., the ? true in the callPackage args.
There was a problem hiding this comment.
The second commit feels part of the same "logical unit" as the first, so should be squashed.
I agree. Enforcement should be based on consensus. Still, |
|
Yeah using I’d also be fine leaving this PR as a cleanup and deferring a config-based refactor for a follow-up. Up to @philiptaron whether to expand scope here or keep this PR minimal and let a separate PR explore the config direction. |
|
Please ping me when you have decided on something. Thanks! |
|
It just came to me that I expose For the choice of |
|
Closing this in favor of #475142 |
What do you all think of this? There's a lot of ways to approach this problem, but making these fetchers customizable this way makes sense to me.
Replaces:
Things done