applyPatches: skip creating additional drv when no patches#236370
applyPatches: skip creating additional drv when no patches#236370RaitoBezarius merged 1 commit intoNixOS:masterfrom
Conversation
5c65778 to
c591958
Compare
There was a problem hiding this comment.
Having to change this is probably a disadvantage.
There was a problem hiding this comment.
I actually think this is better because it doesn’t couple to the implementation of name in src. FWIW there are already 80+ instances matching the regex sourceRoot = .*src\.name in Nix files in nixpkgs, and this was the only instance of source-patched in all of nixpkgs.
There was a problem hiding this comment.
I think the main problem I have with this PR is the unintended name change when no patches are supplied
There was a problem hiding this comment.
Could you elaborate a bit on the concern? Is it that it may cause unforseen breakage upon merge? Confuse future users? Something else?
Tbh, I would be for a tree-wide (plus doc) change from sourceRoot = "source/…" → sourceRoot = "${src.name}/…" because, tbh, I was flummoxed for a while upon initially using applyPatches why the sourceRoot wasn’t working anymore. If it had always been used ${src.name} instead of source it would have just worked. Alternatively could change the name in applyPatches… I don’t really have a strong opinion either way.
There was a problem hiding this comment.
Is it that it may cause unforseen breakage upon merge? Confuse future users?
yes and yes
I don't, please ask in nixos-dev on matrix
There was a problem hiding this comment.
So looks like sourceRoot = "${src.name}…" is now the preferred way #245388
|
Can you also check mastodon and proxysql? @ofborg build mastodon proxysql |
c591958 to
cfa559c
Compare
|
@SuperSandro2000 I rebased off latest master, resolved conflicts, built mastodon and proxysql successfully (locally, ofborg seemed to never build them, sat queued forever), and compared them both with diffoscope vs. master builds and the only differences were store path hashes. |
cfa559c to
0d3c6d3
Compare
0d3c6d3 to
9e392b0
Compare
oxij
left a comment
There was a problem hiding this comment.
I also noticed this and wanted to remove it in bitwarden, so this would be nice.
9e392b0 to
4c9371a
Compare
|
@amarshall Apparently, there's some conflicts (?). |
If there are no `patches` or `postPatch`, then this will just do work to make something equivalent to `src`. Instead, just return `src` in that case.
|
@RaitoBezarius rebased and resolved conflicts—was trivial formatting. Also:
|
4c9371a to
52c2735
Compare
Description of changes
If there are no
patchesorpostPatch, then this will just do work to make something equivalent tosrc. Instead, just returnsrcin that case.There are a few instances in nixpkgs where the
patchestoapplyPatchesis dynamic, and may be empty, so this optimizes those. It also removes the want to removeapplyPatchesas an optimization just because thepatchesare empty when it may semantically make sense to keep it (because e.g.patchestomkDerivationdoesn’t work as expected).Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)