Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo package --list issue with relative path #1431

Closed
messense opened this issue Jan 28, 2023 · 3 comments · Fixed by #1741
Closed

cargo package --list issue with relative path #1431

messense opened this issue Jan 28, 2023 · 3 comments · Fixed by #1741
Labels
sdist Source distribution

Comments

@messense
Copy link
Member

While investigating conda-forge/ruff-feedstock#84 (comment), I found that cargo package --list behaves weird when relative path is used in metadata, for example ruff_cli specifies readme = "../README.md", but cargo package --list outputs

$ cargo package --list --manifest-path ruff_cli/Cargo.toml 2>/dev/null
.cargo_vcs_info.json
Cargo.lock
Cargo.toml
Cargo.toml.orig
README.md
src/args.rs
src/cache.rs
src/commands.rs
src/diagnostics.rs
src/iterators.rs
src/lib.rs
src/main.rs
src/printer.rs
src/resolve.rs
src/updates.rs
tests/black_compatibility_test.rs
tests/integration_test.rs

The result is that the README.md is missing from top level directory in sdist.

@konstin
Copy link
Member

konstin commented Jan 28, 2023

this seems partially by design (rust-lang/cargo#7938 (comment)). i think we should ask the cargo developers for an option specifically for tool such as maturin that prints all paths that cargo would include (and in the meantime use custom workarounds)

@messense
Copy link
Member Author

messense commented Jan 28, 2023

Right, cargo package without --list isn't a viable option for us since there might be non-crates.io path dependencies without version.

https://doc.rust-lang.org/cargo/commands/cargo-package.html#description

@messense
Copy link
Member Author

messense commented Sep 5, 2023

Relative readme field is no longer an issue after #1741.

We're effectively using cargo metadata | jq '.packages[] | select(.name == "<package-name>") | .readme' to get the path. See also rust-lang/cargo#11666 (comment)

@messense messense closed this as completed Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sdist Source distribution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants