-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Avoid top-level with ...;
in pkgs/development/lisp*
#299241
base: master
Are you sure you want to change the base?
Avoid top-level with ...;
in pkgs/development/lisp*
#299241
Conversation
435f217
to
0589480
Compare
…/openssl-lib-marked.nix
0589480
to
60ebb1a
Compare
|
||
# FIXME: automatically add nativeLibs based on conditions signalled | ||
|
||
# Try to keep this list sorted | ||
extras = { | ||
cffi-libffi = pkg: { | ||
nativeBuildInputs = [ libffi ]; | ||
nativeLibs = [ libffi ]; | ||
nativeBuildInputs = [ pkgs.libffi ]; |
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.
Hm, I'd have done extras = with pkgs; {
instead. Not sure this is worth the diff, as it's also adding noise now.
nativeBuildInputs = [ pkgs.libdevil ]; | ||
nativeLibs = [ pkgs.libdevil ]; |
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.
These lines are doing pkgs.
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 thing I was going for in the PR (which was hand-crafted instead of tool-assisted) was uniformity, and in this case following the convention of roughly half this file.
I'd rather have one way or the other, not some mishmash.
cl-readline = pkg: { | ||
nativeLibs = [ pkgs.readline ]; |
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.
More pkgs.
builtQlpkgs = lib.mapAttrs (n: v: build v) qlpkgs; | ||
|
||
build = pkg: | ||
let | ||
builtPkg = build-asdf-system pkg; | ||
withExtras = pkg // | ||
(optionalAttrs | ||
(hasAttr pkg.pname extras) | ||
(lib.optionalAttrs | ||
(lib.hasAttr pkg.pname extras) |
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.
Here's the added lib.
to see how it feels (vs. the tool-assisted extraction present in other PRs.)
I get that. I mean, you're doing a refactor, and I appreciate you're doing it conservatively, but in this case we could as well make an opinionated choice - the original motivation was increasing clarity and readability. And again, I think judicious use of |
I'm sorry, I find a The only place I find You can see evidence of that confusion when code authors introduce smaller with scopes that were already covered by some larger one. The other possible use of |
Yeah, fair. |
Description of changes
Using
with
at a top-level scope is an anti-pattern. The tracking issue is #208242. This is a pure refactor: there is no functional change contained in this PR.I tried out the other strategy of replacing top-level with in this PR. If symbol
foo
was pulled implicitly from attrsetpkgs
, I replacedfoo
withpkgs.foo
. Prior to this change, this file was a mix of both styles (foo
andpkgs.foo
), and now it's just one.There are no rebuilds when I run
nixpkgs-review rev HEAD
, so I've targeted master with this PR.Things done
nixpkgs-review rev HEAD
.