freebsd / poudriere

Port/Package build and test system
https://github.com/freebsd/poudriere/wiki
BSD 2-Clause "Simplified" License
394 stars 163 forks source link

Can't create pkgbase images pre 14.1 #1168

Open patmaddox opened 2 months ago

patmaddox commented 2 months ago

Prerequisites

Describe the bug

poudriere image -P fails when the pre-built pkgbase installation is 14.0 or earlier. It fails with:

[00:00:00] Preparing the image 'pdt1725770246'
[00:00:00] Calculated image size 19531m
[00:00:00] Creating temporary ZFS pool
[00:00:01] Creating ZFS Datasets
awk: can't open file /usr/local/poudriere/jails/133_release/usr/src/sys/conf/newvers.sh
 source line number 1
Error: (75662) /usr/local/share/poudriere/image.sh:install_world_from_pkgbase:527: set -e error: status = 2
[00:00:04] Error while create image. cleaning up.

It occurs because install_world_from_pkgbase greps usr/src/sys/conf/newvers.sh - but from what I can tell, pkgbase didn't produce a source package until 14.1 (create-packages-source target).

How to reproduce

Steps to reproduce the behavior:

  1. Build pkgbase from source
  2. Create a pkgbase jail: poudriere jail -c -j ${jail_name} -v 14 -K GENERIC -m pkgbase=releng_140 -U file://path/to/pkgbase
  3. poudriere image -P pkgbaselist ... to build an image with pkgbase

Expected behavior

build an image

Environment

Additional context

Some ideas for alternate implementations:

markmi commented 2 months ago

The logic for pkgbase package creations is in FreeBSD, not poudriere/poudriere-devel . /usr/src/Makefile.inc1 in FreeBSD's source, to be specific. If the vintage/variation used does not contain (as seen in main):

author    Baptiste Daroussin <bapt@FreeBSD.org>    2023-11-17 16:19:39 +0000
committer    Baptiste Daroussin <bapt@FreeBSD.org>    2023-12-04 08:05:03 +0000
commit    99b8c0c35b0fcc633649209621243d678a13542a (patch)
tree    34d2e5c88b8e9fc2d4e9f7498c25b97eff8e27c9 /Makefile.inc1
parent    094abb6fb41c07c0266a5cae84a7439289a978e9 (diff)
download    src-99b8c0c35b0fcc633649209621243d678a13542a.tar.gz
src-99b8c0c35b0fcc633649209621243d678a13542a.zip
pkgbase: create source package
FreeBSD-src for all the sources but the kernel
FreeBSD-src-sys just for the kernel

MFC After:        3 days
Reviewed by:        manu
Differential Revision:    https://reviews.freebsd.org/D42651
. . .

(and related), the 2 src and src-sys packages are not built. Even releng/13.4/ (in process) does not have those changes at this point.

So: not a poudriere / poudriere-devel issue. Old FreeBSD releases ( old releng/*.*/ ) are unlikely to be modified to add such.

I have just sent out a message asking about if releng/13.4/ should get the related commit(s). The answer might be no, given the likely lack of intent for any official pkgbase builds for 13.4 and it is already at RC3.

[ADDED LATER: The answer for 13.4 was: too late to change now.]

markmi commented 2 months ago

Looks like I misinterpreted the context relative to the likes of 13.* , quoting patmaddox from the discord exchange:

QUOTE Sorry when I say “pre-built” I mean pre-built locally. I check out 13.4 and run make packages and give those to poudriere.

Anyway I will stick with non-pkgbase in poudriere for <= 14.0 jails END QUOTE