-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-CLIArea: Command-line interface (CLI) to the compilerArea: Command-line interface (CLI) to the compilerC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
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?
Metadata
Metadata
Assignees
Labels
A-CLIArea: Command-line interface (CLI) to the compilerArea: Command-line interface (CLI) to the compilerC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
Noratrieb commentedon Sep 22, 2023
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 commentedon Sep 22, 2023
Case: leading and trailing spaces
(one space after
bar.rs
)diagnostic:
Ignore blank lines in response files
Ignore blank lines in response files
Ignore blank lines in response files
Ignore blank lines in response files
Ignore blank lines in response files
@ninja:path
syntax rust-lang/compiler-team#684jsgf commentedon 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?