• [gentoo-dev] [PATCH] cargo.eclass: fix live unpack to use selected carg

    From Eli Schwartz@21:1/5 to All on Fri Apr 4 19:20:01 2025
    Eveywhere, we use ${CARGO} as set by the rust toolchain setup, except
    one place. This caused issues such as erroring out in at least one
    reported case with "cargo: command not found" (when using --root,
    apparently). It would also certainly not respect RUST_MIN_VER /
    RUST_MAX_VER.

    Ensure we consistently use the variable referencing the $CARGO that is definitely guaranteed to exist.

    Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
    ---
    eclass/cargo.eclass | 8 ++++----
    1 file changed, 4 insertions(+), 4 deletions(-)

    diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
    index 95d485ab20c3..d93ae1723470 100644
    --- a/eclass/cargo.eclass
    +++ b/eclass/cargo.eclass
    @@ -603,12 +603,12 @@ cargo_live_src_unpack() {
    export CARGO_HOME="${ECARGO_REGISTRY_DIR}"

    # Absence of quotes around offline arg is intentional, as cargo bails out if it encounters ''
    - einfo "cargo fetch ${offline:+--offline}"
    - cargo fetch ${offline:+--offline} || die #nowarn
    + einfo "${CARGO} fetch ${offline:+--offline}"
    + "${CARGO}" fetch ${offline:+--offline} || die #nowarn

    # Let cargo copy all required crates to "${WORKDIR}" for offline use in later phases.
    - einfo "cargo vendor ${offline:+--offline} ${ECARGO_VENDOR}"
    - cargo vendor ${offline:+--offline} "${ECARGO_VENDOR}" || die #nowarn
    + einfo "${CARGO} vendor ${offline:+--offline} ${ECARGO_VENDOR}"
    + "${CARGO}" vendor ${offline:+--offline} "${ECARGO_VENDOR}" || die #nowarn

    # Users may
  • From Sam James@21:1/5 to All on Fri Apr 4 19:20:01 2025
    From: Eli Schwartz <eschwartz@gentoo.org>

    Eveywhere, we use ${CARGO} as set by the rust toolchain setup, except
    one place. This caused issues such as erroring out in at least one
    reported case with "cargo: command not found" (when using --root,
    apparently). It would also certainly not respect RUST_MIN_VER /
    RUST_MAX_VER.

    Ensure we consistently use the variable referencing the $CARGO that is definitely guaranteed to exist.

    Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
    Signed-off-by: Sam James <sam@gentoo.org>
    ---
    I've pushed this.

    eclass/cargo.eclass | 8 ++++----
    1 file changed, 4 insertions(+), 4 deletions(-)

    diff --git a/eclass/cargo.eclass b/eclass/cargo.eclass
    index 95d485ab20c34..d93ae1723470a 100644
    --- a/eclass/cargo.eclass
    +++ b/eclass/cargo.eclass
    @@ -603,12 +603,12 @@ cargo_live_src_unpack() {
    export CARGO_HOME="${ECARGO_REGISTRY_DIR}"

    # Absence of quotes around offline arg is intentional, as cargo bails out if it encounters ''
    - einfo "cargo fetch ${offline:+--offline}"
    - cargo fetch ${offline:+--offline} || die #nowarn
    + einfo "${CARGO} fetch ${offline:+--offline}"
    + "${CARGO}" fetch ${offline:+--offline} || die #nowarn

    # Let cargo copy all required crates to "${WORKDIR}" for offline use in later phases.
    - einfo "cargo vendor ${offline:+--offline} ${ECARGO_VENDOR}"
    - cargo vendor ${offline:+--offline} "${ECARGO_VENDOR}" || die #nowarn
    + einfo "${CARGO} vendor ${offline:+--offline} ${ECARGO_VENDOR}"
    + "${CARGO}" vendor ${offline:+--offline} "${ECARGO_VENDOR}" || die #n