tools icon indicating copy to clipboard operation
tools copied to clipboard

Using different pkg versions for pkg create/repo

Open rralleres opened this issue 4 years ago • 7 comments

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

rralleres avatar Nov 15 '21 11:11 rralleres

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.

fichtner avatar Nov 15 '21 11:11 fichtner

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

rralleres avatar Nov 15 '21 11:11 rralleres

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.

fichtner avatar Nov 15 '21 11:11 fichtner

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

fichtner avatar May 10 '22 07:05 fichtner

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

fichtner avatar Jul 22 '22 12:07 fichtner

#312 May address this issue with documentation in a way that's supportable between versions.

blkmajik avatar Aug 04 '22 21:08 blkmajik

bd63e02c8 should make this clear for now that it likely won't work (and prevent it from working)

fichtner avatar Aug 05 '22 08:08 fichtner

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.

fichtner avatar Feb 14 '24 08:02 fichtner