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: please provide a --list0 option to print NUL-terminated filenames #3306

Open
joshtriplett opened this issue Nov 21, 2016 · 5 comments
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-package S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request.

Comments

@joshtriplett
Copy link
Member

joshtriplett commented Nov 21, 2016

cargo package --list lists all the filenames the .crate file would include, followed by newlines. A crate could potentially include a file whose name includes a newline, such as for test data. Please consider providing a cargo package --list0 option to list filenames followed by NUL characters instead of newlines.

(After adding such an option, cargo package --list should probably fail with an error and no other output if any filename includes a newline, to catch errors.)

@alexcrichton
Copy link
Member

Sounds plausible to me!

@tbu-
Copy link
Contributor

tbu- commented Nov 21, 2016

Or we could disallow these characters. I haven't seen legitimate use cases for file names with newlines in them, @joshtriplett do you know any?

@joshtriplett
Copy link
Member Author

On November 21, 2016 2:59:03 PM PST, tbu- [email protected] wrote:

Or we could disallow these characters. I haven't seen legitimate use
cases for file names with newlines in them, @joshtriplett do you know
any?

Test cases; no other legitimate use that I can think of.

@carols10cents carols10cents added C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-package labels Sep 29, 2017
@epage epage added the S-triage Status: This issue is waiting on initial triage. label Oct 11, 2023
@weihanglo weihanglo added S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request. and removed S-triage Status: This issue is waiting on initial triage. labels Dec 29, 2024
@weihanglo
Copy link
Member

weihanglo commented Dec 29, 2024

What should Cargo do for packaging a multi-package workspace for this list mode? Can JSON output (#11666) cover the use case of this?

@epage
Copy link
Contributor

epage commented Dec 30, 2024

FYI the issue for cargo package --workspace --list is #13953.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` Command-package S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request.
Projects
None yet
Development

No branches or pull requests

6 participants