git: c4816e4763b8 - main - lang/rust*: Move the build artifacts out of source

From: Tobias Kortkamp <tobik_at_FreeBSD.org>
Date: Thu, 25 Nov 2021 20:02:29 UTC
The branch main has been updated by tobik:

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

commit c4816e4763b8d395b4a2cb670a8aaaf33bb8def1
Author:     Tobias Kortkamp <tobik@FreeBSD.org>
AuthorDate: 2021-11-25 08:55:43 +0000
Commit:     Tobias Kortkamp <tobik@FreeBSD.org>
CommitDate: 2021-11-25 20:01:04 +0000

    lang/rust*: Move the build artifacts out of source
    
    Move the build artifacts out of source to decrease likelihood
    of ccache misses because of changed build directory prefix
    (rustc-1.55.0-src/ vs. rustc-1.56.0-src/) per PR 246245.
---
 lang/rust-bootstrap/Makefile | 1 +
 lang/rust/Makefile           | 1 +
 2 files changed, 2 insertions(+)

diff --git a/lang/rust-bootstrap/Makefile b/lang/rust-bootstrap/Makefile
index e830957fdec0..6e0fa184ffdc 100644
--- a/lang/rust-bootstrap/Makefile
+++ b/lang/rust-bootstrap/Makefile
@@ -96,6 +96,7 @@ do-configure:
 		${SH} ${SCRIPTSDIR}/rust-compat11-canary.sh
 	@${ECHO_CMD} 'changelog-seen=2' > ${WRKSRC}/config.toml
 	@${ECHO_CMD} '[build]' >> ${WRKSRC}/config.toml
+	@${ECHO_CMD} 'build-dir="${WRKDIR}/_build"' >> ${WRKSRC}/config.toml
 	@${ECHO_CMD} 'vendor=true' >> ${WRKSRC}/config.toml
 	@${ECHO_CMD} 'extended=false' >> ${WRKSRC}/config.toml
 	@${ECHO_CMD} 'python="${PYTHON_CMD}"' >> ${WRKSRC}/config.toml
diff --git a/lang/rust/Makefile b/lang/rust/Makefile
index 5a2aee23f2df..fd1f85d6f42f 100644
--- a/lang/rust/Makefile
+++ b/lang/rust/Makefile
@@ -168,6 +168,7 @@ do-configure:
 .endfor
 	@${ECHO_CMD} 'changelog-seen=2' > ${WRKSRC}/config.toml
 	@${ECHO_CMD} '[build]' >> ${WRKSRC}/config.toml
+	@${ECHO_CMD} 'build-dir="${WRKDIR}/_build"' >> ${WRKSRC}/config.toml
 	@${ECHO_CMD} 'build-stage=2' >> ${WRKSRC}/config.toml
 	@${ECHO_CMD} 'doc-stage=2' >> ${WRKSRC}/config.toml
 	@${ECHO_CMD} 'test-stage=2' >> ${WRKSRC}/config.toml