Installing FreeBSD from source compiling everything (like in Gentoo Linux)

I newly installed FreeBSD 14.0 using the usual way, booting a live environment and starting bsdinstall.
The ports system is broken, complaining about wrong perl- and python-versions, so it's almost unuseable.
Coming from Gentoo Linux I'm asking myself if I would get a cleaner system if I would compile everything from source using ports, e.g. in a chroot environment.
Is that possible? Does it make sense? How could you do this?
 
The ports system is broken, complaining about wrong perl- and python-versions, so it's almost unuseable.
It's not broken. You just need to read /usr/ports/UPDATING.
Code:
20231017:
  AFFECTS: users of lang/perl5*
  AUTHOR: delphij@FreeBSD.org

  The default Perl version has been switched to Perl 5.36.  If you are using
  binary packages to upgrade your system, you do not have anything to do, pkg
  upgrade will do the right thing.  For the other people, follow the
  instructions in entry 20181213, it should still be the same.
Code:
20220626:
  AFFECTS: users of python
  AUTHOR: thierry@FreeBSD.org

  The default version of python3 and python was switched to 3.9.

  For ports users wanting to keep version 3.8 as default,
  add DEFAULT_VERSIONS+= python=3.8 python3=3.8 to make.conf

  Following procedures may ease the upgrade:

  For users of pre-build packages:
  # sh
  # for i in $(pkg query -g %n 'py38-*'); do pkg set -yn ${i}:py39-${i#py38-}; done
  # pkg upgrade

  For portmaster users:
  # sh
  # portmaster -o lang/python39 python38
  # REINSTALL="$(pkg info -o "*py38*" | awk '{printf "%s ", $2}')"
  # pkg delete -f "*py38*"
  # portmaster $REINSTALL
  # REBUILD=$(pkg query -g "%n:%dn" '*' | grep py3 | grep -v py39 | cut -d : -f 1 | sort -u)
  # portmaster $REBUILD
  # REBUILD2=$(pkg list | grep python-38 | xargs pkg which | awk '{print $6}' | sort -u)
  # portmaster $REBUILD2

  Final steps (for pre-built packages & portmaster):

  If no longer required, Python 3.8 can be removed via
  "pkg remove python38" and the directory /usr/local/lib/python3.8 can
  then be deleted afterwards, if not empty.


Coming from Gentoo Linux I'm asking myself if I would get a cleaner system if I would compile everything from source using ports, e.g. in a chroot environment.
Is that possible? Does it make sense? How could you do this?
Use ports-mgmt/poudriere (or the -devel version), or ports-mgmt/synth.
 
Yes.
Yes.
by reading documentation for building system from source. it is available online. https://docs.freebsd.org/en/books/handbook/cutting-edge/#makeworld
As well as building from ports https://docs.freebsd.org/en/books/handbook/ports/#ports-using
There are many things you can to control the building of the the system, look src.conf(), build()
There are many many things you can do for building ports, usually controlled from /etc/make.conf very much like you would do in gentoo. look ports(), make.conf()
 
Now that you're on 14.0 and want to build from source, git clone the sources from either cgit or gh. Switch to the stable/14 branch and buildworld/kernel and installworld/kernel.

Now play around with the sources. Check out your own branch. Make changes commit to it and periodically rebase stable/14 to it.

Share your patches and if enough of them are accepted someone will notice and punish you with an offer of a commit bit.

Of course it's always good to install to a different partition than you do your day-to-day work on, just in case one of your patches goes horribly sideways you're not left in the lurch. Each of my machines has extra bootable FreeBSD partitions. Should something go wrong (I use 15-CURRENT) fallback is simply boot the other partition and fix things from there. You could maintain a 14-STABLE partition along with a 15-CURRENT or a 14.0-RELEASE with a 14-STABLE or any other combination.

Something I learned early in my career was that we all make mistakes but those who recover quickly are the pros. I was told this by a mentor when I was a young MVS sysprog back in the day.
 
Off topic, but I conjecture if the majority of users using freebsd-update began building from source instead, new version releases would have less gotcha's than, say, the v 13 v14 one, also, more blogs and threads would be up for those who build install from source to have a checklist before starting so it takes just a few hours each time. [ I miss the v5 v6 v7 days when, before zfs and many GUI flavors, it was a pastime rather than a do-by-this-date scheduling item, despite the then-no-pkg ports time required. ]
 
Back
Top