Which version of FreeBSD should I use if I want create a new port?

I guys, I'd really want to try to became the maintainer of one of my favorite software which is Speedata Publisher, I have time to dedicate and I've gotten a spare laptop which is fairly recent (AMD Ryzen 2300 APU), and I wonder which version should I use to make the port, if the development release (aka current) or the stable release?

Also do I need to use Poudriere if I use a machine to explicitly create such port?

Thanks! ?
 
There's no rule for maintainers, other than carefully reading the porters' handbook... this of course includes e.g. getting dependencies correct, which is much harder to check without poudriere.

But there are rules for commits to ports. Ports should always work fine with every supported release plus -CURRENT, ideally on all architectures (and if that's impossible, the port must be marked accordingly with a short reason why it doesn't work on a specific architecture or FreeBSD version). This means build tests must be done, at least by the committer. All supported releases + -CURRENT on amd64 is considered the bare minimum. Now that aarch64 is tier-1 as well, testing these would be quite nice (but not everybody has the possibility).

As long as you're not a committer, you don't *have* to worry about these. But if you do, you might reduce work for committers and reduce cycles it takes if something is not correct.

If you want to do it "perfectly", do the following:
  • Install -CURRENT from source (set the build flags for production use, you don't want to debug the OS itself), keep it updated regularly (ZFS boot environments help).
  • Install portlint and portclippy (portlint can be integrated with poudriere, portclippy is for manual use)
  • Install poudriere
  • Create a -CURRENT poudriere jail using the manual method of poudriere-jail(8)
  • Create poudriere jails of all supported -RELEASE versions using e.g. the "ftp" method

I wrote a short doc for setting up an aarch64 testbuilder, maybe it helps here as well (many commands would be the same for any architecture):

Note that -STABLE is not relevant for port build tests. But when a port works fine on -CURRENT and all -RELEASE, it's very unlikely to break on -STABLE.
 
Wow... from any point you approach ports, it ends up to become always overwhelming... ?
No worries, as I said nobody expects you to do this. Committers are expected to do all the necessary checks (including build tests with poudriere). So, if you prefer, just install some -RELEASE version and work on your ports there.

I just recommend to setup your test machine with poudriere as described, because it helps a lot to spot and fix issues yourself, giving you also more confidence in your work ... ?

I'd also recommend to use a git clone for your poudriere ports tree and create a local branch for every port you work on, keeping this branch rebased onto main. Once you're fine with it, you can create a nice patch file with git format-patch -1 (on your feature branch), which includes your commit message and can be attached on bugzilla.
 
For port modification, the Porter's Handbook includes:

"… make whatever changes are necessary to get the port to compile properly under the current version of FreeBSD. Keep careful track of steps, …"

That's ambiguous (current is not necessarily CURRENT). FWIW I'd use CURRENT.
 
Wow... from any point you approach ports, it ends up to become always overwhelming... ?
Don't let poudriere be thought of as overwhelming. It is not required, nor is a dedicated machine for that matter, but it will make porting effort more accurate, reliable, and easier. Its not too bad to setup and doesn't require a webserver+browser to read through its log output. It is nice in that it allows you to know your build environment is a clean build environment. If dependencies fail you get feedback, if files aren't in plist properly you get feedback, if library dependencies are missed you get feedback, etc. Once the setup is done you can sit back and say, 'build it again' and wait while 'poudriere go burr'. You may not have to do a cleanup between each and every little change when testing or want to inspect things which makes poudriere's test feature come in handy. I've been known to just break a step in a port to get poudriere test to stop me at the desired stage.

The reason for using CURRENT for multiversion testing is poudriere more reliably builds for the same and older FreeBSD versions than it builds for newer ones. So from current you could tell poudriere to go do a build for 13 and 14 to make sure they both build (again happens with each in its own clean environment and own logs as poudriere go burr). I usually run STABLE and an updated STABLE is always newer than the equivalent release branch so poudriere should be able to test for both (minus any bugs) but may be more likely to have some issues testing the even newer CURRENT. If you go with any one version, you may have a time where as maintainer you get contacted by users, committers, automated report tools, etc. about a problem observed with your port on or off of that system; if you plan ahead of time how to run other version tests then you can more quickly analyze and respond to the issue. If overwhelmed or you don't have access you can always ask others for help, logs, etc.

RELEASEs need to work if possible, STABLE is a heads up for upcoming issues that need to be fixed in your port and/or FreeBSD and CURRENT again is a heads up but wtih more drastic and frequent changes. "If" a port requires STABLE or CURRENT but doesn't work on release then the world doesn't end, but the port should set BROKEN accordingly and even if older systems aren't fixed to work having the port will help for future systems. If it breaks on newer stuff and its known, please also set BROKEN until it can be resolved.

With ZFS and boot environments you could have one of each FreeBSD version ready to boot and test separate from the main install. You can choose if you want to have the boot environment use the same or separate data/user file areas so it can be like a tripleboot configuration or more of just FreeBSD versions chosen by boot environment selector. You can always just do completely separate installs, installs into VMs, etc. to test other versions.

For a good poudriere experience I do make some changes to its configuration so that single ports run multiple make jobs and poudriere builds less ports in parallel; building many ports in parallel, especially with work directories being kept in RAM is anything from painful to a complete failure on my 32GB RAM desktop.
 
The reason for using CURRENT for multiversion testing is poudriere more reliably builds for the same and older FreeBSD versions than it builds for newer ones.
Actually, running a newer userland with an older kernel (which is exactly what you'd do in a poudriere jail that's newer than your host) is completely unsupported and unlikely to work at all. It's almost guaranteed to fail for a newer major version.

I usually run STABLE and an updated STABLE is always newer than the equivalent release branch so poudriere should be able to test for both (minus any bugs) but may be more likely to have some issues testing the even newer CURRENT.
The cluster won't build packages for STABLE (the packages for RELEASE are expected to also work on STABLE most of the time), so it's not really necessary to test your ports on STABLE. Of course you can do it for yourself if you're running STABLE.

Running CURRENT for your ports test machine normally isn't an issue. Most of the time, CURRENT is very reliable and "stable". It's not recommended to use it for anything other than development/testing because it's always possible to have (sometimes very severe) bugs. That's rare, but happens. Therefore I'd recommend to always upgrade your CURRENT into a new boot environment, so you have a simple rollback available in case anything goes sideways.

Still, all of that is completely optional for contributors. You can leave that build testing to committers if you want, just make sure your port at least works fine on a recent RELEASE version when you submit it.
 
Don't let poudriere be thought of as overwhelming. … not too bad to setup …

+1

Some of the documentation is needlessly overwhelming.

A simple setup is not complicated.

If (say) you create jails for main, fourteen, and thirteen, on a CURRENT host, you can use pkgbase to update three of those four things (not the thirteen jail).
 
I guess I wasn't clear when I stated that by running STABLE, poudriere should handle running the RELEASE that is below it since backwards usually works while forwards doesn't.

I thought that some people used qemu + poudriere builds of a different architecture. Wonder if it is worth doing that with bhyve since we lost qemu acceleration kernel module and if there are any reasons to not do that for building newer OS versions on an older OS.
 
I guess I wasn't clear when I stated that by running STABLE, poudriere should handle running the RELEASE that is below it since backwards usually works while forwards doesn't.
"forwards" as you call it is unlikely to work, and always unsupported. "backwards" always works (as long as you don't intentionally build your kernel without backwards compatibility). The package building cluster runs exclusively -CURRENT, still builds packages for all supported -RELEASE versions.

I thought that some people used qemu + poudriere builds of a different architecture. Wonder if it is worth doing that with bhyve since we lost qemu acceleration kernel module and if there are any reasons to not do that for building newer OS versions on an older OS.
You're mixing up two concepts. Poudriere has support to use qemu-user, which can run single foreign-architecure binaries. Your build will still run in a jail on your host system (so, using the native kernel). You can build and install native-xtools in your base for these jails, so at least the C and C++ compilers don't need to run via qemu, speeding up things. This concept has limitations, e.g. lang/rust just doesn't work with qemu-user. That's why I was looking for a free "cloud" VM on real arm silicon to do my aarch64 test builds.

Of course you can setup your build machine in bhyve. I'm doing exactly that for my local ports test builder. The host is always running a -RELEASE version, but in that VM, I have -CURRENT with poudriere jails for all -RELEASE versions.
 
Back
Top