Re: OSVERSION question for stable branch packages

From: Edward Sanford Sutton, III <mirror176_at_hotmail.com>
Date: Thu, 31 Oct 2024 10:01:59 UTC
On 10/30/24 13:35, Bjoern A. Zeeb wrote:
> Hi,
> 
> if I remember correctly packages are built on the oldest version of a
> stable platform?

I normally use custom built ports with stable but thought that the 
package repositories are built for the oldest supported -release 
versions, leaving newer -release and -stable to require custom compiling 
by the user if needed (common example is drm or other kernel module of 
older minor release breaking if used with newer minor release due to ABI 
breakage).

> So we would currently build on 14.1-R[p6] for the upcoming 14.2-R as well?

Normally until 3 months after the newer minor release (14.2), at which 
point the older minor release (14.1) package building is replaced with 
the newer minor release's versioned packages.

> How do OSVERSION checks work in that case?  Say I want to check for
> OSVERSION >= 1401503  (just a random one).  Would that be true for
> package builds for 14 before 14.1-R goes out of support and 14.2-R
> becomes the new "build base"?

As far as I know, the version numbers are taken by what goes into the 
-current and -stable branches. Ports check against OSVERSION, which 
should be equal to __FreeBSD_version as found in 
/usr/include/sys/param.h and comes from /usr/src/sys/sys/param.h . 
"OSVERSION >= 1401503" will not be true for 14.1 unless a value is 
created between 1401503 and 1402000. It seems the convention is 
1401000-1401499=14.1 during stable/14 and 1401500-1401999 during 
releng/14.1. Using this, its possible to create a range of numbers known 
to support a modification even if it applies to only some of the 
versions in 14.1 and 14.2 while not including all of them (ex: version 
bump for a security fix that breaks an API while both are supported 
release versions).

> Do we do special builds for releases with a source tree (sys/sys/param.h
> -> OSVERSION) matching that release?

Packages are not built for each/select OSVERSION values; they are made 
for the oldest minor version that is supported. Ports use these values 
to alter how/if a port builds. The builders just pass a source tree + 
tools of the oldest minor -release value that is still supported. Within 
the builder, the ports tree does its work based on each port's Makefile 
which takes in preprogrammed conditions based around OSVERSION.

> /bz
>