From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 96D951580E0 for ; Wed, 04 Jun 2025 00:17:43 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 77A60343268 for ; Wed, 04 Jun 2025 00:17:43 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 6D1801102CD; Wed, 04 Jun 2025 00:17:42 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 6500B1102CD for ; Wed, 04 Jun 2025 00:17:42 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id EE95A343121 for ; Wed, 04 Jun 2025 00:17:41 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8C6A91397 for ; Wed, 04 Jun 2025 00:17:40 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748996248.8c4eca6e14e4fd5d531ba2a4dce18271689e341f.kangie@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/rust/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-lang/rust/rust-1.74.1-r101.ebuild dev-lang/rust/rust-1.75.0-r101.ebuild dev-lang/rust/rust-1.76.0-r101.ebuild dev-lang/rust/rust-1.77.1-r101.ebuild dev-lang/rust/rust-1.78.0-r101.ebuild dev-lang/rust/rust-1.79.0-r101.ebuild dev-lang/rust/rust-1.80.1-r101.ebuild dev-lang/rust/rust-1.81.0-r101.ebuild dev-lang/rust/rust-1.82.0-r103.ebuild dev-lang/rust/rust-1.83.0-r3.ebuild dev-lang/rust/rust-1.84.0-r2.ebuild dev-lang/rust/rust-1.84.1-r2.ebuild dev-lang/rust/rust-1.85.0-r2.ebuild dev-lang/rust/rust-1.85.1-r1.ebuild dev-lang/rust/rust-1.86.0-r2.ebuild dev-lang/rust/rust-1.87.0-r1.ebuild dev-lang/rust/rust-1.88.0_beta20250526.ebuild dev-lang/rust/rust-9999.ebuild X-VCS-Directories: dev-lang/rust/ X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 8c4eca6e14e4fd5d531ba2a4dce18271689e341f X-VCS-Branch: master Date: Wed, 04 Jun 2025 00:17:40 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 7622278c-52c4-46a9-8cbb-db83ecb91ae6 X-Archives-Hash: ee8acb0bf1780b23f4d53bd39a5a7940 commit: 8c4eca6e14e4fd5d531ba2a4dce18271689e341f Author: Matt Jolly gentoo org> AuthorDate: Wed Jun 4 00:12:44 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Wed Jun 4 00:17:28 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8c4eca6e dev-lang/rust: actually fix verify sig My previous fix didn't actually unpack tarballs at all. Signed-off-by: Matt Jolly gentoo.org> dev-lang/rust/rust-1.74.1-r101.ebuild | 1 + dev-lang/rust/rust-1.75.0-r101.ebuild | 1 + dev-lang/rust/rust-1.76.0-r101.ebuild | 1 + dev-lang/rust/rust-1.77.1-r101.ebuild | 1 + dev-lang/rust/rust-1.78.0-r101.ebuild | 1 + dev-lang/rust/rust-1.79.0-r101.ebuild | 1 + dev-lang/rust/rust-1.80.1-r101.ebuild | 1 + dev-lang/rust/rust-1.81.0-r101.ebuild | 1 + dev-lang/rust/rust-1.82.0-r103.ebuild | 1 + dev-lang/rust/rust-1.83.0-r3.ebuild | 1 + dev-lang/rust/rust-1.84.0-r2.ebuild | 1 + dev-lang/rust/rust-1.84.1-r2.ebuild | 1 + dev-lang/rust/rust-1.85.0-r2.ebuild | 1 + dev-lang/rust/rust-1.85.1-r1.ebuild | 1 + dev-lang/rust/rust-1.86.0-r2.ebuild | 1 + dev-lang/rust/rust-1.87.0-r1.ebuild | 1 + dev-lang/rust/rust-1.88.0_beta20250526.ebuild | 133 +++++++++++++------------- dev-lang/rust/rust-9999.ebuild | 133 +++++++++++++------------- 18 files changed, 150 insertions(+), 132 deletions(-) diff --git a/dev-lang/rust/rust-1.74.1-r101.ebuild b/dev-lang/rust/rust-1.74.1-r101.ebuild index abdf7f5ecc95..628025aa05b1 100644 --- a/dev-lang/rust/rust-1.74.1-r101.ebuild +++ b/dev-lang/rust/rust-1.74.1-r101.ebuild @@ -257,6 +257,7 @@ src_unpack() { if use verify-sig ; then # Patch tarballs are not signed (but we trust Gentoo infra) verify-sig_verify_detached "${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc} + default else default fi diff --git a/dev-lang/rust/rust-1.75.0-r101.ebuild b/dev-lang/rust/rust-1.75.0-r101.ebuild index 26405e53fed7..e9cee1beb3ad 100644 --- a/dev-lang/rust/rust-1.75.0-r101.ebuild +++ b/dev-lang/rust/rust-1.75.0-r101.ebuild @@ -236,6 +236,7 @@ src_unpack() { if use verify-sig ; then # Patch tarballs are not signed (but we trust Gentoo infra) verify-sig_verify_detached "${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc} + default else default fi diff --git a/dev-lang/rust/rust-1.76.0-r101.ebuild b/dev-lang/rust/rust-1.76.0-r101.ebuild index 8b54d6c710ab..0fa6ce8719b3 100644 --- a/dev-lang/rust/rust-1.76.0-r101.ebuild +++ b/dev-lang/rust/rust-1.76.0-r101.ebuild @@ -236,6 +236,7 @@ src_unpack() { if use verify-sig ; then # Patch tarballs are not signed (but we trust Gentoo infra) verify-sig_verify_detached "${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc} + default else default fi diff --git a/dev-lang/rust/rust-1.77.1-r101.ebuild b/dev-lang/rust/rust-1.77.1-r101.ebuild index acb8052bd019..1e9f37df64a8 100644 --- a/dev-lang/rust/rust-1.77.1-r101.ebuild +++ b/dev-lang/rust/rust-1.77.1-r101.ebuild @@ -236,6 +236,7 @@ src_unpack() { if use verify-sig ; then # Patch tarballs are not signed (but we trust Gentoo infra) verify-sig_verify_detached "${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc} + default else default fi diff --git a/dev-lang/rust/rust-1.78.0-r101.ebuild b/dev-lang/rust/rust-1.78.0-r101.ebuild index c00dc2197433..5df806d0e53f 100644 --- a/dev-lang/rust/rust-1.78.0-r101.ebuild +++ b/dev-lang/rust/rust-1.78.0-r101.ebuild @@ -236,6 +236,7 @@ src_unpack() { if use verify-sig ; then # Patch tarballs are not signed (but we trust Gentoo infra) verify-sig_verify_detached "${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc} + default else default fi diff --git a/dev-lang/rust/rust-1.79.0-r101.ebuild b/dev-lang/rust/rust-1.79.0-r101.ebuild index e0bfc9029822..bbfa1e14cc8c 100644 --- a/dev-lang/rust/rust-1.79.0-r101.ebuild +++ b/dev-lang/rust/rust-1.79.0-r101.ebuild @@ -236,6 +236,7 @@ src_unpack() { if use verify-sig ; then # Patch tarballs are not signed (but we trust Gentoo infra) verify-sig_verify_detached "${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc} + default else default fi diff --git a/dev-lang/rust/rust-1.80.1-r101.ebuild b/dev-lang/rust/rust-1.80.1-r101.ebuild index 3b705ff6d682..f0e7ed055fd7 100644 --- a/dev-lang/rust/rust-1.80.1-r101.ebuild +++ b/dev-lang/rust/rust-1.80.1-r101.ebuild @@ -236,6 +236,7 @@ src_unpack() { if use verify-sig ; then # Patch tarballs are not signed (but we trust Gentoo infra) verify-sig_verify_detached "${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc} + default else default fi diff --git a/dev-lang/rust/rust-1.81.0-r101.ebuild b/dev-lang/rust/rust-1.81.0-r101.ebuild index 1ad21ab60453..95109eb6f35c 100644 --- a/dev-lang/rust/rust-1.81.0-r101.ebuild +++ b/dev-lang/rust/rust-1.81.0-r101.ebuild @@ -237,6 +237,7 @@ src_unpack() { if use verify-sig ; then # Patch tarballs are not signed (but we trust Gentoo infra) verify-sig_verify_detached "${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc} + default else default fi diff --git a/dev-lang/rust/rust-1.82.0-r103.ebuild b/dev-lang/rust/rust-1.82.0-r103.ebuild index e6d6b82f4393..a8843ba7658b 100644 --- a/dev-lang/rust/rust-1.82.0-r103.ebuild +++ b/dev-lang/rust/rust-1.82.0-r103.ebuild @@ -236,6 +236,7 @@ src_unpack() { if use verify-sig ; then # Patch tarballs are not signed (but we trust Gentoo infra) verify-sig_verify_detached "${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc} + default else default fi diff --git a/dev-lang/rust/rust-1.83.0-r3.ebuild b/dev-lang/rust/rust-1.83.0-r3.ebuild index 943430d9e492..26c3fd9cd432 100644 --- a/dev-lang/rust/rust-1.83.0-r3.ebuild +++ b/dev-lang/rust/rust-1.83.0-r3.ebuild @@ -236,6 +236,7 @@ src_unpack() { if use verify-sig ; then # Patch tarballs are not signed (but we trust Gentoo infra) verify-sig_verify_detached "${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc} + default else default fi diff --git a/dev-lang/rust/rust-1.84.0-r2.ebuild b/dev-lang/rust/rust-1.84.0-r2.ebuild index 84dbe3dcaca1..cf33912dd153 100644 --- a/dev-lang/rust/rust-1.84.0-r2.ebuild +++ b/dev-lang/rust/rust-1.84.0-r2.ebuild @@ -242,6 +242,7 @@ src_unpack() { if use verify-sig ; then # Patch tarballs are not signed (but we trust Gentoo infra) verify-sig_verify_detached "${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc} + default else default fi diff --git a/dev-lang/rust/rust-1.84.1-r2.ebuild b/dev-lang/rust/rust-1.84.1-r2.ebuild index 24b11fadae0c..dcf73b9a9264 100644 --- a/dev-lang/rust/rust-1.84.1-r2.ebuild +++ b/dev-lang/rust/rust-1.84.1-r2.ebuild @@ -242,6 +242,7 @@ src_unpack() { if use verify-sig ; then # Patch tarballs are not signed (but we trust Gentoo infra) verify-sig_verify_detached "${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc} + default else default fi diff --git a/dev-lang/rust/rust-1.85.0-r2.ebuild b/dev-lang/rust/rust-1.85.0-r2.ebuild index e5c063cb1b2c..1b324dac1ca9 100644 --- a/dev-lang/rust/rust-1.85.0-r2.ebuild +++ b/dev-lang/rust/rust-1.85.0-r2.ebuild @@ -222,6 +222,7 @@ src_unpack() { elif use verify-sig ; then # Patch tarballs are not signed (but we trust Gentoo infra) verify-sig_verify_detached "${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc} + default else default fi diff --git a/dev-lang/rust/rust-1.85.1-r1.ebuild b/dev-lang/rust/rust-1.85.1-r1.ebuild index 6c827a53b625..b4b88abc8398 100644 --- a/dev-lang/rust/rust-1.85.1-r1.ebuild +++ b/dev-lang/rust/rust-1.85.1-r1.ebuild @@ -222,6 +222,7 @@ src_unpack() { elif use verify-sig ; then # Patch tarballs are not signed (but we trust Gentoo infra) verify-sig_verify_detached "${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc} + default else default fi diff --git a/dev-lang/rust/rust-1.86.0-r2.ebuild b/dev-lang/rust/rust-1.86.0-r2.ebuild index 44ad501524ac..47274a631639 100644 --- a/dev-lang/rust/rust-1.86.0-r2.ebuild +++ b/dev-lang/rust/rust-1.86.0-r2.ebuild @@ -223,6 +223,7 @@ src_unpack() { elif use verify-sig ; then # Patch tarballs are not signed (but we trust Gentoo infra) verify-sig_verify_detached "${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc} + default else default fi diff --git a/dev-lang/rust/rust-1.87.0-r1.ebuild b/dev-lang/rust/rust-1.87.0-r1.ebuild index cb439e94b235..b1d86a75ce62 100644 --- a/dev-lang/rust/rust-1.87.0-r1.ebuild +++ b/dev-lang/rust/rust-1.87.0-r1.ebuild @@ -224,6 +224,7 @@ src_unpack() { elif use verify-sig ; then # Patch tarballs are not signed (but we trust Gentoo infra) verify-sig_verify_detached "${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc} + default else default fi diff --git a/dev-lang/rust/rust-1.88.0_beta20250526.ebuild b/dev-lang/rust/rust-1.88.0_beta20250526.ebuild index c1aa7b039b94..acd1b3fdb8d8 100644 --- a/dev-lang/rust/rust-1.88.0_beta20250526.ebuild +++ b/dev-lang/rust/rust-1.88.0_beta20250526.ebuild @@ -175,72 +175,6 @@ toml_usex() { usex "${1}" true false } -rust_live_get_sources() { - EGIT_REPO_URI=" - https://anongit.gentoo.org/git/proj/rust-patches.git - " - EGIT_CHECKOUT_DIR="${WORKDIR}/rust-patches-${RUST_PATCH_VER}" - git-r3_src_unpack - - EGIT_REPO_URI=" - https://github.com/rust-lang/rust.git - " - EGIT_SUBMODULES=( - "*" - "-src/gcc" - ) - S="${WORKDIR}/rust" - EGIT_CHECKOUT_DIR="${S}" - git-r3_src_unpack -} - -src_unpack() { - if [[ ${PV} == *9999* ]] ; then - rust_live_get_sources - - # Vendor dependencies - mkdir "${S}/.cargo" || die # The vendor script has a check for .cargo/config{,.toml} - touch "${S}/.cargo/bootstrap.toml" || die - local rust_stage0_root="$(${RUSTC} --print sysroot || die "Can't determine rust's sysroot")" - # Configure vendor to use the portage-provided toolchain. This prevents it from - # attempting to fetch a `beta` toolchain from the internet. - cat <<- _EOF_ > "${T}/vendor-bootstrap.toml" - # Suppresses a warning about tracking changes which we don't care about. - change-id = "ignore" - [build] - build = "$(rust_abi "${CBUILD}")" - host = ["$(rust_abi "${CHOST}")"] - target = ["$(rust_abi "${CHOST}")"] - cargo = "${rust_stage0_root}/bin/cargo" - rustc = "${rust_stage0_root}/bin/rustc" - rustfmt = "${rust_stage0_root}/bin/rustfmt" - _EOF_ - # We're using git sources so we need to run the Vendor script - # to ensure that all dependencies are present and up-to-date - mkdir "${S}/vendor" || die - # This also compiles the 'build helper', there's no way to avoid this. - ${EPYTHON} "${S}"/x.py vendor -v --config="${T}"/vendor-bootstrap.toml -j$(makeopts_jobs) || - die "Failed to vendor dependencies" - # TODO: This has to be generated somehow, this is from a 1.84.x tarball I had lying around. - cat <<- _EOF_ > "${S}/.cargo/config.toml" - [source.crates-io] - replace-with = "vendored-sources" - - [source."git+https://github.com/rust-lang/team"] - git = "https://github.com/rust-lang/team" - replace-with = "vendored-sources" - - [source.vendored-sources] - directory = "vendor" - _EOF_ - elif use verify-sig ; then - # Patch tarballs are not signed (but we trust Gentoo infra) - verify-sig_verify_detached "${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc} - else - default - fi -} - pre_build_checks() { local M=9216 # multiply requirements by 1.3 if we are doing x86-multilib @@ -313,6 +247,73 @@ pkg_setup() { fi } +rust_live_get_sources() { + EGIT_REPO_URI=" + https://anongit.gentoo.org/git/proj/rust-patches.git + " + EGIT_CHECKOUT_DIR="${WORKDIR}/rust-patches-${RUST_PATCH_VER}" + git-r3_src_unpack + + EGIT_REPO_URI=" + https://github.com/rust-lang/rust.git + " + EGIT_SUBMODULES=( + "*" + "-src/gcc" + ) + S="${WORKDIR}/rust" + EGIT_CHECKOUT_DIR="${S}" + git-r3_src_unpack +} + +src_unpack() { + if [[ ${PV} == *9999* ]] ; then + rust_live_get_sources + + # Vendor dependencies + mkdir "${S}/.cargo" || die # The vendor script has a check for .cargo/config{,.toml} + touch "${S}/.cargo/bootstrap.toml" || die + local rust_stage0_root="$(${RUSTC} --print sysroot || die "Can't determine rust's sysroot")" + # Configure vendor to use the portage-provided toolchain. This prevents it from + # attempting to fetch a `beta` toolchain from the internet. + cat <<- _EOF_ > "${T}/vendor-bootstrap.toml" + # Suppresses a warning about tracking changes which we don't care about. + change-id = "ignore" + [build] + build = "$(rust_abi "${CBUILD}")" + host = ["$(rust_abi "${CHOST}")"] + target = ["$(rust_abi "${CHOST}")"] + cargo = "${rust_stage0_root}/bin/cargo" + rustc = "${rust_stage0_root}/bin/rustc" + rustfmt = "${rust_stage0_root}/bin/rustfmt" + _EOF_ + # We're using git sources so we need to run the Vendor script + # to ensure that all dependencies are present and up-to-date + mkdir "${S}/vendor" || die + # This also compiles the 'build helper', there's no way to avoid this. + ${EPYTHON} "${S}"/x.py vendor -v --config="${T}"/vendor-bootstrap.toml -j$(makeopts_jobs) || + die "Failed to vendor dependencies" + # TODO: This has to be generated somehow, this is from a 1.84.x tarball I had lying around. + cat <<- _EOF_ > "${S}/.cargo/config.toml" + [source.crates-io] + replace-with = "vendored-sources" + + [source."git+https://github.com/rust-lang/team"] + git = "https://github.com/rust-lang/team" + replace-with = "vendored-sources" + + [source.vendored-sources] + directory = "vendor" + _EOF_ + elif use verify-sig ; then + # Patch tarballs are not signed (but we trust Gentoo infra) + verify-sig_verify_detached "${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc} + default + else + default + fi +} + src_prepare() { if [[ ${PV} = *9999* ]]; then # We need to update / generate lockfiles for the workspace diff --git a/dev-lang/rust/rust-9999.ebuild b/dev-lang/rust/rust-9999.ebuild index c1aa7b039b94..acd1b3fdb8d8 100644 --- a/dev-lang/rust/rust-9999.ebuild +++ b/dev-lang/rust/rust-9999.ebuild @@ -175,72 +175,6 @@ toml_usex() { usex "${1}" true false } -rust_live_get_sources() { - EGIT_REPO_URI=" - https://anongit.gentoo.org/git/proj/rust-patches.git - " - EGIT_CHECKOUT_DIR="${WORKDIR}/rust-patches-${RUST_PATCH_VER}" - git-r3_src_unpack - - EGIT_REPO_URI=" - https://github.com/rust-lang/rust.git - " - EGIT_SUBMODULES=( - "*" - "-src/gcc" - ) - S="${WORKDIR}/rust" - EGIT_CHECKOUT_DIR="${S}" - git-r3_src_unpack -} - -src_unpack() { - if [[ ${PV} == *9999* ]] ; then - rust_live_get_sources - - # Vendor dependencies - mkdir "${S}/.cargo" || die # The vendor script has a check for .cargo/config{,.toml} - touch "${S}/.cargo/bootstrap.toml" || die - local rust_stage0_root="$(${RUSTC} --print sysroot || die "Can't determine rust's sysroot")" - # Configure vendor to use the portage-provided toolchain. This prevents it from - # attempting to fetch a `beta` toolchain from the internet. - cat <<- _EOF_ > "${T}/vendor-bootstrap.toml" - # Suppresses a warning about tracking changes which we don't care about. - change-id = "ignore" - [build] - build = "$(rust_abi "${CBUILD}")" - host = ["$(rust_abi "${CHOST}")"] - target = ["$(rust_abi "${CHOST}")"] - cargo = "${rust_stage0_root}/bin/cargo" - rustc = "${rust_stage0_root}/bin/rustc" - rustfmt = "${rust_stage0_root}/bin/rustfmt" - _EOF_ - # We're using git sources so we need to run the Vendor script - # to ensure that all dependencies are present and up-to-date - mkdir "${S}/vendor" || die - # This also compiles the 'build helper', there's no way to avoid this. - ${EPYTHON} "${S}"/x.py vendor -v --config="${T}"/vendor-bootstrap.toml -j$(makeopts_jobs) || - die "Failed to vendor dependencies" - # TODO: This has to be generated somehow, this is from a 1.84.x tarball I had lying around. - cat <<- _EOF_ > "${S}/.cargo/config.toml" - [source.crates-io] - replace-with = "vendored-sources" - - [source."git+https://github.com/rust-lang/team"] - git = "https://github.com/rust-lang/team" - replace-with = "vendored-sources" - - [source.vendored-sources] - directory = "vendor" - _EOF_ - elif use verify-sig ; then - # Patch tarballs are not signed (but we trust Gentoo infra) - verify-sig_verify_detached "${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc} - else - default - fi -} - pre_build_checks() { local M=9216 # multiply requirements by 1.3 if we are doing x86-multilib @@ -313,6 +247,73 @@ pkg_setup() { fi } +rust_live_get_sources() { + EGIT_REPO_URI=" + https://anongit.gentoo.org/git/proj/rust-patches.git + " + EGIT_CHECKOUT_DIR="${WORKDIR}/rust-patches-${RUST_PATCH_VER}" + git-r3_src_unpack + + EGIT_REPO_URI=" + https://github.com/rust-lang/rust.git + " + EGIT_SUBMODULES=( + "*" + "-src/gcc" + ) + S="${WORKDIR}/rust" + EGIT_CHECKOUT_DIR="${S}" + git-r3_src_unpack +} + +src_unpack() { + if [[ ${PV} == *9999* ]] ; then + rust_live_get_sources + + # Vendor dependencies + mkdir "${S}/.cargo" || die # The vendor script has a check for .cargo/config{,.toml} + touch "${S}/.cargo/bootstrap.toml" || die + local rust_stage0_root="$(${RUSTC} --print sysroot || die "Can't determine rust's sysroot")" + # Configure vendor to use the portage-provided toolchain. This prevents it from + # attempting to fetch a `beta` toolchain from the internet. + cat <<- _EOF_ > "${T}/vendor-bootstrap.toml" + # Suppresses a warning about tracking changes which we don't care about. + change-id = "ignore" + [build] + build = "$(rust_abi "${CBUILD}")" + host = ["$(rust_abi "${CHOST}")"] + target = ["$(rust_abi "${CHOST}")"] + cargo = "${rust_stage0_root}/bin/cargo" + rustc = "${rust_stage0_root}/bin/rustc" + rustfmt = "${rust_stage0_root}/bin/rustfmt" + _EOF_ + # We're using git sources so we need to run the Vendor script + # to ensure that all dependencies are present and up-to-date + mkdir "${S}/vendor" || die + # This also compiles the 'build helper', there's no way to avoid this. + ${EPYTHON} "${S}"/x.py vendor -v --config="${T}"/vendor-bootstrap.toml -j$(makeopts_jobs) || + die "Failed to vendor dependencies" + # TODO: This has to be generated somehow, this is from a 1.84.x tarball I had lying around. + cat <<- _EOF_ > "${S}/.cargo/config.toml" + [source.crates-io] + replace-with = "vendored-sources" + + [source."git+https://github.com/rust-lang/team"] + git = "https://github.com/rust-lang/team" + replace-with = "vendored-sources" + + [source.vendored-sources] + directory = "vendor" + _EOF_ + elif use verify-sig ; then + # Patch tarballs are not signed (but we trust Gentoo infra) + verify-sig_verify_detached "${DISTDIR}"/rustc-${PV}-src.tar.xz{,.asc} + default + else + default + fi +} + src_prepare() { if [[ ${PV} = *9999* ]]; then # We need to update / generate lockfiles for the workspace