-
Notifications
You must be signed in to change notification settings - Fork 31
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
Remove Nix dependency: flake-utils + fixups #802
Conversation
1de16cc
to
c7f47ef
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.
The two first commits definitely bring some nice improvements to the flake; thank you for catching the typo! As for the third one, removing flake-utils
and replacing it by repeated calls to nixpkgs.lib.genAttrs
, I am much less convinced by the motivation and the gain in usability and readability, but it does seem clean to me.
c7f47ef
to
e9cdbd9
Compare
The motivation is in #613. Tweag isn’t maintaining Topiary its package in upstream Nixpkgs, which is still on 0.3.x. I would like to use the latest version which seems easiest as a flake, but there are more dependencies than needed which pollute my own flake which I now need to audit for security. Currently, Nickel still has |
If With regards to readability: Subjectively I think this reads almost identical. |
✔️ |
4a3a312
to
a188780
Compare
For more motivation: https://ayats.org/blog/no-flake-utils/ |
Yes, this is few lines of code & less loops. |
a188780
to
db2c709
Compare
db2c709
to
560b767
Compare
Rebased & resolved conflicts |
560b767
to
f5cae43
Compare
Rerebased & reresolved conflicts |
f5cae43
to
b1a0749
Compare
b1a0749
to
01c4fae
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.
LGTM. I don't know how the Topiary people feel about the flake-utils
part - I personally don't have any strong opinion. However, in practice this part of the PR feels more guided by taste and doesn't have much impact currently, as flake-utils is still part of the inputs transitively and it's not sure that we'll get rid of it in Nickel.
@toastal: would that be ok to take out the last commit as a separate PR, where we can discuss the flake-utils
question independently? I think the first three commits of this PR are uncontroversial and ready to merge.
Not sure I understand why this would be in any shape controversial. We all remember leftpad or see these Python & npm supply chain attacks surface for not wanting to write 5 lines of code. Normalize adding a couple of line over adding an entire dependency.
--
toastal ไข่ดาว | https://toast.al
PGP: 7944 74b7 d236 dab9 c9ef e7f9 5cce 6f14 66d4 7c9e
|
I agree with @yannham to say that the first three commit seem uncontroversial when the last one is a matter of taste (or potentially threat model). I would be up for merging the three ones today and spend a bit of time deciding what to do with the last one.
This is a very one-sided story. Sure we do remember or see those, but we also know of all the bugs introduced by people deciding to reinvent the wheel (even only for 5 lines). I am not saying that this is the case here — the change looks sound to me — but it is more of a personal choice and therefore I do think that the Topiary team should make the call. |
A for loop vs. Regardless, these patches stack cleanly so maintainers can cherry-pick commits if they choose. There isn’t a good reason to be opening new patchsets willy-nilly just because the Microsoft GitHub UX is flawed for doing patches/review. |
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'm not a Nix person, hence deferring to @Niols and @yannham -- thank you both 🙏 -- but I think a decision needs to be made on this...so I'm going to stick my neck out 🙈
I'm going to approve this, including the "opinionated" part of the PR, for the following reasons:
- If it replaces a dependency with something straightforward -- and certainly clear (and, therefore, maintainable) -- then that seems like a good thing.
- Given that @toastal maintains Topiary in Nixpkgs for us, if this makes that process easier for them -- or, indeed, anyone -- then that also seems like a good thing.
Sounds good to me. The patch definitely looks safe to me; let's merge! |
This dependency isn’t useful since it is just a loop, doesn’t capture all supported systems, & isn’t worth propagating it to downstream users (currently it still is required for Nickel, but that is on them). Related #613.
Also caught a typo.
Small refactors:
inputs
as an attrset to more easily track dependencies (allows removing*-input
from one of the inputs)nixpkgs
,topiaryPkgs
,binPkgs
self.packages
where possiblechecksLight
for all systemsNormally removing
flake-utils
the diff results in less line of code, but refactors added a little bit.Note: reviewing without whitespace changes makes this easier to review (nesting level changed)
1
Footnotes
Please consider giving up MS GitHub or offering a non-proprietary, non-US-corporate-controlled mirror for this free software project. I wish to delete this Microsoft account in the future, but I need more projects like this to support alternative methods to send patches & contribute. ↩