Skip to content
This repository has been archived by the owner on Jul 21, 2022. It is now read-only.

Why does cargo-rpm scan for files in src/bin instead of reading the Cargo.toml spec? #54

Closed
stevenroose opened this issue Apr 15, 2020 · 3 comments

Comments

@stevenroose
Copy link
Contributor

Cargo.toml has these fields right?

[lib]
name = "hal"
path = "src/lib.rs"

[[bin]]
name = "hal"
path = "src/bin/hal/main.rs"
@tarcieri
Copy link
Contributor

This information is typically inferred from the project structure.

As I suggested in #53, using cargo metadata (perhaps parsed via the cargo_metadata crate) for this allows us to source this information from cargo itself.

@tarcieri
Copy link
Contributor

tarcieri commented Jul 9, 2020

Note that #46 added an initial integration with cargo_metadata. That said, right now it's only used to locate the target/ directory.

However, it can also be used to introspect the targets for a particular package:

https://docs.rs/cargo_metadata/0.10.0/cargo_metadata/struct.Package.html#structfield.targets

To address this issue, the existing code that enumerates TargetType::MultiBin using fs::read_dir should be replaced by enumerating the cargo_metadata::Target entries for a particular cargo_metadata::Package.

tofay added a commit to tofay/cargo-rpm that referenced this issue Nov 23, 2021
Allows cargo-rpm to work with projects that have directories
in src/bin/.
Add support for packaging cdylibs into /usr/lib64

Fixes iqlusioninc#54
@tony-iqlusion
Copy link
Member

cargo-rpm is unmaintained: #96

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants