Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 943147 - cargo.eclass: add sanity check in cargo_src_compile, perhaps cargo_src_install for if rust_pkg_setup was called
Summary: cargo.eclass: add sanity check in cargo_src_compile, perhaps cargo_src_instal...
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: 2024-11-09 14:25 UTC by Sam James
Modified: 2024-11-11 08:53 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 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-11-09 14:25:23 UTC
bug 943140 (and some others) show that you get a messy failure where ${CARGO} is unset if e.g.

```
inherit cargo

[...]

pkg_setup() { custom_thing }
```

because cargo_src_compile calls ${CARGO} but rust_pkg_setup was never called.

We should add a sanity check in cargo_src_compile (maybe cargo_src_install too and cargo_src_configure) to check if rust_pkg_setup was called. I think the Python eclasses do something similar.
Comment 1 Larry the Git Cow gentoo-dev 2024-11-11 08:53:06 UTC
The bug has been closed via the following commit(s):

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

commit 9393ba8b683e6a055522d81740f94a11a0abfcb4
Author:     Matt Jolly <kangie@gentoo.org>
AuthorDate: 2024-11-10 00:15:54 +0000
Commit:     Matt Jolly <kangie@gentoo.org>
CommitDate: 2024-11-11 08:49:15 +0000

    cargo.eclass: check for and quote `CARGO`
    
    A quick sanity check that `CARGO` is set in appropriate cargo_src_*
    phase functions will make it easier for users to catch occurrences
    where pkg_setup does not call rust_pkg_setup.
    
    Also inherit llvm-r1 if required and let it die instead of us if
    the environment is not properly setup.
    
    Closes: https://bugs.gentoo.org/943147
    Signed-off-by: Matt Jolly <kangie@gentoo.org>

 eclass/cargo.eclass | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)