Bug 269789

Summary: 13.2-BETA2 can't self-compile -- string_view:320:38: error: no member named '__char_traits_length_checked' in namespace 'std'
Product: Base System Reporter: Dave Cottlehuber <dch>
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed Unable to Reproduce    
Severity: Affects Only Me CC: delphij, dim, re
Priority: ---    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
building 13.2-BETA2 on 13.2-BETA2 using poudriere-devel
none
amd64 13.2-BETA2 git clone of 13.2 & buildworld. none

Description Dave Cottlehuber freebsd_committer freebsd_triage 2023-02-23 22:14:22 UTC
Created attachment 240353 [details]
building 13.2-BETA2 on 13.2-BETA2 using poudriere-devel

building from releng/13.2 branch from 13.2-BETA2 on aarch64 bombs out with `/usr/include/c++/v1/string_view:320:38: error: no member named '__char_traits_length_checked' in namespace 'std' during poudriere build from git src.

FreeBSD zap09 13.2-BETA2 FreeBSD 13.2-BETA2 metal/13.2-n254515-2a4ea3e56be GENERIC arm64
root@zap09:~ # sysctl hw.model hw.ncpu hw.machine_arch
hw.model: ARM Neoverse-N1 r3p1
hw.ncpu: 80
hw.machine_arch: aarch64
Ampere Altra https://deploy.equinix.com/product/servers/c3-large-arm64

14.0-CURRENT (main-n260969-2894c8c96b9b) is fine though.

repro:

- get an Altra as above or ask dch if needed
- install a precompiled 13.2-BETA2
- install poudriere-devel
- set GIT_BASEURL in /usr/local/etc/poudriere.conf to github.com/freebsd/freebsd-src

# poudriere jail -c -j 13_2_BETA2 -v releng/13.2 -m git+https -b -K GENERIC
Comment 1 Dave Cottlehuber freebsd_committer freebsd_triage 2023-02-23 22:32:12 UTC
Created attachment 240354 [details]
amd64 13.2-BETA2 git clone of 13.2 & buildworld.

Add amd64 to this issue, dies early on in stage 1.2: bootstrap tools
Comment 2 Dave Cottlehuber freebsd_committer freebsd_triage 2023-02-23 22:35:20 UTC
amd64 in /usr/include/c++/v1/string:1014:5: error: too few template arguments for alias template '__enable_if_t'
Comment 3 Dave Cottlehuber freebsd_committer freebsd_triage 2023-02-24 00:04:00 UTC
on both amd64 and aarch64 there is no issue if:

- a jail is created from 13.2-BETA2 published txz
- buildworld is run inside jail

on amd64 `freebsd-update IDS` segfaults reliably

the amd64 box is a 13.1-RELEASE -> freebsd-update to BETA1 and then BETA2
the arm64 box is a build & beinstall from a 14.0-CURRENT
Comment 4 Dimitry Andric freebsd_committer freebsd_triage 2023-02-24 12:59:01 UTC
FWIW, I installed a fresh 13.2-BETA2 VM on amd64, with the "sources" component enabled, and that can buildworld just fine:

Script started on Fri Feb 24 12:13:50 2023
Command: nice make -j4 buildworld
[Creating objdir /usr/obj/usr/src/amd64.amd64...]
--- buildworld ---
make[1] warning: /usr/src/: Permission denied.
make[1]: "/usr/src/Makefile.inc1" line 338: SYSTEM_COMPILER: Determined that CC=cc matches the source tree.  Not bootstrapping a cross-compiler.
make[1]: "/usr/src/Makefile.inc1" line 343: SYSTEM_LINKER: Determined that LD=ld matches the source tree.  Not bootstrapping a cross-linker.
--- buildworld_prologue ---
...
--- buildworld_epilogue ---
--------------------------------------------------------------
>>> World build completed on Fri Feb 24 13:38:26 CET 2023
>>> World built in 5076 seconds, ncpu: 4, make -j4
--------------------------------------------------------------

Command exit status: 0
Script done on Fri Feb 24 13:38:26 2023

Maybe the machine you originally tested this on had a partially succesful freebsd-update session?

It'll also be interesting to see what happens if you install a fresh 13.1-RELEASE, freebsd-update it to the most recent -pXXX version, and attempt to build a 13.2-BETA2 world there.
Comment 5 Dimitry Andric freebsd_committer freebsd_triage 2023-02-24 16:29:09 UTC
Similar on 13.1-R installation, doing a buildworld of 13.2-BETA2 sources, when it has to bootstrap the compiler and linker:

Script started on Fri Feb 24 14:28:35 2023
Command: nice make -j4 buildworld
[Creating objdir /usr/obj/usr/src/amd64.amd64...]
--- buildworld ---
make[1]: "/usr/src/Makefile.inc1" line 340: SYSTEM_COMPILER: libclang will be built for bootstrapping a cross-compiler.
make[1]: "/usr/src/Makefile.inc1" line 345: SYSTEM_LINKER: libclang will be built for bootstrapping a cross-linker.
--- buildworld_prologue ---
--------------------------------------------------------------
>>> World build started on Fri Feb 24 14:28:35 CET 2023
--------------------------------------------------------------
...
--- kyua ---
objcopy --strip-debug --add-gnu-debuglink=kyua.debug  kyua.full kyua
--- buildworld_epilogue ---
--------------------------------------------------------------
>>> World build completed on Fri Feb 24 16:21:35 CET 2023
>>> World built in 6780 seconds, ncpu: 4, make -j4
--------------------------------------------------------------

Command exit status: 0
Script done on Fri Feb 24 16:21:35 2023

E.g. it seems to all work fine?
Comment 6 Dave Cottlehuber freebsd_committer freebsd_triage 2023-02-25 12:36:57 UTC
## amd64

- can't reproduce on other amd64 systems
- works fine in a jail
- many processes segfault during stat on the original failing system
- reinstalled it to 13.2-BETA3 & no longer fails

## arm64

- original issue tracked down to stray 14.0-CURRENT files after beinstall.sh
- doesn't reproduce in a fresh jail / install