Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 953532 - cargo.eclass: does not check if rust_pkg_setup was called in cargo_live_src_unpack
Summary: cargo.eclass: does not check if rust_pkg_setup was called in cargo_live_src_u...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Rust Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-10 18:58 UTC by Christopher Fore
Modified: 2025-04-19 01:31 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Fore 2025-04-10 18:58:15 UTC
Currently cargo.eclass does not check if rust_pkg_setup was called in cargo_live_src_unpack, leading to situations where vague build errors can show up.

This behavior can be seen in bug 953515.

Quoting Sam:

"""
We need to call rust_pkg_setup in bcachefs-tools, but we should maybe add a sanity check like other cargo phases too:

        if [[ -z "${CARGO}" ]]; then
                die "CARGO is not set; was rust_pkg_setup run?"
        fi
"""
Comment 1 Larry the Git Cow gentoo-dev 2025-04-19 01:31:07 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba3dffd3228188acf098b06d73059f1b02e69cfc

commit ba3dffd3228188acf098b06d73059f1b02e69cfc
Author:     Christopher Fore <csfore@posteo.net>
AuthorDate: 2025-04-13 00:53:50 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-04-19 01:30:37 +0000

    cargo.eclass: Add _cargo_check_initialized to cargo_live_src_unpack
    
    Currently cargo.eclass does not check if rust_pkg_setup was called in
    cargo_live_src_unpack, leading to situations where vague build errors
    can show up.
    
    Closes: https://bugs.gentoo.org/953532
    Bug: https://bugs.gentoo.org/953515
    Signed-off-by: Christopher Fore <csfore@posteo.net>
    Signed-off-by: Sam James <sam@gentoo.org>

 eclass/cargo.eclass | 2 ++
 1 file changed, 2 insertions(+)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e7aa0ac74a17f3b404103a42cfd24525c1e9cc2f

commit e7aa0ac74a17f3b404103a42cfd24525c1e9cc2f
Author:     Christopher Fore <csfore@posteo.net>
AuthorDate: 2025-04-13 00:53:49 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-04-19 01:30:31 +0000

    cargo.eclass: Pull check for rust_pkg_setup into its own function
    
    This reduces repetitiveness and allows for easier maintainability in the
    future.
    
    Bug: https://bugs.gentoo.org/953515
    Bug: https://bugs.gentoo.org/953532
    Signed-off-by: Christopher Fore <csfore@posteo.net>
    Signed-off-by: Sam James <sam@gentoo.org>

 eclass/cargo.eclass | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)