-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
treewide: migrate fetchgit rev = "refs/tags/..."
to tag
#368177
Conversation
In a separate PR/thread, @Atemu highlighted that relying on |
This PR only migrates |
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.
If having the commits separate is easier to handle for you that's fine but I'd prefer one treewide commit in the end and GH struggles quite a lot once you're past a dozen commits or so.
Could you commit the script itself to nixpkgs too for future reference? The code itself will be dead right after this PR because there should be no instances left but parts of this could be re-used for similar refactors. I don't know if there's a collection point for these but if there isn't, there should be one. I think there was an issue about reproducible treewides already.
I've had a look at it generally LGTM apart from depending on src.tag
as @GaetanLepage mentioned.
It doesn't look like there's too many instances but the correct/better thing to do is to just depend on ${version}
or define a new tag
reference to use in both places.
# test if src build, this check the FOD hash # not needed since the drvPath is unchanged #if ! nix-build . -A "$attrpath".src --check ; then # >&2 echo "src doesn't build" # git diff | delta --paging=never # (set -x; git restore "$fname") # continue #fi
Why is this not needed? Doesn't a FOD only detectably change if name or hash are changed?
If src is overridden to use a
rev
then the url would be incorrect anyway
It'd be incorrect but at least eval. Missing attr errors are impossible to catch IIRC which makes them super annoying to deal with.
👍
I'm tracking a lot of the migration scripts i've written in #346453 and plan to put this one there as well if it gets merged. I don't consider this script rigorous enough to commit to
This change is essentially undoing #338301 in favor of If we want to migrate away from
What i've learned from https://noogle.dev/f/pkgs/invalidateFetcherByDrvHash is that even if the
Would a migration to something like |
e85d94a
to
7710171
Compare
I don't think so. That strikes me as overly defensive and over the top. I'd advocate to just use the same value that is put in |
Commit title suggestion:
|
It struck me while I was out of coverage that the YAGNI approach is scriptable. The script in the OP is updated |
7710171
to
ee84845
Compare
rev = "refs/tags/..."
to tag
A new concern just struck me: the |
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 looked at all the changes so far; I haven't checked to see if there are no finalAttrs.src
that were in the files changed yet.
No, I don't think so. The change will go from master to staging once, and it'll be obvious to a human what to do. |
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've had a glance at the modified files and it generally LGTM.
Given that CI doesn't complain about any meta issues and that the script verifies that FODs have not have changed in any way, I'd say we're good to go.
To ease backports, could you run the script/do your manual fixups on stable too?
24.11-only would be fine given that 24.05 will be EOL in a few days. I'd like a week of delay though in the off chance we do find anything anything wrong with this which should be a good trade-off w.r.t. breaking backports for the affected packages vs. seeing issues crop up.
I'm going to ask in the staging matrix channel on how they'd like to have this treewide handled as it does have potential for at least a handful of conflicts.
I added an extra check and ran it over all of nixpkgs overnight resulting in additional 4191 files affected. Should we fragment it over multiple PRs or make this one a mega PR an try to race the merge conflict? |
I personally think that, if it's coordinated, it's best to have one large PR. If this is fine for the staging folks and CI passes, we can merge immediately as far as I'm concerned. |
I think this is right too.
cc @vcunat @infinisil @K900 would you be fine with a big one-shot PR ? |
This should enable even more migrations using this script |
To be clear, from perspective of |
I ran the revised script overnight (added to OP), which now also ensures that only one line matches I'll let this sit here until at least 00:00 UTC+1, fix conflicts, push, wait for eval, and self-merge. |
It really is. I think a merge to staging-next (and then that into staging) would be the appropriate action, not cherry-pick. Master is merged that way periodically anyways. |
You should perhaps also check whether staging-next/staging contain any new references and fix those up. |
a local merge from master to staging-next was conflict free, should i leave it to the automation? |
Sure, why not. Is the same true for staging? |
No, 25 conflicting files. should i merge from master or cherry-pick? I've yet to learn how conflicts between these branches are usually resolved. |
I've read through the documentation a couple of times, and i think a manual |
Yes, master -> staging-next -> staging. |
huh, perfect timing https://github.com/NixOS/nixpkgs/actions/runs/12605651116 |
Have you checked for any remaining instances of This also needs to be backported to 24.11 to make backports apply cleanly. As mentioned previously though, I think we should wait a few days~a week to see whether any potential issues crop up. |
I assume more will pop up over time, so a couple of repeats would make sense. They will luckily be nowhere near the same scale
👍 |
0cd04d3 "treewide: migrate fetchgit
( |
Proposed |
@pbsds Could we backport to 24.11 now. It really breaks a lot of backport. |
This broke a bunch of packages, that were quietly fixed, so I'm not super confident that a backport will be including all those fixes. |
I tried cherrypicking the treewide, but 1000+ conflicts made me instead resort to running the script again, it's going to take a while. I adapted the script to only migrate the ones that now use |
This is a automated migration from
rev = "refs/tags/..."
totag = ...
added in #355973.I based the script below on #336172 which checks that the derivations are unchanged.
This PR commit-spams to simplify rebasing, squash-merge it if you dislike this.Done with:
i ran it for a while then terminated it. I want more eyes on the script before we commit to a mega PR. should be 0 rebuilds
Should we address #367739 before going forward with this?
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.