Page MenuHomeFreeBSD

Fix make release with -DNOPKGBASE
Needs ReviewPublic

Authored by olivier on Tue, Oct 28, 7:36 PM.
Tags
None
Referenced Files
F135314154: D53413.diff
Sat, Nov 8, 3:40 PM
Unknown Object (File)
Fri, Nov 7, 1:59 AM
Unknown Object (File)
Fri, Nov 7, 1:59 AM
Unknown Object (File)
Fri, Nov 7, 1:59 AM
Unknown Object (File)
Thu, Nov 6, 9:31 PM
Unknown Object (File)
Thu, Nov 6, 10:24 AM
Unknown Object (File)
Wed, Nov 5, 1:42 PM
Unknown Object (File)
Mon, Nov 3, 8:55 PM
Subscribers
None

Details

Summary

Problem: When building FreeBSD release with -DNOPKGBASE, the build failed because PKG_ABI was undefined, leading to pkg commands with empty ABI parameters (-o ABI=).

Root Cause: The PKG_ABI variable was only defined inside the !defined(NOPKGBASE) conditional block, but pkg installation commands were still executed in NOPKGBASE mode.

Solution: Moved the PKG_ABI definition (and its dependencies WSTAGEDIR and PKG_ABI_FILE) outside the NOPKGBASE condition and into the !defined(NOPKG) condition, so it's defined whenever packages need to be installed, regardless of whether pkgbase is used or not.

Notice: All troubleshooting and patch made by claude code.

Test Plan

Before:

$ sudo make -C release -DNOPORTS -DNODOC -DNOSRC -DNOPKGBASE memstick -j $(nproc)
(etc.)
pkg: Unknown OS '' in ABI string
pkg: Cannot parse configuration file!
*** [disc1] Error code 1

After:

$ sudo make -C release -DNOPORTS -DNODOC -DNOSRC -DNOPKGBASE memstick -j $(nproc)
(etc.)
$ ls /usr/obj/usr/src/amd64.amd64/release/memstick.img
/usr/obj/usr/src/amd64.amd64/release/memstick.img

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

olivier created this revision.

Does this work with cross-builds? I suspect that WSTAGEDIR is getting set to "" and then you're setting PKG_ABI based on /usr/bin/uname in the host system.

Why are we using PKG_ABI with NOPKGBASE?

Makefile
82

We still need pkg to be usable if NOPKG is set (it just controls 3rd party packages)

Does this work with cross-builds? I suspect that WSTAGEDIR is getting set to "" and then you're setting PKG_ABI based on /usr/bin/uname in the host system.

when packages aren't being built (e.g. with -DNOPKGBASE), worldstage is never populated at all, right? the release just installs directly from objdir into the release image.

Does this work with cross-builds? I suspect that WSTAGEDIR is getting set to "" and then you're setting PKG_ABI based on /usr/bin/uname in the host system.

Why are we using PKG_ABI with NOPKGBASE?

No idea why PKG is used with NOPKGBASE, I’m discovering the Makefile.