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

os current_exe using same approach as linux to get always the full ab… #87631

Merged
merged 1 commit into from
Oct 5, 2021
Merged

os current_exe using same approach as linux to get always the full ab… #87631

merged 1 commit into from
Oct 5, 2021

Conversation

devnexen
Copy link
Contributor

…solute 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 Jul 30, 2021
match crate::fs::read_link("/proc/self/path/a.out") {
Err(ref e) if e.kind() == io::ErrorKind::NotFound => Err(io::Error::new_const(
io::ErrorKind::Uncategorized,
&"no /proc/self/a.out available. Is /proc mounted?",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe still use getexecname if /proc is not mounted? I am guessing this could happen inside containers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair point

@Mark-Simulacrum
Copy link
Member

The commit says "same approach as linux", but I am not seeing similar code elsewhere in this file. Regardless, this is not really my area of expertise so.. let's try r? @joshtriplett perhaps?

@devnexen
Copy link
Contributor Author

devnexen commented Aug 1, 2021

originally it was closer but difference now there is fallback code path.

…solute path

but in case of failure (e.g. prcfs not mounted) still using
getexecname.
@camelid camelid added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 20, 2021
@inquisitivecrystal inquisitivecrystal added T-libs Relevant to the library team, which will review and decide on the PR/issue. O-solaris Operating system: Solaris labels Aug 24, 2021
@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 13, 2021
@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 28, 2021
@joshtriplett
Copy link
Member

I don't know Solaris, but the approach seems reasonable, and I see various references confirming that /proc/self/path/a.out works on Solaris.

@bors r+

@bors
Copy link
Contributor

bors commented Oct 4, 2021

📌 Commit cb4519e has been approved by joshtriplett

@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 Oct 4, 2021
Manishearth added a commit to Manishearth/rust that referenced this pull request Oct 5, 2021
os current_exe using same approach as linux to get always the full ab…

…solute path
bors added a commit to rust-lang-ci/rust that referenced this pull request Oct 5, 2021
…arth

Rollup of 12 pull requests

Successful merges:

 - rust-lang#87631 (os current_exe using same approach as linux to get always the full ab…)
 - rust-lang#88234 (rustdoc-json: Don't ignore impls for primitive types)
 - rust-lang#88651 (Use the 64b inner:monotonize() implementation not the 128b one for aarch64)
 - rust-lang#88816 (Rustdoc migrate to table so the gui can handle >2k constants)
 - rust-lang#89244 (refactor: VecDeques PairSlices fields to private)
 - rust-lang#89364 (rustdoc-json: Encode json files with UTF-8)
 - rust-lang#89423 (Fix ICE caused by non_exaustive_omitted_patterns struct lint)
 - rust-lang#89426 (bootstrap: add config option for nix patching)
 - rust-lang#89462 (haiku thread affinity build fix)
 - rust-lang#89482 (Follow the diagnostic output style guide)
 - rust-lang#89504 (Don't suggest replacing region with 'static in NLL)
 - rust-lang#89535 (fix busted JavaScript in error index generator)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 0fb0122 into rust-lang:master Oct 5, 2021
@rustbot rustbot added this to the 1.57.0 milestone Oct 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-solaris Operating system: Solaris S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants