git: cc2efaed00e3 - main - devel/wasi-{compiler-rt,libcxx}: attempt to unbreak the tree

From: Charlie Li <vishwin_at_FreeBSD.org>
Date: Fri, 18 Oct 2024 12:16:21 UTC
The branch main has been updated by vishwin:

URL: https://cgit.FreeBSD.org/ports/commit/?id=cc2efaed00e35ece830aa68e3298d865513de061

commit cc2efaed00e35ece830aa68e3298d865513de061
Author:     Charlie Li <vishwin@FreeBSD.org>
AuthorDate: 2024-10-18 12:01:51 +0000
Commit:     Charlie Li <vishwin@FreeBSD.org>
CommitDate: 2024-10-18 12:01:51 +0000

    devel/wasi-{compiler-rt,libcxx}: attempt to unbreak the tree
    
    In the meta-ports, USES=llvm is defined before IGNORE, so when
    DISTVERSION=0, they are marked BROKEN because LLVM version 0 is
    invalid. However, the USES=llvm alone will permeate ${LLVM_DEFAULT}
    unless a valid specific LLVM version/range is specified, so anything
    that references the USES=llvm variables will defer to ${LLVM_DEFAULT}.
    In these cases, the children of these meta-ports are split by
    individual LLVM version, referencing them specifically.
    
    Each devel/wasi-libcxx depends on the corresponding devel/wasi-compiler-rt
    using ${LLVM_VERSION} through the respective meta-ports. However,
    since the meta-port is not IGNOREd until after the invalid USES=llvm,
    ${LLVM_VERSION} is ${LLVM_DEFAULT}, which is still as of this commit
    15, one of the dropped versions in WASI. BUILD_DEPENDS in the
    meta-port as a result refers to a removed port, breaking the tree.
    
    Conditionalise USES=llvm until after the proper IGNORE to avoid
    this kind of situation now and into the future.
    
    Reported by: antoine
---
 devel/wasi-compiler-rt/Makefile | 10 ++++++----
 devel/wasi-libcxx/Makefile      | 12 +++++++-----
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/devel/wasi-compiler-rt/Makefile b/devel/wasi-compiler-rt/Makefile
index f389dbb446ab..89fa972ac97e 100644
--- a/devel/wasi-compiler-rt/Makefile
+++ b/devel/wasi-compiler-rt/Makefile
@@ -18,15 +18,17 @@ LICENSE_NAME=	Apache License 2.0 with LLVM Exceptions
 LICENSE_FILE=	${WRKSRC}/llvm/LICENSE.TXT
 LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
 
+BUILD_DEPENDS=	${WASI_SYSROOT}/include/stdarg.h:devel/wasi-libc
+
+USES=		cmake tar:xz
+
 .if ${DISTVERSION} == 0
 IGNORE=		is a meta-port; there is nothing to build
 PKGNAMESUFFIX=	-master
+.else
+USES+=		llvm:${LLVM_SUFFIX}
 .endif
 
-BUILD_DEPENDS=	${WASI_SYSROOT}/include/stdarg.h:devel/wasi-libc
-
-USES=		cmake llvm:${LLVM_SUFFIX} tar:xz
-
 LLVM_RELEASE=	${DISTVERSION:C/rc.*//}
 LLVM_SUFFIX=	${LLVM_RELEASE:C/\.[0-9]\.[0-9]$//}
 DISTINFO_FILE=	${PORTSDIR}/${LLVM_PORT}/distinfo
diff --git a/devel/wasi-libcxx/Makefile b/devel/wasi-libcxx/Makefile
index c32a1afe9edc..c87c5f29c884 100644
--- a/devel/wasi-libcxx/Makefile
+++ b/devel/wasi-libcxx/Makefile
@@ -18,16 +18,18 @@ LICENSE_NAME=	Apache License 2.0 with LLVM Exceptions
 LICENSE_FILE=	${WRKSRC}/llvm/LICENSE.TXT
 LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
 
+BUILD_DEPENDS=	${WASI_SYSROOT}/include/stdarg.h:devel/wasi-libc
+
+USES=		cmake tar:xz
+
 .if ${DISTVERSION} == 0
 IGNORE=		is a meta port; there is nothing to build
 PKGNAMESUFFIX=	-master
+.else
+BUILD_DEPENDS+=	wasi-compiler-rt${LLVM_VERSION}>0:devel/wasi-compiler-rt${LLVM_VERSION}
+USES+=		llvm:${LLVM_SUFFIX}
 .endif
 
-BUILD_DEPENDS=	${WASI_SYSROOT}/include/stdarg.h:devel/wasi-libc \
-		wasi-compiler-rt${LLVM_VERSION}>0:devel/wasi-compiler-rt${LLVM_VERSION}
-
-USES=		cmake llvm:${LLVM_SUFFIX} tar:xz
-
 LLVM_RELEASE=	${DISTVERSION:C/rc.*//}
 LLVM_SUFFIX=	${LLVM_RELEASE:C/\.[0-9]\.[0-9]$//}
 DISTINFO_FILE=	${PORTSDIR}/${LLVM_PORT}/distinfo