-
-
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
[WIP] sage: use proper overlays #43755
Conversation
IMO we'd just continue using packageOverrides in this case. Re-importing nixpkgs is very ugly, and all the user overlays will be lost inside of the reimport, not to mention system and configuration settings. |
In this case, what is needed is a new scope. All the sub package sets use this as well, see e.g. Qt5:
In order to make it possible to modify some of the Sage-specific overrides, one could offer this package set and allow a |
Yeah that's what I feared. I wish it was as easy as it is with the python package set.
Can you help me with that? Unfortunately it seems like that isn't documented anywhere. I would need a scope that has all of the regular nixpkgs, but with some overrides. All the scopes I'm aware of only have new packages, not the rest of nixpkgs.
That's probably overkill. At best there shouldn't be any sage specific overrides at all, whenever possible I try to backport compatibility patches instead. |
The |
Might as well finish it as well: Please test. |
Thanks! Thats a lot to read through, I'll do that and test it tomorrow. |
Unfortunately that does break the build:
I'll figure out the details when I have more time. Regarding the changes in general:
What does that do? I know what
Will this show up in search results? |
I think there is something not OK with the
Create a new package set that extends
Take our "overlay" of modifications and extend our new package set with it:
Extend once more with
|
No, we don't recurse into that attribute set so it won't show up in say |
The issue is that |
This should do the trick, although I'm not sure whether that can go in as I expect it to take up some memory. |
Thanks for your explanation. The comments in
That's perfect.
Okay, lets wait for @peti's answer. That still doesn't quite build, but thats a different problem. We have to explicitly pass the nixpkgs version of pynac to sagelib again to keep it from using the python version. Then it works (without any rebuild even, proving that it is equivalent to my re-import overlay solution). Should those overlaps in namespaces be considered an issue and fixed? They lead to pretty subtle bugs... Also apart from the "overlay" changes I see that you're splitting the python and non-python parts further apart. For example moving python package to its own file (making it necessary to Are there reasons for this? Wouldn't it be nicer to treat python pkgs and "regular" pkgs as uniformly as possible? |
Also if |
They're annoying, but package names eventually will overlap. That's one reason why we use namespaces.
Python libraries belong in the Python package set. That way we're also preventing possible naming collisions.
We are using the same mechanism: the package set we've defined here is exactly the same. The issue is that we need to re-evaluate the main package set. In order to do that, we need to access it, and there's two ways: the method you originally proposed, and attaching it to the evaluated package set as |
> Should those overlaps in namespaces be considered an issue and fixed? They lead to pretty subtle bugs...
They're annoying, but package names eventually will overlap. That's one reason why we use namespaces.
That's true. Maybe the python (and similar) infrastructure's `callPackage` should refuse to pick a package if there are multiple options and force the user to specify one explicitly. No idea if that's technically feasible though.
> Are there reasons for this? Wouldn't it be nicer to treat python pkgs and "regular" pkgs as uniformly as possible?
Python libraries belong in the Python package set. That way we're also preventing possible naming collisions.
But the name collision still happened this way. Probably I'm just idealizing in my thinking that implementation language should be an implementation detail :)
> Also if `fix -> fix'` isn't acceptable, can't we use the same mechanism overlays use to make it possible to do deep overrides from within nixpkgs? Its not a unique sage problem, sage just needs it at a bigger scale than most packages. `pythonPackages` offers it, why not `nixpkgs`?
We are using the same mechanism: the package set we've defined here is exactly the same. The issue is that we need to re-evaluate the main package set. In order to do that, we need to access it, and there's two ways: the method you originally proposed, and attaching it to the evaluated package set as `__unfix__` with `fix'`.
That makes sense, I didn't consider that the original proposal just "fixed" this issue by re-importing.
|
Are there any updates on this pull request, please? |
Still blocked on something like #44196. |
Thank you for your contributions.
|
I marked this as stale due to inactivity. → More info |
@collares It would be great to put some effort into this if you'd like to keep it open. It hasn't been touched in five years, was marked draft four years ago, has merge conflicts, and the PR linked above as a dependency was never accepted. Just keeping it open in its current state provides zero value. |
Fine by me in this particular instance, since I can reopen it if I find time in the future to work on this refactoring. That being said, I don't think it's useful in general to close still-relevant issues/draft PRs even if they're "old", since the main thing this accomplishes is discarding progress/experience other people have gathered in the past, which future people may use in solving the problem. I don't think the prerequisite PR was rejected in any meaningful way; it just stalled and was closed for the same reason this PR is being closed, whatever that is (Keeping the number of open PRs low, I assume? Draft PRs should be easily filterable from queries, so tha's the only reason I can think of). I hope the CADT model doesn't become Nixpkgs standard policy. |
The PR content is maintained just as well in the closed state on github. Nothing is lost. WIP and Draft indicate someone is actively working on this issue, but that's clearly not the case, so I argue Closed is a much better indicator of the state of this PR. Future people will still be able to see it just the same. Though at this point this PR seems much closer to never being done than getting merged. I'm not sure what the CADT model is, so I can't comment on that. |
That's fair. The discoverability aspect for closed PRs is a problem, so I filed issue #340754 as a compromise. |
An issue is a great idea. To be clear, I fully encourage someone to work on this if it's a real problem. As Anderson said when closing the other PR, it likely benefits to be done from scratch anyway.
Out of curiosity, why do you find this the case? How is a draft more discoverable? |
Default filter includes drafts, excludes closed PRs (merged or not), and usually leaves a mostly acceptable number of PRs to skim. |
Motivation for this change
Sage has lots of dependencies and integrates tightly with them. Some of them have to be (temporarily) pinned at older versions. Currently that is done by simply using
<pkg>.override
. But since there are so many dependencies, they are likely to depend on each other. That makes it necessary to "wire them up" using lots ofinherit
's (as seen in #43679).Since
packageOverrides
was deprecated, I'm unsure how to solve this. Here I use the variant mentioned in the manual, but not used anywhere in nixpkgs (yet). That re-imports nixpkgs however:Is this a terrible idea? Will this lead to even more memory consumption? Will this ignore all previous user-defined overlays? Is there a better way?
@grahamc @matthewbauer @7c6f434c @FRidh
Other than the change from simple
.override
to overlays nothing has changed. So there is no need to review the details here (although you're of course free to do so).Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)