-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
The output from cargo package --list
is not good for workspaces
#13953
Comments
@rustbot label: +Command-package, +A-cli, +S-needs-design |
This is likely broken enough that we can change behavior. I wonder if we should just error in this case. If we had json output, then I could see specializing the list per package. |
See #11666 for json output |
One approach that is probably better than an error message would be this:
|
I think a lot depends on what we consider the output intended to be. The current single-crate output is used programmatically. Extending the format with a per-crate header extends what we are offering. This is why I was looking to crate output. |
### What does this PR try to resolve? This adds a special case for checking source files are symlinks and have been modified when under a VCS control This is required because those paths may link to a file outside the current package root, but still under the git workdir, affecting the final packaged `.crate` file. ### How should we test and review this PR? Pretty similar to #14966, as a part of #14967. This may have potential performance issue. If a package contains thousands of symlinks, Cargo will fire `git status` for each of them. Not sure if we want to do anything proactively now. The introduction of the `PathEntry` struct gives us more room for storing file metadata to satisfiy use cases in the future. For instances, * Knowing a source file is a symlink and resolving it when packaging on Windows * #5664 * #14965 * Knowing more about a file's metadata (e.g. permission bits from Git) * #4413 * #8006 * Provide richer information for `cargo package --list`, for example JSON output mode * #11666 * #13331 * #13953
Problem
This issue was discovered when working on #13947, but the problem is also on
master
.When run in a workspace root directory,
cargo package --list
outputs something like this:It doesn't indicate that half the files are from one crate, and the other half from another crate.
The question is how to improve this in a way that is backward compatible. It is likely that the current output is used by CI/CD scripts, and should ideally stay as it is when packaging single crates.
Steps
No response
Possible Solution(s)
No response
Notes
No response
Version
The text was updated successfully, but these errors were encountered: