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

Add --print-sysroot commandline option to rustc #18917

Closed

Conversation

michaelwoerister
Copy link
Member

This is in support of the coming "rust-mode" debugger startup scripts.
The implementation given here will print the sysroot if no input filename is given to rustc. Otherwise the option is silently ignored. Let me know if you'd like to have a different behavior.

cc @brson @alexcrichton

@brson
Copy link
Contributor

brson commented Nov 13, 2014

@alexcrichton I wonder if it might be prudent to hide this behind a -Z flag. I'm getting a little concerned about command line flag proliferation...

@alexcrichton
Copy link
Member

Hm we do seem to grow quite the number of flags over time. I suppose I don't quite know what the -Z flag is used for, but I'm also fine throwing it behind there. We do have some other related flags for printing like:

    --print-crate-name  Output the crate name and exit
    --print-file-name   Output the file(s) that would be written if
                        compilation continued and exit

so there is at least some precedent for the top level (but not necessarily good precedent)

@michaelwoerister
Copy link
Member Author

I'm OK with either variant and the -Z flag option being the more cautious one, maybe we should just do that.

@brson
Copy link
Contributor

brson commented Nov 14, 2014

Yeah, the -Z option's purpose is somewhat unclear, and I feel like it's changed over time. Let's put it there for now to be conservative. In the near future we're probably going to take a hard look at the compiler interface itself from a backwards-compatibility standpoint. This is easy enough to revisit in the future if more use cases come up.

@michaelwoerister
Copy link
Member Author

I'll close this PR for now. I have a pretty much complete implementation of the LLDB wrapper script and it's being installed to the right places here: https://github.com/michaelwoerister/rust/tree/lldb-scripts
It just needs some testing. I'll add the -Z print-sysroot option together with the other script-related commits in a new PR next week.

lnicola pushed a commit to lnicola/rust that referenced this pull request Jan 20, 2025
feat: Add dereferencing autocomplete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants