Bug 15804

Summary: Add sanity test for g++ supporting "--std=gnu++20"
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Yoann Congal <yoann.congal>
Component: oe-core otherAssignee: Yoann Congal <yoann.congal>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: randy.macleod
Version: unspecified   
Target Milestone: 5.2 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)

Description Yoann Congal 2025-03-18 15:40:11 UTC
"g++ --std=g++20 ..." is needed to build nodejs.

Instead of failing late into the build, add a sanity check at the start for this.

Timeline:
* https://lists.openembedded.org/g/openembedded-devel/topic/111740469 (thread about failing nodejs build)
* https://lists.yoctoproject.org/g/yocto-patches/topic/yocto_autobuilder2_patch/111757761 (thread on the removal of Ubuntu 20.04 worker for meta-oe)
* Discussed at the engineering call (20250318):
 * Ubuntu 20.04 in near EOL
 * We may remove its support "soon" (without buildtools)
 * To do this, it starts with this sanity check
 * Then, it will justify the use of buildtools or removable from supported distros.

Impact on documentation: the "g++ supports --std=g++20" requirement needs to be documented.
Comment 1 Yoann Congal 2025-03-18 23:19:31 UTC
Errata: the option to test for odejs is "std=gnu++20" (not std=g++20)
Comment 2 Yoann Congal 2025-03-20 14:39:25 UTC
Patch v2 sent:
openembedded-core@lists.openembedded.org | [PATCH v2 1/2] sanity: Refactor &quot;C++ toolchain support this flag&quot; check
https://lists.openembedded.org/g/openembedded-core/topic/patch_v2_1_2_sanity/111808358
openembedded-core@lists.openembedded.org | [PATCH v2 2/2] insane: Check if the C++ toolchain supports --std=gnu++20
https://lists.openembedded.org/g/openembedded-core/topic/patch_v2_2_2_insane_check/111808359
Comment 3 Yoann Congal 2025-03-21 10:12:05 UTC
Sanity check added here:
sanity: Refactor "C++ toolchain support this flag" check : https://git.openembedded.org/openembedded-core/commit/?id=42d012e8414736d89618422fb6f9bce9e4a2a391
sanity: Check if the C++ toolchain supports --std=gnu++20 : 
https://git.openembedded.org/openembedded-core/commit/?id=19004950ad5691ef51f7fcf946558bd0de561403

TODO: Document the requirement on the c++ host compiler
Comment 4 Yoann Congal 2025-03-22 22:58:06 UTC
Doc patch sent:
[PATCH] poky.yaml.in: Raise minimum GCC version to 10.1
https://lists.yoctoproject.org/g/docs/topic/patch_poky_yaml_in_raise/111852706