Re: Please revert commit a2bd861

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Tue, 30 Nov 2021 01:10:12 UTC
Robert Clausecker <fuz@fuz.su> writes:

> Commit a2bd861 (most recent commit on 2021Q4) breaks the ports build:
>
> [00:10:17] Warning: (www/firefox): Error: www/firefox depends on
> nonexistent origin 'devel/wasi-compiler-rt12'; Please contact
> maintainer of the port to fix this.
> [00:11:44] Error: Fatal errors encountered gathering initial ports metadata

Mk/bsd.gecko.mk sets LLVM_DEFAULT=13 but respects user wishes from
DEFAULT_VERSIONS in make.conf(5) unless LTO option is enabled.
Unfortunately, while wasi-compiler-rt13 and wasi-compiler-rt11
do exist wasi-compiler-rt12 doesn't. Mixing LLVM subprojects from
different major versions are unlikely to be supported.

In short, the package cluster isn't affected due to using defaults.

> Please revert this commit so ports can be built.

Can you try the following instead?

diff --git a/Mk/bsd.gecko.mk b/Mk/bsd.gecko.mk
index b912e1aa7ade..efaa641294ca 100644
--- a/Mk/bsd.gecko.mk
+++ b/Mk/bsd.gecko.mk
@@ -93,7 +93,9 @@ MOZ_OPTIONS+=	--with-libclang-path="${LOCALBASE}/llvm${LLVM_DEFAULT}/lib"
 MOZ_EXPORT+=	LLVM_OBJDUMP="${LOCALBASE}/bin/llvm-objdump${LLVM_DEFAULT}"
 .endif
 # Ignore Mk/bsd.default-versions.mk but respect make.conf(5) unless LTO is enabled
-.if !defined(DEFAULT_VERSIONS) || ! ${DEFAULT_VERSIONS:Mllvm*} || ${PORT_OPTIONS:MLTO}
+# wasi-compiler-rt* is currently limited to llvm11 and llvm13
+.if !defined(DEFAULT_VERSIONS) || ! ${DEFAULT_VERSIONS:Mllvm*} || ${PORT_OPTIONS:MLTO} || \
+	${DEFAULT_VERSIONS:Mllvm=1[02]} || ${DEFAULT_VERSIONS:Mllvm=[7-9]0}
 LLVM_DEFAULT=	13 # chase bundled LLVM in lang/rust for LTO
 .endif
 # Require newer Clang than what's in base system unless user opted out