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

Prefer sysroot from rustc in same directory as rust-gdb #70713

Merged
merged 1 commit into from
Apr 6, 2020

Conversation

jsgf
Copy link
Contributor

@jsgf jsgf commented Apr 2, 2020

If there isn't a rustc in the same directory, then fall back to searching
the path.

If there isn't a rustc in the same directory, then fall back to searching
the path.
@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 2, 2020
@Mark-Simulacrum
Copy link
Member

I'm not really opposed to landing this, but I have heard I think in the past that adding . to PATH is plausibly a bad idea (e.g. https://unix.stackexchange.com/questions/65700/is-it-safe-to-add-to-my-path-how-com).

Can you share your use case for this? I wouldn't have expected rustc to be in the current directory in common usage, but maybe there's some pattern I'm missing?

@jsgf
Copy link
Contributor Author

jsgf commented Apr 3, 2020

@Mark-Simulacrum Not rustc in the current directory, but in the same directory as rust-gdb. So if rust-gdb is in ~/my/private/bin/rust-gdb, then prefer rustc in ~/my/private/bin/rustc, not whatever rustc it finds in $PATH.

Right now if I have a private build of the toolchain and I directly invoke rust-gdb (ie, not via $PATH), it will be using the sysroot of whatever rustc is in $PATH. With this PR it will use the rustc that's a sibling of rust-gdb, but if there isn't one it falls back to the current behaviour.

@Mark-Simulacrum
Copy link
Member

Ah, okay, I think I misread the description. In that case, seems great; thanks for clarifying!

I think this is generally the correct behavior given how we normally package things. @bors r+

@bors
Copy link
Contributor

bors commented Apr 3, 2020

📌 Commit 7a824c8 has been approved by Mark-Simulacrum

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 3, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 6, 2020
Rollup of 5 pull requests

Successful merges:

 - rust-lang#70519 (Tweak output of type params and constraints in the wrong order)
 - rust-lang#70704 (Make panic unwind the default for aarch64-*-windows-msvc targets)
 - rust-lang#70713 (Prefer sysroot from rustc in same directory as rust-gdb)
 - rust-lang#70739 (def_collector, visit_fn: account for no body)
 - rust-lang#70827 (Use smaller span for suggestion restricting lifetime)

Failed merges:

r? @ghost
@bors bors merged commit 4911d16 into rust-lang:master Apr 6, 2020
@jsgf jsgf deleted the rust-gdb-rustc branch April 6, 2020 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants