Talk:Writing go Ebuilds

From Gentoo Wiki
Jump to:navigation Jump to:search
Note
Before creating a discussion or leaving a comment, please read about using talk pages. To create a new discussion, click here. Comments on an existing discussion should be signed using ~~~~:
A comment [[User:Larry|Larry]] 13:52, 13 May 2024 (UTC)
: A reply [[User:Sally|Sally]] 23:51, 28 February 2025 (UTC)
:: Your reply ~~~~

Example for vendoring dependency tarballs as GitLab CI pipeline

Talk status
This discussion is done as of 2022-09-07.

I have created a simple GitLab CI pipeline which builds dependency tarballs and provides them in the GitLab package registry. Maybe this is something you might want to link as an example of hosting a dependency tarballs, since it also provides transparency on how the tarballs are created: https://gitlab.fem-net.de/gentoo/fem-overlay-vendored -- Nex (talk) 18:28, 5 September 2022 (UTC)

Thanks, added it. Feel free to edit it yourself, even if it is in my User namespace. 😉 Tastytea (talk) 00:00, 7 September 2022 (UTC)
Afaik, editing someone else's User pages is discouraged if the author doesn't state otherwise. -- Nex (talk)
I've moved my GitLab example to a third bullet point, since it uses a different technique (package registries) for providing the dependency tarballs instead of creating fake releases. -- Nex (talk) 07:09, 7 September 2022 (UTC)

"Ebuilds using the go-module eclass are different from most other ebuilds, because they have to include every go dependency"

Any plans to change that? If not - please clarify - why. I think eclass could fetch dependencies? Vitaly-zdanevich (talk) 05:34, 27 February 2025 (UTC)

No, it is not feasible to change this. We need to support entirely offline builds, and there was opposition to the (now deprecated) `EGO_SUM` variable which would fetch Golang dependencies to store them them on Gentoo mirrors and include each in the package manifest. Instead consumers are to create a dependency tarball, or (ideally) work with upstream to either have them generate the above or properly vendor their go modules. Kangie (talk) 04:33, 28 February 2025 (UTC)
But I do not understand - why Portage cannot fetch dependencies like DISTFILEs? Vitaly-zdanevich (talk) 11:29, 28 February 2025 (UTC)
It is possible but there were issues with the approach, particularly around the size of manifests and manifest diffs for go-module ebuilds. Thie wiring is still there, read the eclass for more information. If you're using it outside the main Gentoo tree (or GURU), feel free to use EGO_SUM. the eclass Kangie (talk) 13:16, 28 February 2025 (UTC)
> particularly around the size of manifests
But dependencies already specified in go.mod Vitaly-zdanevich (talk) 15:34, 28 February 2025 (UTC)
You have written ebuilds before. You know how this works and that there's no network access permitted during the build process. Why do you think go.mod has anything to do with how Portage needs to record files that need to be fetched? Kangie (talk) 23:51, 28 February 2025 (UTC)