-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add --cfg and --rustc-cfg flags to output compiler configuration #9002
Merged
Merged
Changes from 42 commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
0018ef0
Add minimum working implementation
volks73 d6e28b8
Merge branch 'master' of https://github.com/rust-lang/cargo into feat…
volks73 7397f31
Add `--cfg` to build and check subcommands
volks73 3a6850f
Add `--cfg` to bench and test subcommands
volks73 6edd818
Merge branch 'master' of https://github.com/rust-lang/cargo into feat…
volks73 e9e4593
Change option name for subcommands
volks73 d662cc3
Fix `--rustc-cfg` not working
volks73 6562f6a
Add `--cfg` or `--rustc-cfg` behind unstable flag
volks73 d49a32f
Change field name
volks73 efdf647
Change module name
volks73 6789a4c
Fix compile-time errors from module rename
volks73 234089f
Change JSON format
volks73 3d0fcbe
Add better example JSON to internal comment
volks73 80e8fce
Merge branch 'master' of https://github.com/rust-lang/cargo into feat…
volks73 af3a843
Change the `--cfg` and `--rustc-cfg` to hidden
volks73 1f3fb66
Merge branch 'master' of https://github.com/rust-lang/cargo into feat…
volks73 9be620a
Fix formatting
volks73 105a8bd
Remove `--rustc-cfg` argument
volks73 e078a6c
Change to lighter weight `--print-cfg`
volks73 7f1c268
Fix typo
volks73 fc83cbe
Refactor to use constant for arg name
volks73 97a821d
Change JSON format
volks73 698fe70
Fix formatting
volks73 0c133f3
Fix compile-time errors
volks73 6d48e50
Fix formatting
volks73 afa1905
Remove `--print-cfg` argument
volks73 1380755
Change implementation
volks73 bf3ed17
Remove cache output and error handling
volks73 db77c31
Fix warnings
volks73 2f985ae
Remove unnecessary arguments and env removal
volks73 2cd5d9d
Change to enumerate implementation
volks73 a05dac3
Remove duplicate check for empty kinds
volks73 5a24ad1
Change println macro to drop_println
volks73 d7034c6
Fix formatting
volks73 d0b15d4
Merge branch 'master' into feature-rustc-cfg-argument
volks73 a740608
Merge branch 'master' of https://github.com/rust-lang/cargo into feat…
volks73 c86864b
Fix missing import after merge
volks73 a8fffa8
Merge branch 'feature-rustc-cfg-argument' of https://github.com/volks…
volks73 37065f0
Merge branch 'master' of https://github.com/rust-lang/cargo into feat…
volks73 f32f72f
Fix missing import
volks73 2aa4fba
Change scope of function
volks73 39fb01c
Change to use TargetInfo type
volks73 fa8e9ae
Change to forwarding rustc stdio to cargo
volks73 8ce7633
Fix warning with unused import
volks73 de340a2
Add first test
volks73 8b80e52
Add multitarget test
volks73 c7038b2
Add test using RUSTFLAGS env var
volks73 1f05730
Add test with cargo configuration file
volks73 70a423e
Fix formatting
volks73 9b02dd4
Fix tests for CI environment
volks73 2a5355f
Fix usage of assert methods
volks73 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of capturing the output here I think it's best to jsutt forward the output to Cargo's own stdout/stderr streams
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am sorry, but I am not sure how to forward the output to Cargo's own stdout/stderr streams. Do you have an example of doing this within the Cargo codebase for another process/cmd? I looked into the
ProcessBuilder
type and initially tried theexec
method, but it just hanged. I believe the equivalent method in thestd::process::Command
type would bestatus()
because it says it the child (rustc) inherients stdio from the parent (Cargo). Would this be the same as "forwarding"?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you can basically call
exec
instead ofexec_with_output
here