Page MenuHomeFreeBSD

release: Only check no-root/no-qemu when building
ClosedPublic

Authored by cperciva on Thu, Oct 30, 8:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 10, 4:24 AM
Unknown Object (File)
Sat, Nov 8, 9:01 AM
Unknown Object (File)
Sat, Nov 1, 9:11 PM
Unknown Object (File)
Sat, Nov 1, 1:29 AM
Unknown Object (File)
Fri, Oct 31, 8:48 PM
Unknown Object (File)
Fri, Oct 31, 4:17 PM
Unknown Object (File)
Fri, Oct 31, 4:17 PM
Unknown Object (File)
Fri, Oct 31, 11:42 AM
Subscribers

Details

Summary

Building VMs as non-root requires no-QEMU code paths (installing
packages from outside the VM image rather than inside it) and vice
versa; we have a check for broken combinations.

Unfortunately that check was breaking
make -C src/usr.sbin/pkg NO_ROOT=YES -V PKGCONFBRANCH
because that code reaches into src/release to determine the branch
name (which is then used to determine which /etc/pkg/FreeBSD.conf to
install).

Wrap the no-root/no-qemu check in an .if to only run when we've
asked for VM and/or CLOUD building to be enabled.

Sponsored by: https://www.patreon.com/cperciva

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

you are in a maze of twisty little .ifs, all alike...

why did this cause the wrong FreeBSD.conf file to be installed? does more error handling need to be added to the caller as well?

In D53486#1221109, @ivy wrote:

you are in a maze of twisty little .ifs, all alike...

Yeah, the make logic for release-building is pretty crazy. Something I'd like to clean up... eventually.

why did this cause the wrong FreeBSD.conf file to be installed? does more error handling need to be added to the caller as well?

Getting an error from here was resulting in BRANCH being set to "", which didn't match BETA* | RC* | RELEASE*.

Yes, the code in usr.sbin/pkg should probably error out rather than quietly producing the wrong output, but I wasn't sure how best to do that (and we needed this fix anyway, not just better diagnostics).

Yes, the code in usr.sbin/pkg should probably error out rather than quietly producing the wrong output, but I wasn't sure how best to do that (and we needed this fix anyway, not just better diagnostics).

i would much prefer to fix both issues here if possible, even if it means just adding an error if ${BRANCH} is empty, or something like that. there should be no situations where this can actually be empty, right?

In D53486#1221118, @ivy wrote:

Yes, the code in usr.sbin/pkg should probably error out rather than quietly producing the wrong output, but I wasn't sure how best to do that (and we needed this fix anyway, not just better diagnostics).

i would much prefer to fix both issues here if possible, even if it means just adding an error if ${BRANCH} is empty, or something like that. there should be no situations where this can actually be empty, right?

Ok I was slightly wrong, instead of BRANCH being set to "" it's being set to "--- make[1]: stopped making "all" in /usr/src/release---".

And looking at the bmake code, there doesn't seem to be any way of checking the exit status of the command run by != unfortunately.

I agree that it would be better to fix both issues here, but properly detecting and erroring out seems like a nontrivial problem.

In D53486#1221125, @ivy wrote:

try this:

.MAKEFLAGS: -W

Aha, that does it. A bit blunter than the "detect if something went wrong and print an error message" I was looking for, but it's enough to kill the build.

This revision is now accepted and ready to land.Thu, Oct 30, 8:49 PM