Re: /usr/src and /usr/ports not git directories ?

From: Daniel Kalchev <daniel_at_digsys.bg>
Date: Thu, 23 Jan 2025 07:10:47 UTC
> На 23.01.2025 г., в 5:38, Florian Walpen <dev@submerge.ch> написа:
> 
> The remedy is clearly to build kernel module packages for every minor release,
> and there has been an attempt to do this recently, through a separate pkg repo
> I think.

Either that, or do the kernel module compilation locally. For this you need the matching kernel source, which is there for binary updated systems (via freebsd-update). You only need the matching ports three or to ship the ports sources as part of the package itself, which might get ugly if there are lots of dependencies. But in any case, a source tree matching the kernel is required. 


> My take is that
> installing the src tree is optional, giving a hint in the installer should be
> enough. There will be secondary steps anyway in this scenario, like installing
> the git executable and updating the src tree. As stated, we could simplify the
> post-install repo cloning through a Makefile.

I would say FreeBSD should always ship with its source code - this has been a major feature. It can be life saver if you get offline as all the necessary tools to rebuild are already there.
We should not “over-git” stuff, especially as the git tool is not part of the build!

Whether the shipped tree should be git ready… I can’t make my mind yet. Maybe it will be useful. For example, when things get messed up with binary updates, I usually pull a “fresh” releng arc tree, recompile and reinstall and I am in a good “binary” state to continue using the binary updates on that host. If the src tree already has git attributes, it would be just a matter of selecting the branch. Less time waiting and less load on servers.

> 
> What is more questionable in my POV is to provide a by then outdated ports
> tree. It needs network access anyway, and is an invitation to security issues.
> Better simplify repo cloning through a Makefile, post-install, no dependency on
> git in the installer. Or am I missing some critical use case?

I agree the ports tree is not extremely useful as shipped, except… you get an outdated system lying around that for some reason you can’t update and you need to install specific software in it.. for example, git - so that … you can update. Happened to me few times. Precompiled packages are not available anymore for those… new ports tree won’t work for multitude of reasons. There should be a snapshot of the ports tree for the release so you know anything you build from there will be compilable/compatible with that base. It may have other issues, but that’s different topic.

We used to have the very useful  portsnap tool, which did just that. A very simplified interface to updating the ports tree. Instead of junking it, it should have been updated to manage git base clones. Anyway, in today’s git clone of the ports “make update” works as expected.

Daniel