Skip to content

[rustc] Tolerate spaces and blanks inside @response files #116068

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

Open
fangism opened this issue Sep 22, 2023 · 3 comments
Open

[rustc] Tolerate spaces and blanks inside @response files #116068

fangism opened this issue Sep 22, 2023 · 3 comments
Labels
A-CLI Area: Command-line interface (CLI) to the compiler C-feature-request Category: A feature request, i.e: not implemented / a PR. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@fangism
Copy link

fangism commented Sep 22, 2023

We have build tooling that generates rust command-line arguments inside response files, passed like rustc @args.rsp.
In some cases, the tool emits response files with empty lines, or lines that contain only a single space.

Case (second line is a single space):

foo.rs
 

diagnostic:

error: multiple input filenames provided (first two filenames are `foo.rs` and ` `)

Case (second line is blank):

foo.rs

diagnostic:

error: multiple input filenames provided (first two filenames are `foo.rs` and ``)

Could the rustc compiler be updated to ignore space-only and blank lines in response files?

@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 22, 2023
@Noratrieb Noratrieb added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-feature-request Category: A feature request, i.e: not implemented / a PR. A-CLI Area: Command-line interface (CLI) to the compiler and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Sep 22, 2023
@Noratrieb
Copy link
Member

Sounds reasonable to me, feel free to send in a PR. The PR would need an FCP from the compiler team because this is stable behavior. A compiler major change proposal is probably not needed because this is so small.

@fangism
Copy link
Author

fangism commented Sep 22, 2023

Case: leading and trailing spaces

 foo.rs
bar.rs 

(one space after bar.rs)

diagnostic:

error: multiple input filenames provided (first two filenames are ` foo.rs` and `bar.rs `)

P1n3appl3 added a commit to P1n3appl3/rust that referenced this issue Oct 10, 2023
P1n3appl3 added a commit to P1n3appl3/rust that referenced this issue Oct 10, 2023
P1n3appl3 added a commit to P1n3appl3/rust that referenced this issue Oct 10, 2023
P1n3appl3 added a commit to P1n3appl3/rust that referenced this issue Oct 10, 2023
P1n3appl3 added a commit to P1n3appl3/rust that referenced this issue Oct 10, 2023
@jsgf
Copy link
Contributor

jsgf commented Oct 27, 2023

Rustc args files are intended to contain verbatim command line args, one per line. If you're generating spurious spaces or blank lines, you're not generating valid args files. So stripping out blank lines or "extra" whitespace is explicitly not a valid operation to perform on args files.

Can't you just update the generator to generate valid args files in the first place? What's the generator in this case?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CLI Area: Command-line interface (CLI) to the compiler C-feature-request Category: A feature request, i.e: not implemented / a PR. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants