fetchFrom{Forgejo,Codeberg}: init, treewide: fetchFromGitea -> fetchFromCodeberg, docs#483216
fetchFrom{Forgejo,Codeberg}: init, treewide: fetchFromGitea -> fetchFromCodeberg, docs#483216gepbird merged 4 commits intoNixOS:masterfrom
Conversation
|
|
Yes, logically this should be a zero-rebuild. The main review concern here is whether the implementation for |
There was a problem hiding this comment.
Thanks!
I like this approach, the first time I encountered a codeberg source I was surprised there's no fetcher for it despite the platform being quite popular. It also feels weird to write fetchFromGitea for forgejo sources.
Grepped for domain = "codeberg.org", can you also migrate these to fetchFromCodeberg? I think a new commit would be preferable:
- pkgs/by-name/xr/xrsh/package.nix
- pkgs/applications/networking/browsers/librewolf/src.nix
- pkgs/by-name/go/gotosocial/package.nix
- pkgs/by-name/ka/katawa-shoujo-re-engineered/package.nix
In your last commit, what is the reason for the second sed call, shouldn't the first one catch trivial instances? I wonder if it can introduce other issues: what if a package has a codeberg source AND non-codeberg gitea source (e.g. a subpackage in the same file)?
for i in (rg 'fetchFromGitea \{\n *domain = "codeberg.org";' --multiline --files-with-matches)
sed -z 's/fetchFromGitea {\n *domain = "codeberg.org";/fetchFromCodeberg {/g' $i > $i.tmp && mv $i.tmp $i
sed -i 's/fetchFromGitea/fetchFromCodeberg/g' $i
end(Slightly related: in another PR programs.forgejo-actions-runnermodule would be nice that acts as programs.gitea-actions-runner with programs.gitea-actions-runner.package = pkgs.forgejo-runner, what do you think?)
It's 'fetchFromGitea', with the domain already set. Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
Simple alias, as Gitea's fetcher is compatible with Forgejo. Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
…o and fetchFromCodeberg Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
Most packages that used fetchFromGitea fetch their sources from Codeberg, so might as well migrate them.
The following command was used for this treewide:
```fish
for i in (rg 'fetchFromGitea \{\n *domain = "codeberg.org";' --multiline --files-with-matches)
sed -z 's/fetchFromGitea {\n *domain = "codeberg.org";/fetchFromCodeberg {/g' $i > $i.tmp && mv $i.tmp $i
sed -i 's/fetchFromGitea/fetchFromCodeberg/g' $i
end
```
The following paths were manually edited:
* pkgs/by-name/xr/xrsh/package.nix
* pkgs/applications/networking/browsers/librewolf/src.nix
* pkgs/by-name/go/gotosocial/package.nix
* pkgs/by-name/ka/katawa-shoujo-re-engineered/package.nix
Co-authored-by: Gutyina Gergő <gutyina.gergo.2@gmail.com>
Signed-off-by: Fernando Rodrigues <alpha@sigmasquadron.net>
05ec691 to
3562403
Compare
|
Thanks for the review! The individual comments were addressed, and the treewide was updated.
I've updated the treewide commit, since it had a conflict and adding these wouldn't be too much of a hassle.
The reason is, as usual, because I'm bad at programming. I know I could probably have done it in a nicer way, but I couldn't be bothered for such a quick task.
Eval should catch edge cases like that, but I don't think we have any.
I think it's a wonderful idea, and probably reasonably easy to implement given that options don't store their original path in their attributes. I'll attempt this in another PR. |
gepbird
left a comment
There was a problem hiding this comment.
In your last commit, what is the reason for the second sed call, shouldn't the first one catch trivial instances?
The reason is, as usual, because I'm bad at programming. I know I could probably have done it in a nicer way, but I couldn't be bothered for such a quick task.
Now I realized: you wanted to replace the import at the top, in this case including the comma is safer:
sed -i 's/fetchFromGitea,/fetchFromCodeberg,/g' $iI wonder if it can introduce other issues: what if a package has a codeberg source AND non-codeberg gitea source (e.g. a subpackage in the same file)?
Eval should catch edge cases like that, but I don't think we have any.
I can never be too sure about that when working with FODs, just in case I quickly scrolled through the treewide.
There was a file with 2 gitea sources, but both was hosted on codeberg. Overall no issues in the diff!
|
|
Are there any plans to backports this to make other backports easier and with fewer conflicts? |
|
Backport failed for Please cherry-pick the changes locally and resolve any conflicts. git fetch origin release-25.11
git worktree add -d .worktree/backport-483216-to-release-25.11 origin/release-25.11
cd .worktree/backport-483216-to-release-25.11
git switch --create backport-483216-to-release-25.11
git cherry-pick -x dcc52f0124398d37e1c10c5778dcbfa6ac3433dc adf7a4850b7d89c0658bdae2daff9680832680a7 a1c9639328fb90f894a726d6bca0896fab878b36 3562403503f705f700bcbd9b1c1bae1c6641f519 |
|
Doing a manual backport as soon as I finish up with a package update |
Closes #482855
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.