Using different pkg versions for pkg create/repo
ports.sh uses a chroot'ed built version of pkg for doing the pkg create while bundle_packages (common.sh) uses the pkg version installed on the system. It has been observed this can cause problems when creating the pkg catalog, for instance when building for Opnsense 20.7 (pkg 1.15/1.16 port) on Freebsd 12.1 (pkg 1.17) fails to create the catalog showing the following messages during pkg repo:
pkg: No package files have been found Cannot create repository catalogue
There's really nothing I can recommend other than pinning the version of pkg to the one used by OPNsense at that current time. The deprecation policy and ports tree reliance on a particular pkg update is out of our control.
Couldn't bundle_packages be using the previous built version of pkg? This would avoid pkg version mismatches during the creation of the catalog and it would be agnostic to the pkg installed on the system
It could, but not without jumping through more hoops getting a chroot up and running. I don't mind having this changed, though the work is probably less beneficial than necessary since the pkg 1.17 break is somewhat unfortunate shifting file names and needs handling internally (using it in OPNsense itself) more than interoperability in the build.
Eventually I want to fix this, but it's not high on my TODO list. For now pkg 1.17 has been included and everything should be back to the (new) "normal". ;)
https://github.com/opnsense/tools/blob/8e5db2ddf276d630eab4e062b527bb53ba3181cf/build/common.sh#L1022-L1023
as an intermediate step let's try to check the version in the ports tree with the version installed (x.y) to make sure it matches
See also: https://forum.opnsense.org/index.php?topic=29418.0
#312 May address this issue with documentation in a way that's supportable between versions.
bd63e02c8 should make this clear for now that it likely won't work (and prevent it from working)
This would be nice to have but it's too much work to get it up and running and may have implications on leaking signing keys since they have to be copied to the chroot.