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

Warn if dsymutil returns an error code #79508

Merged
merged 2 commits into from
Dec 2, 2020

Conversation

jryans
Copy link
Contributor

@jryans jryans commented Nov 28, 2020

This checks the error code returned by dsymutil and warns if it failed. It
also provides the stdout and stderr logs from dsymutil, similar to the native
linker step.

I tried to think of ways to test this change, but so far I haven't found a good way, as you'd likely need to inject some nonsensical args into dsymutil to induce failure, which feels too artificial to me. Also, #79361 suggests Rust is on the verge of disabling dsymutil by default, so perhaps it's okay for this change to be untested. In any case, I'm happy to add a test if someone sees a good approach.

Fixes #78770

This was useful during testing of `dsymutil` code paths.
@rust-highfive
Copy link
Collaborator

r? @lcnr

(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 Nov 28, 2020
@lcnr
Copy link
Contributor

lcnr commented Nov 28, 2020

r? @alexcrichton

@rust-highfive rust-highfive assigned alexcrichton and unassigned lcnr Nov 28, 2020
@alexcrichton
Copy link
Member

From a technical perspective this seems fine (although it'd be nice to unify the error reporting with the linker error reporting to ensure everything gets printed the same way). I am not comfortable approving this though since it has the possibility of being a regression for many projects. I don't know if there are any or how many projects are actually failing dsymutil but are succeeding to compile today. If this were to land there wouldn't be any stable recourse for those projects to get compiling again.

Basically I suspect there will need to be some analysis and/or investigation done to see what the impact of a change like this may be. I don't know what it would be myself, unfortunately. @lcnr would you be ok finding a different reviewer for that aspect?

@lcnr
Copy link
Contributor

lcnr commented Nov 29, 2020

I don't know who else is at least somewhat knowledgeable about dsymutil.

Maybe r? @nagisa

@lcnr would you be ok finding a different reviewer for that aspect?

In general, if I reassign an issue it's mostly a guess on who might be the most fitting for the given changes.
If that guess ends up being incorrect I am of course fine with looking for someone else.

@rust-highfive rust-highfive assigned nagisa and unassigned alexcrichton Nov 29, 2020
@nagisa
Copy link
Member

nagisa commented Nov 29, 2020

My position is similar to that of @alexcrichton's. We lack information on how many silent failures we have today. Ordinarily we'd run crater here, but crater builds on Linux, not macOS...

The only way I can see this landing is if the dsymutil failure printed a warning and did not terminate the rest of compilation.

This checks the error code returned by `dsymutil` and warns if it failed. It
also provides the stdout and stderr logs from `dsymutil`, similar to the native
linker step.

Fixes rust-lang#78770
@jryans jryans changed the title Abort if dsymutil returns an error code Warn if dsymutil returns an error code Nov 30, 2020
@jryans
Copy link
Contributor Author

jryans commented Nov 30, 2020

Thanks everyone for your feedback! 😄 I agree it seems hard to gather evidence of how many silent failures are happening here today, so failing compilation does seem risky. I have changed the message to a warning and allowed compilation to continue, which I believe is still useful so that at least the failure is presented instead of hidden.

@nagisa, this should be ready for another look.

@nagisa
Copy link
Member

nagisa commented Nov 30, 2020

@bors r+

@bors
Copy link
Contributor

bors commented Nov 30, 2020

📌 Commit 4ed9083 has been approved by nagisa

@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 Nov 30, 2020
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Dec 1, 2020
Warn if `dsymutil` returns an error code

This checks the error code returned by `dsymutil` and warns if it failed. It
also provides the stdout and stderr logs from `dsymutil`, similar to the native
linker step.

I tried to think of ways to test this change, but so far I haven't found a good way, as you'd likely need to inject some nonsensical args into `dsymutil` to induce failure, which feels too artificial to me. Also, rust-lang#79361 suggests Rust is on the verge of disabling `dsymutil` by default, so perhaps it's okay for this change to be untested. In any case, I'm happy to add a test if someone sees a good approach.

Fixes rust-lang#78770
bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 1, 2020
…laumeGomez

Rollup of 3 pull requests

Successful merges:

 - rust-lang#79508 (Warn if `dsymutil` returns an error code)
 - rust-lang#79509 (Improve attribute message error spans)
 - rust-lang#79600 (std::io: Use sendfile for UnixStream)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 8b0c31d into rust-lang:master Dec 2, 2020
@rustbot rustbot added this to the 1.50.0 milestone Dec 2, 2020
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.

rustc silently ignores failures in dsymutil
7 participants