-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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
applyPatches: skip creating additional drv when no patches #236370
Conversation
5c65778
to
c591958
Compare
@@ -48,7 +48,7 @@ let | |||
desktop-native = rustPlatform.buildRustPackage { | |||
pname = "bitwarden-desktop-native"; | |||
inherit src version; | |||
sourceRoot = "source-patched/apps/desktop/desktop_native"; | |||
sourceRoot = "${src.name}/apps/desktop/desktop_native"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having to change this is probably a disadvantage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
patches
orpostPatch
, then this will just do work to make something equivalent tosrc
. Instead, just returnsrc
in that case.There are a few instances in nixpkgs where the
patches
toapplyPatches
is dynamic, and may be empty, so this optimizes those. It also removes the want to removeapplyPatches
as an optimization just because thepatches
are empty when it may semantically make sense to keep it (because e.g.patches
tomkDerivation
doesn’t work as expected).Things done
sandbox = true
set 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/
)