git: 65ee7f56da7d - main - lang/dotnet: Get rid of security/openssl dependency

From: Gleb Popov <arrowd_at_FreeBSD.org>
Date: Fri, 21 Feb 2025 07:21:45 UTC
The branch main has been updated by arrowd:

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

commit 65ee7f56da7d6e61a2015a0ad9fc376812bf8605
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2025-02-21 07:11:35 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2025-02-21 07:21:14 +0000

    lang/dotnet: Get rid of security/openssl dependency
    
    This required rebuilding bootstrap binaries against base OpenSSL.
    
    Unfortunately, libraries from the bootstrap distribution are linked into
    programs being built by the port. This puts us into an ABI conflict between
    OpenSSL 1.1.1 from FreeBSD 13 base and OpenSSL 3 from FreeBSD 14 base [1].
    This is probably a bug of .NET build system, but for now just use different
    bootstraps for FreeBSD 13 and 14.
    
    [1]:
    ld.lld : error : undefined symbol: ERR_put_error
    >>> referenced by pal_evp.c.o:(CryptoNative_EvpMdCtxCreate) in archive /wrkdirs/usr/ports/lang/dotnet/work/bootstrap_sdk/packs/runtime.freebsd.13-x64.Microsoft.DotNet.ILCompiler/9.0.0/framework/libSystem.Security.Cryptography.Native.OpenSsl.a
    clang-15 : error : linker command failed with exit code 1 (use -v to see invocation)
        The command ""/usr/local/bin/clang15" "/wrkdirs/usr/ports/lang/dotnet/work/dotnet-9.0.2/src/runtime/artifacts/obj/coreclr/ILCompiler/freebsd.x64.Release/native/ilc.o" -o "/wrkdirs/usr/ports/lang/dotnet/work/dotnet-9.0.2/src/runtime/artifacts/bin/coreclr/freebsd.x64.Release/ilc/native/ilc" ... /wrkdirs/usr/ports/lang/dotnet/work/bootstrap_sdk/packs/runtime.freebsd.13-x64.Microsoft.DotNet.ILCompiler/9.0.0/framework/libSystem.Security.Cryptography.Native.OpenSsl.a ...
---
 lang/dotnet/Makefile |  9 +++++++--
 lang/dotnet/distinfo | 26 +++++++++++++++++---------
 2 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/lang/dotnet/Makefile b/lang/dotnet/Makefile
index eea658317b6d..5a7f2cdd5721 100644
--- a/lang/dotnet/Makefile
+++ b/lang/dotnet/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	dotnet
 DISTVERSIONPREFIX=	v
 DISTVERSION=	${DOTNETVERSION}.2
+PORTREVISION=	1
 CATEGORIES=	lang devel
 MASTER_SITES=	https://github.com/dotnet/dotnet/releases/download/${DISTVERSIONPREFIX}${DISTVERSION}/release.json?dummy=/:dotnetmanifest \
 		https://github.com/sec/dotnet-core-freebsd-source-build/releases/download/9.0.100-vmr/:bootstrap
@@ -22,7 +23,6 @@ BUILD_DEPENDS=	bash:shells/bash \
 		cmake:devel/cmake-core \
 		git:devel/git \
 		ggrep:textproc/gnugrep \
-		${LOCALBASE}/lib/libcrypto.so.12:security/openssl \
 		terminfo-db>0:misc/terminfo-db
 LIB_DEPENDS=	libbrotlienc.so:archivers/brotli \
 		libicuuc.so:devel/icu \
@@ -46,7 +46,6 @@ BOOTSTRAP_SDKVERSION=				${BOOTSTRAP_DOTNETVERSION}.100
 BOOTSTRAP_SDKVERSIONSUFFIX=			-rtm.24529.1
 BOOTSTRAP_SOURCEBUILT_ARTIFACTS_DISTNAME=	Private.SourceBuilt.Artifacts.${BOOTSTRAP_SDKVERSION}${BOOTSTRAP_SDKVERSIONSUFFIX}.${BOOTSTRAP_SDK_RID}
 BOOTSTRAP_SDK_DISTNAME=				dotnet-sdk-${BOOTSTRAP_SDKVERSION}-${BOOTSTRAP_SDK_RID}
-BOOTSTRAP_SDK_RID=				freebsd.13-${DOTNET_ARCH}
 
 DOTNETVERSION=		9.0
 SDKVERSION=		${DOTNETVERSION}.103
@@ -70,6 +69,12 @@ PLIST_SUB=	DOTNET_ARCH=${DOTNET_ARCH} FULL_DOTNETVERSION=${PORTVERSION} \
 EXTRA_PATCHES=	${PATCHDIR}/extra-patch-base-openssl
 .endif
 
+.if ${OSVERSION} < 1400000
+BOOTSTRAP_SDK_RID=	freebsd.13-${DOTNET_ARCH}
+.else
+BOOTSTRAP_SDK_RID=	freebsd.14-${DOTNET_ARCH}
+.endif
+
 .if ${ARCH} == amd64
 PLIST_SUB+=	VXSORT=
 .else
diff --git a/lang/dotnet/distinfo b/lang/dotnet/distinfo
index ae13bfde3d21..a311483cf07b 100644
--- a/lang/dotnet/distinfo
+++ b/lang/dotnet/distinfo
@@ -1,13 +1,21 @@
-TIMESTAMP = 1739433296
+TIMESTAMP = 1739433297
 SHA256 (dotnet/release.json-9.0.2) = 8746d7855beaeca19a7c3ddbc6a690a9c3ec5432df5db47314c8aaac7726d6d6
 SIZE (dotnet/release.json-9.0.2) = 273
 SHA256 (dotnet/dotnet-dotnet-v9.0.2_GH0.tar.gz) = 1cafd3d650734383f0018f8a65f43f4c943c69ab8fc300cb41b9ae8fd6b5266a
 SIZE (dotnet/dotnet-dotnet-v9.0.2_GH0.tar.gz) = 494550082
-SHA256 (dotnet/Private.SourceBuilt.Artifacts.9.0.100-rtm.24529.1.freebsd.13-x64.tar.gz) = 7e93b7fde936aca446254d633f9284041670d0073e020ffea82c49b0d7164df4
-SIZE (dotnet/Private.SourceBuilt.Artifacts.9.0.100-rtm.24529.1.freebsd.13-x64.tar.gz) = 832528322
-SHA256 (dotnet/Private.SourceBuilt.Artifacts.9.0.100-rtm.24529.1.freebsd.13-arm64.tar.gz) = 1e1b97c76c6d50506c7654fadd14b53eb23a5c3dec7f0cf97c52443355948d04
-SIZE (dotnet/Private.SourceBuilt.Artifacts.9.0.100-rtm.24529.1.freebsd.13-arm64.tar.gz) = 822105139
-SHA256 (dotnet/dotnet-sdk-9.0.100-freebsd.13-x64.tar.gz) = e115df58f710d45d00564ec75820d83549e661b8ac89cf2b3c4e676657fc80d6
-SIZE (dotnet/dotnet-sdk-9.0.100-freebsd.13-x64.tar.gz) = 510216988
-SHA256 (dotnet/dotnet-sdk-9.0.100-freebsd.13-arm64.tar.gz) = c057972876107db819af0dfe4c2212fbcec86559a56b2423255b6a34dd65764c
-SIZE (dotnet/dotnet-sdk-9.0.100-freebsd.13-arm64.tar.gz) = 500663703
+SHA256 (dotnet/Private.SourceBuilt.Artifacts.9.0.100-rtm.24529.1.freebsd.13-x64.tar.gz) = e97101b76488b11c8ef83fc7fa73076399100a8a29738fddc2d244cbda48eb06
+SIZE (dotnet/Private.SourceBuilt.Artifacts.9.0.100-rtm.24529.1.freebsd.13-x64.tar.gz) = 834353416
+SHA256 (dotnet/Private.SourceBuilt.Artifacts.9.0.100-rtm.24529.1.freebsd.13-arm64.tar.gz) = 13e6ee3a5cb7b6b8e45c862161142a4cfc9cbeb0f57c94dfb492b34bb05353af
+SIZE (dotnet/Private.SourceBuilt.Artifacts.9.0.100-rtm.24529.1.freebsd.13-arm64.tar.gz) = 824468584
+SHA256 (dotnet/dotnet-sdk-9.0.100-freebsd.13-x64.tar.gz) = dbf63c98b7215a63e02e565fe667aed50ed1799aee8bcfa5506aa2a6253229f1
+SIZE (dotnet/dotnet-sdk-9.0.100-freebsd.13-x64.tar.gz) = 511313224
+SHA256 (dotnet/dotnet-sdk-9.0.100-freebsd.13-arm64.tar.gz) = b9b0a9cb6ce56d7915367cd0ceb80deda7e6db09d2623898452f61b8c973ee1d
+SIZE (dotnet/dotnet-sdk-9.0.100-freebsd.13-arm64.tar.gz) = 501952215
+SHA256 (dotnet/Private.SourceBuilt.Artifacts.9.0.100-rtm.24529.1.freebsd.14-x64.tar.gz) = ba0470a1d889129505085264fb5f2b4a8e3cb07f13d61ec7b3a7f1101379feca
+SIZE (dotnet/Private.SourceBuilt.Artifacts.9.0.100-rtm.24529.1.freebsd.14-x64.tar.gz) = 833256591
+SHA256 (dotnet/dotnet-sdk-9.0.100-freebsd.14-x64.tar.gz) = 525e4adefabfb9d394cef31779acdde573fe6ba74a957e77194a4ebbaba7fe4c
+SIZE (dotnet/dotnet-sdk-9.0.100-freebsd.14-x64.tar.gz) = 510594725
+SHA256 (dotnet/Private.SourceBuilt.Artifacts.9.0.100-rtm.24529.1.freebsd.14-arm64.tar.gz) = 3d0425624c537d7c81997023a1f29efe00963152e229b081ee50cf583e68f9c3
+SIZE (dotnet/Private.SourceBuilt.Artifacts.9.0.100-rtm.24529.1.freebsd.14-arm64.tar.gz) = 824214925
+SHA256 (dotnet/dotnet-sdk-9.0.100-freebsd.14-arm64.tar.gz) = 611e2d3c8a2f74cb5347c4368809bb22f50c4be5af7ba529459750e17a2ac70b
+SIZE (dotnet/dotnet-sdk-9.0.100-freebsd.14-arm64.tar.gz) = 501948598