-
Notifications
You must be signed in to change notification settings - Fork 84
Add support for updating dotnet packages #320
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
Conversation
|
Afaik we added the |
|
Given that updating the deps file is a required step for updating the dotnet packages, I think it's bad UX to lock a required step behind a flag. It should do that unconditionally since it's part of the update process and doesn't produce a working package without it. |
a5278fd to
58603e3
Compare
|
Everything looks good to me now, thanks for this! |
|
@mergify queue |
☑️ The pull request will automatically be requeuedMerge queue reset: an external action moved the base branch head to 7bf6549 |
|
What's going to happen to packages that already fetch deps in their update scripts? Will it do it twice? It's extremely expensive for some packages. |
This would only happen to packages that call |
|
Yes. It's either a custom update script or this. Not both. |
|
I believe (as @GGG-KILLER mentioned) there are some packages with update scripts that call nix-update and then call I'm not sure I like the idea of having this run unconditionally in |
|
The objective of |
I don't see why packages should be discouraged from calling
This change causes We already have
|
Good catch! We should replace those update scripts with just
It already makes assumptions for
I don't mind changing |
Users themselves already need to be aware of them to update their own packages. Having
I'd argue that |
We have a way to combine update scripts, for example here: https://github.com/NixOS/nixpkgs/blob/c2699e091cf348ff848132d2f278713b5990aeb7/pkgs/by-name/fa/famistudio/package.nix#L155-L158. But given that it's called experimental and not documented (outside of its source file), we should consider other solutions first. And just calling |
They don't need to know about
This is exactly what I was imagining
You'd still specify
I think this would be better than using I'd still personally rather do composition in nixpkgs. Take a look at https://github.com/NixOS/nixpkgs/blob/master/pkgs/by-name/av/avalonia/update.bash. It does:
If |
Every contributor who wants to make a dotnet package in nixpkgs needs to know about the existance of
Yes, because to update the majority of dotnet packages, you'd need to call
For complex packages like I can't emphasize this enough, but |
I was thinking of
I'm not familiar with I would still like to have
Thanks. I actually fixed this one recently, but I've been meaning to figure out how to track failed updates. |
It only updates the
Can you explain the reason for this and
Go on either https://nixpkgs-update-logs.nix-community.org/ or https://r.ryantm.com/log/ (the trailing slash is important as it doesn't have a redirect), then select a package and an update attempt. https://nix-community.org/update-bot/ has some interesting docs and a queue, so you can estimate how much you need to wait until your package gets an update attempt :) |
Yeah, I'd like |
Thanks for clarifying! I consider
That would break (or at least run the A rare edge case would be a package similar to Let's suppose this "wrapping the update script with a package ecosystem's The only benefit I see currently is a easier maintenance, because the update applying code would live in the same This would introduce some inconsistencies (at least at the beginning): most packages are updated from Overall I'm either still misunderstanding/missing something fundamental, or this sounds doesn't sound like a good idea. I prefer keeping the update running code in |
This is mostly true, but it's still occasionally useful to call it directly. It can pull in updates for dependencies in some cases, or the results can change after a dependency change (e.g. sdk/runtime update).
Yeah, it would have to either be something like this, or done with overrides on the output of
This is essentially why I'd rather not have
This is a legit problem if we want to support updating packages without
To me this is the only practical problem we have right now (avalonia). It could be solved by:
|
I feel like magically adding
If we only have an issue with a single package then there's no issue, it should just be fixed to not use |
|
There are loads of custom update scripts that call Avalonia is the one that's going to be broken, but there are others that will fetch deps twice. |
I was going to try this, but I misunderstood what
|
If you need to get the latest version number and update the source version and hash, you can use something like this: It's a little longer than just calling I can't say it enough times, but |
|
The part of
The readme just says:
It's nice that it can do certain other helpful things, but right now I'm stuck if I just want it to do that without also running It's useful enough in update scripts that it's used in at least all of these: I do think it's a bit confusing that
You'd never want to use the 'high level' interface recursively. So maybe it should be two different tools? In any case, I appreciate having a tool that can "updates versions/source hashes of nix packages" without me having to worry about whether it comes from github, gitlab, or something else. For now I'll have to duplicate that logic in avalonia, and I think that's a shame. |
|
Do you have more examples beyond this a single package that might not work with nix-update? Nix-update is not a magic bullet. There might be always situations where it breaks, i.e the version replacement algorithm is just a stupid heuristic. Also to me it sounds like the workaround will be just slower in this case compared to the optimal solution. |
I haven't found anything else that's actually broken, but most of the dotnet packages will now run @Mic92 what are your thoughts on all those update scripts above that call vs I don't want to abuse nix-update for something it wasn't intended to do, but it seems valuable for packages not to have to worry about the details of fetching the latest version (especially for github). If you'd rather |
When bumping
I agree that writing low level curl commands to the github API is not the nicest, and there could be a tool to abstract that, but I don't think that tool should be To make everyone happy, we could add the |
This is a good idea. All of them except avalonia look trivial, and a bunch of them make the mistake of calling
An alternative to this could be to generalise the attribute (as discussed above) into something like I could also just remove |
|
I'm not too fond of the What about generalizing
I think it's good that it provides a |
I'd be happy with that behaviour. Maybe using
I would see this as an opportunity to use |
|
@Mic92 what is your opinion on adding a new flag, perhaps called |
There are ~100 dotnet packages in nixpkgs, some of them can't be automatically updated, while others have a hacked together update scripts with potential issues that nix-update could already take care of, let's change that!
This PR makes it possible to also run the nuget fetch-deps script using the following snippet in a package with
buildDotnetModule:I wasn't sure about putting this feature behind theThis feature being locked behind--generate-lockfileflag, as most contributors will probably trynix-update-script { }, which won't update thedeps.jsonfile. OTOH, this options is more appropriate for nix-update, as it technically generates a lockfile (but not in the same sense as it generates npm or cargo lockfiles). We should mention this flag in the dotnet docs to make it clear for contributors. I'm curious about your opinions on this, should it work without--generate-lockfile?--generate-lockfilewas scrapped, it will work without extra arguments.I did some extra testing outside of nix-update: on https://github.com/gepbird/nixpkgs/tree/nix-update-dotnet-test, I updated 3 packages (osu-lazer, opentabletdriver, celeste64) and made sure they still build.
Documentation on how to update nuget dependencies: https://github.com/NixOS/nixpkgs/blob/b0a6b4fe4aa08c883fecb4b06d8d9a32e91f370c/doc/languages-frameworks/dotnet.section.md#generating-and-updating-nuget-dependencies-generating-and-updating-nuget-dependencies
cc @anpin @corngood @GGG-KILLER @JamieMagee from the dotnet team