forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#118680 - djkoloski:shell_argfiles, r=compiler-errors Add support for shell argfiles Closes rust-lang/compiler-team#684
- Loading branch information
Showing
18 changed files
with
175 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/doc/unstable-book/src/compiler-flags/shell-argfiles.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# `shell-argfiles` | ||
|
||
-------------------- | ||
|
||
The `-Zshell-argfiles` compiler flag allows argfiles to be parsed using POSIX | ||
"shell-style" quoting. When enabled, the compiler will use `shlex` to parse the | ||
arguments from argfiles specified with `@shell:<path>`. | ||
|
||
Because this feature controls the parsing of input arguments, the | ||
`-Zshell-argfiles` flag must be present before the argument specifying the | ||
shell-style arguemnt file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
tests/ui/shell-argfiles/shell-argfiles-badquotes-windows.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Check to see if we can get parameters from an @argsfile file | ||
// | ||
// Path replacement in .stderr files (i.e. `$DIR`) doesn't handle mixed path | ||
// separators. This test uses backslash as the path separator for the command | ||
// line arguments and is only run on windows. | ||
// | ||
// only-windows | ||
// compile-flags: --cfg cmdline_set -Z shell-argfiles @shell:{{src-base}}\shell-argfiles\shell-argfiles-badquotes.args | ||
|
||
fn main() { | ||
} |
2 changes: 2 additions & 0 deletions
2
tests/ui/shell-argfiles/shell-argfiles-badquotes-windows.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
error: Failed to load argument file: Invalid shell-style arguments in $DIR/shell-argfiles-badquotes.args | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"--cfg" "unquoted_set |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Check to see if we can get parameters from an @argsfile file | ||
// | ||
// Path replacement in .stderr files (i.e. `$DIR`) doesn't handle mixed path | ||
// separators. We have a duplicated version of this test that uses backslash as | ||
// the path separator for the command line arguments that is only run on | ||
// windows. | ||
// | ||
// ignore-windows | ||
// compile-flags: --cfg cmdline_set -Z shell-argfiles @shell:{{src-base}}/shell-argfiles/shell-argfiles-badquotes.args | ||
|
||
fn main() { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
error: Failed to load argument file: Invalid shell-style arguments in $DIR/shell-argfiles-badquotes.args | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"--cfg" "shell_args_set" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-Zshell-argfiles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Check to see if we can get parameters from an @argsfile file | ||
// | ||
// build-pass | ||
// compile-flags: @{{src-base}}/shell-argfiles/shell-argfiles-via-argfile.args @shell:{{src-base}}/shell-argfiles/shell-argfiles-via-argfile-shell.args | ||
|
||
#[cfg(not(shell_args_set))] | ||
compile_error!("shell_args_set not set"); | ||
|
||
fn main() { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--cfg unquoted_set | ||
'--cfg' 'single_quoted_set' | ||
"--cfg" "double_quoted_set" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Check to see if we can get parameters from an @argsfile file | ||
// | ||
// build-pass | ||
// compile-flags: --cfg cmdline_set -Z shell-argfiles @shell:{{src-base}}/shell-argfiles/shell-argfiles.args | ||
|
||
#[cfg(not(cmdline_set))] | ||
compile_error!("cmdline_set not set"); | ||
|
||
#[cfg(not(unquoted_set))] | ||
compile_error!("unquoted_set not set"); | ||
|
||
#[cfg(not(single_quoted_set))] | ||
compile_error!("single_quoted_set not set"); | ||
|
||
#[cfg(not(double_quoted_set))] | ||
compile_error!("double_quoted_set not set"); | ||
|
||
fn main() { | ||
} |