-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
lisp-modules-new: strip any unrelated defsystem from the .asd #196818
Conversation
1acda4a
to
94ce5ac
Compare
PS is master the right base branch for this? |
94ce5ac
to
c140b43
Compare
Strip any (asdf:defsystem .. that is not for the specific system we want to build. Fixes at least cl-async, which has a .asd with multiple defsystems, which causes problems as the wrong (non-precompiled) package is loaded at build time, which then tries to compile after the fact, putting a .fasl in a read-only location (the store), breaking the system.
c140b43
to
0e22aee
Compare
I am not good enough at AWK… does it check for slashy-ness? Also, we still need to build some of the slashy systems then? (Probably not all because of tests with too many deps?) |
Upon further reflection I realize I was so focused on fixing this bug, I didn't stop to think about why it exists in the first place. The real question is why are these packages imported top-level? |
Upon further reflection I realize I was so focused on fixing this bug, I didn't stop to think about why it exists in the first place. The real question is why are these packages imported top-level?
Well, why wouldn't a rev-dep do that, I guess?…
|
I'm not familiar with how the graph is construced, but when I look at the quicklisp package dump "http://beta.quicklisp.org/dist/quicklisp/2022-07-08/releases.txt" I see the following entries for
The It seems like we're fighting quicklisp and the individual packages by delving into their internal package structure and managing it with nix, too. I understand the dependency tracking, but maybe we should only expose top-level packages which are importable by quicklisp, too? I suspect nobody actually wants to import those internal packages in actual code, and they're only here to follow the (internal) dependency chain? I wonder if this might be the source of our worries with mucking about with the .asd files, too (the renaming etc). E.g., this very module we're commenting on, But this is all conjecture, I'd be very curious to learn from the original author. |
For context, here are the
In this PR I work around a problem this introduces, but before we merge it I'd say the real question is why do we do this? |
In this PR I work around a problem this introduces, but before we merge it I'd say the real question is why do we do this?
1. Upstream Quicklisp system index does this.
2. Sometimes these additional systems are needed.
3. Sometimes they are actively not needed because they have too many extra deps, e.g. some tests.
3.1. Yes, there are some cyclical depednencies between ASD _files_ even though not between ASDF systems.
|
I understand the tracking (maybe), and you're right I see that in QL, too:
But QL makes a distinction between systems it tracks, and systems you can include top-level:
This seems like a sensible choice, given that More poignantly, the problem that this PR addresses, is precisely because of Why do we need to expose those individual packages, unlike QL? Instead of offering one single top-level nix package per QL package ( I imagine it would obviate the need for this PR, and maybe even all that .asd-file rewriting code that currently lives atop @Uthar might have more thoughts on this |
Sorry my brain is already fixed on how I wrote it, it's hard to see another way after that. Maybe someone from outside can review. |
That's totally fair. I'll dig in and see what I can find, and come back to you with more specific questions or ideas once I have a better grasp of the system. 👍 |
This patch is obsolete with the new lispmodules merge, right? I haven't followed the implementation in a while. I've also created my own exploration of this in "https://github.com/hraban/cl-nix-lite" which attacks the problem from a different angle. |
Yes, recently a major rewrite of lisp modules was merged. But there are still such files with "unused" system definitions. Even though that is the case, they load fine. I guess it would be cool to remove them, but is not strictly necessary. I remember I attempted it with regexps, but it turned out too brittle. I also know almost nothing about AWK. Thanks for the link! |
Description of changes
Strip any
(asdf:defsystem ..
that is not for the specific system we want to build. Fixes at leastcl-async
, which has a .asd with multiple defsystems, which causes problems as the wrong (non-precompiled) package is loaded at build time, which then tries to compile after the fact, putting a .fasl in a read-only location (the store), breaking the system.See #155851 (comment)
Things done
I WOULD LOVE A SECOND PAIR OF EYES ON THIS! Please sanity check this! I am worried it might have false positives.
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/
)nixos/doc/manual/md-to-db.sh
to update generated release notes