git: 3b7674afe7dd - main - finance/hyperswitch: Change to thin LTO attempting to fix amd64 runaway problem

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Thu, 27 Feb 2025 09:33:41 UTC
The branch main has been updated by yuri:

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

commit 3b7674afe7ddd3036c3cef5148ad175394e60aae
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2025-02-27 09:31:27 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2025-02-27 09:33:37 +0000

    finance/hyperswitch: Change to thin LTO attempting to fix amd64 runaway problem
---
 finance/hyperswitch/Makefile | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/finance/hyperswitch/Makefile b/finance/hyperswitch/Makefile
index 4fac97cf3d52..b825ec8d0d88 100644
--- a/finance/hyperswitch/Makefile
+++ b/finance/hyperswitch/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	hyperswitch
 DISTVERSION=	2025.02.21.0
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	finance
 
 MAINTAINER=	yuri@FreeBSD.org
@@ -11,7 +11,6 @@ WWW=		https://hyperswitch.io/ \
 LICENSE=	APACHE20
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
-BROKEN_aarch64=	compilation fails: runaway builds, see https://github.com/rust-lang/rust/issues/137496
 BROKEN_armv7=	compilation fails: error[E0412]: cannot find type `AtomicU128` in module `core::sync::atomic`
 BROKEN_i386=	compilation fails: error[E0412]: cannot find type `AtomicU128` in module `core::sync::atomic`
 
@@ -846,6 +845,12 @@ CARGO_CRATES=	actix-codec-0.5.2 \
 
 RUSTFLAGS+=	--cfg uuid_unstable
 
+# change LTO to "thin" because otherwise link consumes tens of GB of memory and runs out of memory on arm64 causing runaway builds
+WITHOUT_LTO=	yes
+CARGO_ENV=	CARGO_PROFILE_RELEASE_LTO="thin" \
+		CARGO_PROFILE_RELEASE_PANIC="abort" \
+		CARGO_PROFILE_RELEASE_CODEGEN_UNITS=1
+
 OPENSSLINC=	/usr/include
 OPENSSLLIB=	/usr/lib