buildEnv: builder.pl: use signature and move the ignoreSingleFileOutputs parameter after the collision-related ones#364203
Conversation
|
I'll add some package tests for |
|
I added @stigtsp (who is busy and under no compulsion to review) as an FYI for their Perl expertise. |
philiptaron
left a comment
There was a problem hiding this comment.
Adding tests is a good idea. The Perl passes my reading of it and a quick build on Big Computer. The parameter order changes to keep collision-related parameters together make sense.
stigtsp
left a comment
There was a problem hiding this comment.
Code LGTM
Using signatures is a great idea. This feature has in practice been stable for a long time and is commonly used.
| @@ -1,6 +1,7 @@ | |||
| #! @perl@ -w | |||
|
|
|||
| use strict; | |||
There was a problem hiding this comment.
| use strict; | |
| use v5.40; |
Using v5.40 also enables strict, and requires that version (or later) of perl, and enables other features like try/catch, say etc.
Not strictly needed for this PR of course - so feel free to not include this suggestion.
There was a problem hiding this comment.
Since Perl is at 5.40.0 on the stable branch, it should be safe to add such a requirement.
There was a problem hiding this comment.
Let's do it in a new PR instead.
philiptaron
left a comment
There was a problem hiding this comment.
Actually, while a test would be great, I would also be fine merging as-is.
|
@stigtsp Just tested |
|
@stigtsp Since |
37adb60 to
a3d0d19
Compare
|
The change has been reset, and @philiptaron, should we merge now? |
If it doesn't work with the feature flags from 5.40, then it's fine to not include that change of course. 👍 |
This PR uses Perl's
signaturesfeature to increase readability and maintainability. This makes errors related to functional argument passing more discoverable.Perl's
signaturesfeature was added in Perl 5.20 and stabilized in Perl 5.32. As the Perl version in Nixpkgsrelease-24.05(the previous stable release branch) is already5.38.2, it should be safe to use such a feature in current Nixpkgs.This PR also includes a commit to move the
ignoreSingleFileOutputsargument after the ones that deal with collisions (to be exact, afterpriority). I added right afterignoreCollisionsin #353752 for the convenience of my development but realized later that it would look awkward when reading through the function call.Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.