Bug 261497 - powerpc64 fails to build after src 6497250f6f: stand/kboot/Makefile" line 27: Cannot open /usr/src/stand/kboot/arch/powerpc/Makefile.inc
Summary: powerpc64 fails to build after src 6497250f6f: stand/kboot/Makefile" line 27:...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: powerpc Any
: --- Affects Many People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: needs-patch, needs-qa, regression
Depends on:
Blocks:
 
Reported: 2022-01-26 18:01 UTC by Piotr Kubaj
Modified: 2022-02-07 21:32 UTC (History)
1 user (show)

See Also:
koobs: maintainer-feedback? (imp)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Kubaj freebsd_committer freebsd_triage 2022-01-26 18:01:31 UTC
The error:
make[4]: "/usr/src/stand/kboot/Makefile" line 27: Cannot open /usr/src/stand/kboot/arch/powerpc/Makefile.inc

Building only works after retrying with -DNO_CLEAN.
This error only affects powerpc64.

# first bad commit: [6497250f6f7f93e36795f5d0ec8ac658f6e781d8] kboot: Split out powerpc build
Comment 1 Warner Losh freebsd_committer freebsd_triage 2022-01-27 18:07:38 UTC
works for me in my setup. I've done two dozen universe builds since I committed this.
Need your config and the targets you are building for exactly.
Comment 2 Piotr Kubaj freebsd_committer freebsd_triage 2022-01-27 18:41:44 UTC
I'm building on 13.0-RELEASE on amd64.

the exact command line used is:
make buildworld -j 36 TARGET=powerpc TARGET_ARCH=powerpc64 SRCCONF=/dev/null __MAKE_CONF=/dev/null
so I believe it uses default configurations.

I also tried building on universe14a and met the same results.

Official image builders also seem to hit this issue (unless there's something else), because there are no snapshots https://download.freebsd.org/snapshots/powerpc/powerpc64/ISO-IMAGES/14.0/
Until yesterday, 20211230 snapshot was present, but it looks like it was removed.
Comment 3 Piotr Kubaj freebsd_committer freebsd_triage 2022-01-27 18:42:21 UTC
Native building on powerpc64 also fails.
Comment 4 Warner Losh freebsd_committer freebsd_triage 2022-01-27 19:18:41 UTC
OK. Got it. Will take a look.
Comment 5 Warner Losh freebsd_committer freebsd_triage 2022-01-27 19:28:19 UTC
make[4]: "/usr/src/stand/kboot/Makefile" line 27: Cannot open /usr/src/stand/kboot/arch/powerpc/Makefile.inc


I wonder why it's trying to open arch/powerpc instead of arch/powerpc64...
Comment 6 Warner Losh freebsd_committer freebsd_triage 2022-01-27 19:33:32 UTC
"Building only works after retrying with -DNO_CLEAN."

Oh, that's why it works for me.... I do meta builds which is implicitly clean.
Comment 7 Warner Losh freebsd_committer freebsd_triage 2022-01-27 20:02:32 UTC
yea, this is a 'build before the change, build -DNO_CLEAN, fail' scenario.
Comment 8 Piotr Kubaj freebsd_committer freebsd_triage 2022-01-27 21:34:47 UTC
I actually do clean builds. It's just that buildworld only succeeds after retrying with -DNO_CLEAN this time.
Comment 9 Warner Losh freebsd_committer freebsd_triage 2022-01-27 21:43:56 UTC
Oh. That's weird. Dies this happen if you build without lib32?
Comment 10 Piotr Kubaj freebsd_committer freebsd_triage 2022-01-27 22:56:46 UTC
Nope.
Comment 11 Warner Losh freebsd_committer freebsd_triage 2022-01-27 23:28:27 UTC
I think what's happening is that we're recursing into src/stand for building LIB32 using MACHINE_ARCH=powerpc but using the target defaults of powerpc64.

And that's going to be ugly to fix properly.
Comment 12 Piotr Kubaj freebsd_committer freebsd_triage 2022-02-02 18:02:09 UTC
Since currently build is failing, would it be possible to revert the broken commit?
Comment 13 Warner Losh freebsd_committer freebsd_triage 2022-02-02 18:08:30 UTC
I'll either have a fix or a revert later today. I'd rather not revert things and I think I know how to fix it. I just finished setting up stable-12 and stable-13 jails to test things like this...
Comment 14 Warner Losh freebsd_committer freebsd_triage 2022-02-02 19:03:52 UTC
I have a fix and as soon as it's through, I'll commit.
The reason I didn't notice is this doesn't appear in meta mode that I can tell.
It does happen right away in non-metamode. :(
Comment 15 Warner Losh freebsd_committer freebsd_triage 2022-02-02 19:09:16 UTC
https://reviews.freebsd.org/D34141

is what I'm thinking, does that fix things for you?
Comment 16 commit-hook freebsd_committer freebsd_triage 2022-02-02 21:29:46 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=034755623d3d211a82084aca3215dc1e6d103bfc

commit 034755623d3d211a82084aca3215dc1e6d103bfc
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2022-02-02 21:27:56 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2022-02-02 21:27:56 +0000

    stand: Fix kboot issue on powerpc64 with MK_LIB32=yes

    When MK_LIB32 is true, we descend into stand for make includes, make
    clean, etc. We shouldn't do this, so set MK_BOOT=no when we're building
    includes.

    Fixes:          6497250f6f7f
    PR:             261497
    Sponsored by:   Netflix
    Reviewed by:    emaste, brooks (he suggested this)
    Differential Revision:  https://reviews.freebsd.org/D34141

 Makefile.libcompat | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 17 Piotr Kubaj freebsd_committer freebsd_triage 2022-02-07 21:05:30 UTC
Looks like the issue is fixed, there are new images as well https://download.freebsd.org/snapshots/powerpc/powerpc64/ISO-IMAGES/14.0/

Thanks!
Comment 18 Warner Losh freebsd_committer freebsd_triage 2022-02-07 21:32:41 UTC
You bet. Sorry that it took so long for me to resolve.