pkg and freebsd versions

I have a server running poudriere, and for a long time I've been building two repos, 12amd64 and 13amd64.
The jail that builds the 12amd64 repo was 12.3-RELEASE, until recently when some packages failed to build, so I replaced it with a 12.4 jail.
I still had hosts running 12.3-RELEASE and when I tried to install packages on them, I got this error:

Newer FreeBSD version for package zziplib:
To ignore this error set IGNORE_OSVERSION=yes
- package: 1204000
- running kernel: 1203000
Ignore the mismatch and continue? [y/N]: Processing entries... done
Unable to update repository fast
Error updating repositories!
pkg: repository fast contains packages for wrong OS version: FreeBSD:12:amd64

Ok, I realize 12.3-RELEASE is EOL, and since then all my hosts have been upgraded, but I'm going to start building packages for 13.2 and it seems I don't understand pkg as well as I should.

Should I have one repo for each major version, with the builder jail on the oldest minor version still supported, or am I better off with one builder jail and one repo for each minor version?
I assume packages built on 13.1 will work on 13.2, but possibly not the opposite?
 
Packages for 13.2 won't work on 13.1 (there's backwards compatibility, not forward compatibility). Packages built for 13.1 will work fine on 13.2. It's only a handful of kernel modules that may prove problematic. As long as you don't need any of those you'll be fine with 13.1 packages on a 13.2 system. So create a new jail for 13.2 on the build server. Then you have packages for both versions and you can test the builds on 13.2. Have all your systems still use the 13.1 packages, even the servers you already upgraded to 13.2. Only when all your systems have been upgraded (and the 13.2 packages have been tested) switch the repository. And clean up by removing the 'old' 13.1 build jail (and repositories).

That's how I deal with any of the minor version upgrades and my own package repositories.

Should I have one repo for each major version
Yes, that's pretty much mandatory. It's therefor quite useful to get everything on the same major version. As this reduces the number of builds you have to do.
 
Should I have one repo for each major version, with the builder jail on the oldest minor version still supported
Or, the oldest version still in use at your site. But, yes.

or am I better off with one builder jail and one repo for each minor version?
This should almost always be unnecessary.

I assume packages built on 13.1 will work on 13.2, but possibly not the opposite?
Yes. And most of the time the other way around works as well, but can't be guaranteed, as new minor releases can introduce new features and packages might end up depending on them.

Only exception to all the above are VERY few *-kmod packages, some kernel modules will only work on exactly the kernel version they were built for.
 
Back
Top