Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Sep 2021 19:29:03 GMT
From:      Tobias Kortkamp <tobik@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: b1670e2c3d42 - main - lang/rust*: Mk/Uses/cargo.mk: Move TMPDIR to WRKDIR
Message-ID:  <202109061929.186JT3vG047928@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by tobik:

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

commit b1670e2c3d42a2aeacff843ef0ccea21c0929d03
Author:     Tobias Kortkamp <tobik@FreeBSD.org>
AuthorDate: 2021-09-06 17:16:38 +0000
Commit:     Tobias Kortkamp <tobik@FreeBSD.org>
CommitDate: 2021-09-06 19:28:28 +0000

    lang/rust*: Mk/Uses/cargo.mk: Move TMPDIR to WRKDIR
    
    rustc stashes intermediary files in TMPDIR (default /tmp) which
    might cause issues for users that for some reason space limit their
    /tmp.  WRKDIR should have plenty of space.
    
    Other ports that use rustc might be affected too, but set it only
    in USES=cargo and lang/rust* ports for now.
    
    PR:             258126
    With hat:       rust
---
 Mk/Uses/cargo.mk             | 8 ++++++++
 lang/rust-bootstrap/Makefile | 5 +++++
 lang/rust/Makefile           | 6 ++++++
 3 files changed, 19 insertions(+)

diff --git a/Mk/Uses/cargo.mk b/Mk/Uses/cargo.mk
index ad8c8d8d20ce..a0a88701e62e 100644
--- a/Mk/Uses/cargo.mk
+++ b/Mk/Uses/cargo.mk
@@ -125,6 +125,14 @@ CARGO_TEST?=	yes
 CARGO_USE_GITHUB?=	no
 CARGO_USE_GITLAB?=	no
 
+# rustc stashes intermediary files in TMPDIR (default /tmp) which
+# might cause issues for users that for some reason space limit
+# their /tmp.  WRKDIR should have plenty of space.
+# Allow users and ports to still overwrite it.
+.if ${TMPDIR:U/tmp} == /tmp
+TMPDIR=		${WRKDIR}
+.endif
+
 # Manage crate features.
 .if !empty(CARGO_FEATURES:M--no-default-features)
 CARGO_BUILD_ARGS+=	--no-default-features
diff --git a/lang/rust-bootstrap/Makefile b/lang/rust-bootstrap/Makefile
index 38bbe511f1f9..cd8a411b165b 100644
--- a/lang/rust-bootstrap/Makefile
+++ b/lang/rust-bootstrap/Makefile
@@ -57,6 +57,11 @@ CC=		clang90
 CXX=		clang++90
 .endif
 PATCHDIR=	${.CURDIR}/../rust/files
+# rustc stashes intermediary files in TMPDIR (default /tmp) which
+# might cause issues for users that for some reason space limit
+# their /tmp.  WRKDIR should have plenty of space.
+# ?= to allow users to still overwrite it in make.conf.
+TMPDIR?=	${WRKDIR}
 # Resulting packages are not specific to amd64
 NO_ARCH=	yes
 
diff --git a/lang/rust/Makefile b/lang/rust/Makefile
index 26185e9697df..25ba0b104626 100644
--- a/lang/rust/Makefile
+++ b/lang/rust/Makefile
@@ -44,6 +44,12 @@ TEST_ENV=	${MAKE_ENV} \
 
 CONFLICTS_INSTALL?=	rust-nightly
 
+# rustc stashes intermediary files in TMPDIR (default /tmp) which
+# might cause issues for users that for some reason space limit
+# their /tmp.  WRKDIR should have plenty of space.
+# ?= to allow users to still overwrite it in make.conf.
+TMPDIR?=	${WRKDIR}
+
 OPTIONS_DEFINE=		DOCS GDB SOURCES WASM
 OPTIONS_DEFAULT=	SOURCES WASM
 OPTIONS_EXCLUDE_armv6=	DOCS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109061929.186JT3vG047928>