Compiling for earlier FreeBSD versions?

If I have a machine running 14.0-RELEASE and another running 13.2-RELEASE, is it possible to have the 14.0 machine build ports intended for the use of the 13.2 machine? I see that I apparently can configure gitup to pull the two trees into two separate locations (e.g. /usr/ports and /usr/ports-13.2), and I know I can set up Synth (which I use and would like to use for this, if feasible) to have two different profiles so as to use those two separate locations of the trees. But I'm not sure how to actually configure things so that the underlying "make" process for one of them will generate stuff appropriate for a different FreeBSD version, if that's even possible in the first place.
 
I don't think it's possible to build 13.2 packages on a 14.0 machine with ports-mgmt/synth.

From https://github.com/jrmarino/synth#s...-repository-builder-for-freebsd-and-dragonfly
... Synth will build packages in a clean environment that exactly mirrors the system it builds on, ...
It should be possible inside a 13.2 jail, though.

There is a jail.conf example in the FAQ's.



Better suited for your objective would be ports-mgmt/poudriere or ports-mgmt/poudriere-devel. Those are designed for exactly this intention.

For example all official packages are build with poudriere on a 15-CURRENT host in jails of different versions and architecture:

Example amd64
Code:
building for: FreeBSD 140amd64-default-job-05 14.0-RELEASE-p6 FreeBSD 14.0-RELEASE-p6 amd64
...
Poudriere version: poudriere-git-3.4.1-1-g1e9f97d6
Host OSVERSION: 1500006
Jail OSVERSION: 1400097

Example arm64
Code:
building for: FreeBSD 132arm64-default-job-13 13.2-RELEASE-p11 FreeBSD 13.2-RELEASE-p11 arm64
...
Poudriere version: poudriere-git-3.4.1-1-g1e9f97d6
Host OSVERSION: 1500006
Jail OSVERSION: 1302001
 
You will not need two ports trees unless you are trying to have them in different states (following different branches, different revision checked out, edits applied to what only one of them uses) and trying to simultaneously build each at that point. Last I checked, different `make config` options for the ports are not stored in the ports tree, the ports make necessary changes based on detected FreeBSD version, and distfiles collection can also be shared.

If running under a jail or chroot didn't work out, maybe the steps to crossbuild binaries could be changed to build for a different FreeBSD version instead of a different architecture. A virtual machine could be an option if that gave too much difficulty but would be even more unnecessary overhead and loss of performance to where I'd be surprised if using poudriere wasn't all around a better option at that point.

I haven't used synth, but poudriere can easily have different builds point at the same or different ports trees and each version will need its own /usr/src tree (or binaries?)
 
Thanks.

I've been avoiding looking into Poudriere for quite a while, because I've been very happy with Synth for a long time (much happier than I've been with any previous package management system I've used, going back to like 2004 or so). I'll look into it now, though.

Regarding not needing two ports trees: But aren't there different trees for every release, which do not necessarily have the same ports/versions/etc.? And presumably which may not be appropriate for another release, even if they compile successfully under that release?
 
Regarding not needing two ports trees: But aren't there different trees for every release, which do not necessarily have the same ports/versions/etc.?
I don’t think so - one ports tree, but four sets of built packages - quarterly and latest for two versions (currently 13 and 14).

But I’m not 100% sure.
 
There is only one ports tree. For all supported versions and architectures.
 
I think it is possible with synth by setting SYSROOT.
[G] System root directory
You thought right (nice catch by the way).

rwv37, I've tested building 13.2 packages on a 14.0 host with ports-mgnt/synth and it's quite possible without the need of a jail(8).
  1. Create a "FreeBSD-13.2" directory
  2. extract 13.2 base.txz inside that directory (or buildworld, installworld from source 13.2 in that directory). Those base.txz distribution sets can be found under https://download.freebsd.org/releases/<architecture>/<version>
  3. point synth "System root directory" to that directory
  4. synth ready to build ABI FreeBSD:13:* packages

I've tried on amd64 platform, obviously synth is probing the system root directory for ABI. The built FreeBSD:13:amd64 packages install and run fine under 13.2.

Apropos, version 13.2 expected end-of-life will be June 30, 2024.
 
Back
Top