mkosi icon indicating copy to clipboard operation
mkosi copied to clipboard

Add support for Gentoo

Open unforgivablesin opened this issue 11 months ago • 15 comments

I would like to see Gentoo on the supported list. Is there any progress towards this goal?

unforgivablesin avatar Jan 05 '25 13:01 unforgivablesin

Not that I am aware of. It once has experimental support but that got dropped a year ago because it was broken for a while and there was no one maintaining it, see 7906f1b9e7aedc8b23e05135b826d238edf8d338. I think their package tool was doing something weird when installing into a custom root directory which always required some workarounds and special casing and was no longer compatible with the way mkosi does things currently.

septatrix avatar Jan 05 '25 14:01 septatrix

Is there any plans to support it? I really want to use mkosi with Gentoo.

unforgivablesin avatar Jan 05 '25 14:01 unforgivablesin

The current problems were listed in #1764 which would need to be resolved. IIRC some of those require new features in portage - I think there was a link to an issue in their tracker/forum once but cannot find it right now. As long as those limitations still exist it is unlikely that support will be added.

~PS: I noticed that Gentoo is still listed in the man page as supported. That should be removed.~ This was just about it being packaged for Gentoo, not support for Gentoo as the target/guest distro

septatrix avatar Jan 05 '25 14:01 septatrix

Not sure where it was linked but it was still in my browser history: https://bugs.gentoo.org/921580

septatrix avatar Jan 05 '25 14:01 septatrix

As @septatrix already mentioned, work needs to happen in portage to make this possible. Even then, the gentoo package model is not really compatible with mkosi's design, so I don't expect that using gentoo with mkosi would ever be a pleasant experience.

DaanDeMeyer avatar Jan 05 '25 19:01 DaanDeMeyer

@DannDeMeyer What about going full-bore and doing a stage1 install? Or interfacing mkosi with Catalyst for Gentoo?

td5038 avatar Apr 10 '25 23:04 td5038

Gentoo is source-based, so you might have to embrace building everything from source for it. Plus, if you decide to throw out using the PackageManager class for using Portage, you could even adjust a few settings to have Portage build stuff directly from version control for you. Yes. It can automagically fetch things from Git and build them. And tracks all of the dependencies for it. Including the other VCS dependencies.

td5038 avatar Apr 10 '25 23:04 td5038

Gentoo is source-based, so you might have to embrace building everything from source for it. Plus, if you decide to throw out using the PackageManager class for using Portage, you could even adjust a few settings to have Portage build stuff directly from version control for you. Yes. It can automagically fetch things from Git and build them. And tracks all of the dependencies for it. Including the other VCS dependencies.

I don't mean to discourage you, but in my opinion, perhaps we need to consider two points first:

  1. Is Portage (and Catalyst) widely packaged in other distributions where mkosi typically runs (like Fedora, Debian, Ubuntu, etc.)? If not, using mkosi for building Gentoo could become quite challenging, especially if you'd need to build these backend tools from source first.
  2. Is the significant effort required to modify the codebase really worthy for adding support for one specific, source-based distribution like Gentoo?

MoltenArmor avatar Apr 14 '25 04:04 MoltenArmor

The only way Gentoo or any distribution can be supported are:

  • somebody steps up to add the code and maintain it
  • the distribution installation must work in a manner compatible with mkosi, i.e. the package manager must be able to operate on a root from the outside
  • the code path for the distribution can be tested in CI

From these three points follow several corollaries:

  • when CI breaks it is fixed in a timely manner (1 and 3)
  • the distribution has some binary caching, since building everything from source is most likely out of the question in CI (3)

If there is no CI, stuff breaks and it won't be noticed and then the distro will be removed, which is sad, therefore the higher bar for inclusion.

If you want to use mkosi with Gentoo, try bootstrapping into a directory and then use the none distribution.

behrmann avatar Apr 14 '25 09:04 behrmann

Hey, wait a minute. I realized something. Gentoo Portage is inspired by the BSD ports system, so the packaging work done for regular Linux package managers won't even work for Portage.

td5038 avatar Sep 04 '25 17:09 td5038

Portage is literally in PyPI. All you have to do to fetch it is use pip and venvs.

td5038 avatar Sep 18 '25 16:09 td5038

Portage is literally in PyPI. All you have to do to fetch it is use pip and venvs.

That is the least problem. Refer to behrmann's comment above for the more critical parts to which there is currently solution in sight

septatrix avatar Sep 18 '25 16:09 septatrix

As @septatrix already mentioned, work needs to happen in portage to make this possible. Even then, the gentoo package model is not really compatible with mkosi's design, so I don't expect that using gentoo with mkosi would ever be a pleasant experience.

@DaanDeMeyer ,could you take a look at the recently fixed bug https://bugs.gentoo.org/953449 ? Maybe this will be enough for normal operation with mkosi?

alexminder avatar Sep 19 '25 14:09 alexminder

As @septatrix already mentioned, work needs to happen in portage to make this possible. Even then, the gentoo package model is not really compatible with mkosi's design, so I don't expect that using gentoo with mkosi would ever be a pleasant experience.

@DaanDeMeyer ,could you take a look at the recently fixed bug https://bugs.gentoo.org/953449 ? Maybe this will be enough for normal operation with mkosi?

Not at all we need https://bugs.gentoo.org/show_bug.cgi?id=921580 fixed for starters before there's even the slightest possibility of making this work.

DaanDeMeyer avatar Sep 19 '25 20:09 DaanDeMeyer

I suggest we embrace ports and translate everything to work with ports-style packaging.

td5038 avatar Oct 01 '25 19:10 td5038