Bug 260083 - WITHOUT_BOOT build option appears to include stand, failing on libsa
Summary: WITHOUT_BOOT build option appears to include stand, failing on libsa
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
: 261582 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-11-28 00:51 UTC by Michael Dexter
Modified: 2022-03-19 12:20 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Dexter freebsd_triage 2021-11-28 00:51:51 UTC
The following buildworld errors...

--- all_subdir_stand ---
--- all_subdir_stand/libsa ---
/usr/src/stand/libsa/dosfs.c:41:10: fatal error: 'disk.h' file not found
#include "disk.h"
         ^~~~~~~~
--- all_subdir_stand ---
--- all_subdir_stand/libsa32 ---
/usr/src/stand/libsa/dosfs.c:41:10: fatal error: 'disk.h' file not found
#include "disk.h"
         ^~~~~~~~
--- all_subdir_stand/libsa ---
--- ufs.o ---
/usr/src/stand/libsa/ufs.c:84:10: fatal error: 'disk.h' file not found
#include "disk.h"
         ^~~~~~~~
--- all_subdir_stand ---
--- all_subdir_stand/libsa32 ---
--- ufs.o ---
/usr/src/stand/libsa/ufs.c:84:10: fatal error: 'disk.h' file not found
#include "disk.h"
         ^~~~~~~~

... are produced when building 14-CURRENT as of 2021-11-11 through 2021-11-25 when all WITHOUT_* build options are set in /etc/src.conf, with the exception of WITHOUT_BOOT. It appears that WITHOUT_BOOT is including /usr/src/stand despite WITHOUT_RESCUE being set in /etc/src.conf

/usr/src/Makefile.inc1 reads:

.if ${MK_BOOT} != "no"
SUBDIR+=stand
.endif

This syntax does not appear to have changed from 13.0-RELEASE and worked on 13.0-RELEASE, but now produces the error. I'm stumped but will keep trying to determine what is causing these errors.
Comment 1 Michael Dexter freebsd_triage 2021-11-28 05:46:36 UTC
This combination builds:

#WITHOUT_BOOT=YES
##WITHOUT_BOOT=YES
#WITHOUT_LOADER_GELI=YES
#WITHOUT_LOADER_LUA=YES
#WITHOUT_LOADER_ZFS=YES
WITHOUT_EFI=YES
WITHOUT_LOCALES=YES
WITHOUT_ZONEINFO=YES
WITHOUT_VI=YES
WITHOUT_ACCT=YES
WITHOUT_ACPI=YES=YES
#WITHOUT_LOADER_LUA=YES
#WITHOUT_LOADER_ZFS=YES
WITHOUT_ACCT=YES
WITHOUT_ACPI=YES
WITHOUT_<all other options>

It seems that WITHOUT_BOOT has become interdependent with WITHOUT_LOADER_GELI|LUA|ZFS since 13.0-RELEASE.

Is this intentional or should the src.conf(5) manual page be updated?
Comment 2 Michael Dexter freebsd_triage 2021-11-28 05:48:17 UTC
COPY/PASTE FAILURE. That list should read:

#WITHOUT_BOOT=YES
##WITHOUT_BOOT=YES
#WITHOUT_LOADER_GELI=YES
#WITHOUT_LOADER_LUA=YES
#WITHOUT_LOADER_ZFS=YES
WITHOUT_ACCT=YES
WITHOUT_ACPI=YES
WITHOUT_<all other options>
Comment 3 clbuisson 2021-11-28 14:39:53 UTC
For me, libsa cannot be built with

#WITHOUT_BOOT=YES
WITHOUT_LOADER_GELI=YES
WITHOUT_LOADER_ZFS=YES

but the build is successful with

#WITHOUT_BOOT=YES
#WITHOUT_LOADER_GELI=YES
WITHOUT_LOADER_ZFS=YES

first found with sources
  git 5a01dea7e8c9 (2021/09/19)
diagnosed with sources
  git d032cda0d047 (2021.11/12)
confirmed with sources
  git 8ec4c5dae327 (2021/11/21)
Comment 4 Ivan Rozhuk 2022-01-30 22:00:24 UTC
*** Bug 261582 has been marked as a duplicate of this bug. ***
Comment 5 Toomas Soome freebsd_committer freebsd_triage 2022-01-30 22:20:09 UTC
Could you test this patch:
diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile
index 6ac1d900104e..b7993d45f6af 100644
--- a/stand/libsa/Makefile
+++ b/stand/libsa/Makefile
@@ -167,6 +167,7 @@ SRCS+=      time.c
 .PATH: ${SRCTOP}/sys/ufs/ffs
 SRCS+=ffs_subr.c ffs_tables.c
 
+CFLAGS.ufs.c+= -I${LDRSRC}
 CFLAGS.bzipfs.c+= -I${SRCTOP}/contrib/bzip2
 
 # explicit_bzero and calculate_crc32c
Comment 6 Ivan Rozhuk 2022-01-30 22:33:46 UTC
(In reply to Toomas Soome from comment #5)

/usr/src/stand/libsa/tftp.c:57:10: fatal error: 'bootstrap.h' file not found
#include <bootstrap.h>
         ^~~~~~~~~~~~~
===> usr.sbin/mptutil (all)
1 error generated.
--- tftp.o ---
*** [tftp.o] Error code 1

make[4]: stopped in /usr/src/stand/libsa32
1 error

make[4]: stopped in /usr/src/stand/libsa32
--- all_subdir_stand/libsa32 ---
Comment 7 Ivan Rozhuk 2022-01-30 23:06:00 UTC
This works for me:

diff --git a/stand/libsa/Makefile b/stand/libsa/Makefile
index 6ac1d900104..781194d0a28 100644
--- a/stand/libsa/Makefile
+++ b/stand/libsa/Makefile
@@ -167,6 +167,9 @@ SRCS+=	time.c
 .PATH: ${SRCTOP}/sys/ufs/ffs
 SRCS+=ffs_subr.c ffs_tables.c
 
+CFLAGS.dosfs.c+= -I${LDRSRC}
+CFLAGS.tftp.c+= -I${LDRSRC}
+CFLAGS.ufs.c+= -I${LDRSRC}
 CFLAGS.bzipfs.c+= -I${SRCTOP}/contrib/bzip2
 
 # explicit_bzero and calculate_crc32c
Comment 8 Michael Dexter freebsd_triage 2022-02-12 23:33:17 UTC
Fixed
Comment 9 Ivan Rozhuk 2022-03-17 17:28:08 UTC
Please, commit this fix to 13.
Comment 10 commit-hook freebsd_committer freebsd_triage 2022-03-17 17:50:22 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=9633c3d87476f72375f13942b55a4c9a7a00c7d8

commit 9633c3d87476f72375f13942b55a4c9a7a00c7d8
Author:     Toomas Soome <tsoome@FreeBSD.org>
AuthorDate: 2022-03-17 17:42:05 +0000
Commit:     Toomas Soome <tsoome@FreeBSD.org>
CommitDate: 2022-03-17 17:42:05 +0000

    WITHOUT_BOOT build option appears to include stand, failing on libsa

    building libsa needs to use -I${LDRSRC} for some files.

    PR:             260083
    Submitted by:   Ivan Rozhuk
    MFC:            1 day

 stand/libsa/Makefile | 3 +++
 1 file changed, 3 insertions(+)
Comment 11 commit-hook freebsd_committer freebsd_triage 2022-03-18 23:14:35 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=01f549e1c9cf085d5a09a3b64a945c1f15dd42ba

commit 01f549e1c9cf085d5a09a3b64a945c1f15dd42ba
Author:     Toomas Soome <tsoome@FreeBSD.org>
AuthorDate: 2022-03-17 17:42:05 +0000
Commit:     Toomas Soome <tsoome@FreeBSD.org>
CommitDate: 2022-03-18 23:10:36 +0000

    WITHOUT_BOOT build option appears to include stand, failing on libsa

    building libsa needs to use -I${LDRSRC} for some files.

    PR:             260083
    Submitted by:   Ivan Rozhuk
    Approved by:    re (gjb, early MFC)

    (cherry picked from commit 9633c3d87476f72375f13942b55a4c9a7a00c7d8)

 stand/libsa/Makefile | 3 +++
 1 file changed, 3 insertions(+)
Comment 12 commit-hook freebsd_committer freebsd_triage 2022-03-19 12:20:43 UTC
A commit in branch releng/13.1 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=2ac7903dcbbafd0ad8c466344477fe62f16dccea

commit 2ac7903dcbbafd0ad8c466344477fe62f16dccea
Author:     Toomas Soome <tsoome@FreeBSD.org>
AuthorDate: 2022-03-17 17:42:05 +0000
Commit:     Toomas Soome <tsoome@FreeBSD.org>
CommitDate: 2022-03-18 23:18:12 +0000

    WITHOUT_BOOT build option appears to include stand, failing on libsa

    building libsa needs to use -I${LDRSRC} for some files.

    PR:             260083
    Submitted by:   Ivan Rozhuk
    Approved by:    re (gjb, early MFC)

    (cherry picked from commit 9633c3d87476f72375f13942b55a4c9a7a00c7d8)

 stand/libsa/Makefile | 3 +++
 1 file changed, 3 insertions(+)