Skip to content

Replace the nm symbol check with a Rust implementation #828

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

Merged
merged 3 commits into from
May 29, 2025

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented Apr 19, 2025

This should be less error-prone and adaptable than the nm version, and
have better cross-platform support without needing LLVM nm installed.

@tgross35
Copy link
Contributor Author

I should have the rust script invoke cargo as well; run the script with Cargo args, the script invokes Cargo and passes --message-format=json which includes the output file name, and scan them. This avoids any problems from scanning the wrong files.

@tgross35 tgross35 force-pushed the symbol-check branch 4 times, most recently from 014a36d to 65d509a Compare May 28, 2025 20:51
@tgross35 tgross35 marked this pull request as ready for review May 28, 2025 20:58
@tgross35
Copy link
Contributor Author

@beetrees I think you mentioned doing something like this a long time ago - would you mind taking a look at this?

}
}

cmd.wait().expect("failed to wait on Cargo");
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
cmd.wait().expect("failed to wait on Cargo");
assert!(cmd.wait().expect("failed to wait on Cargo").success());

This should check the returned exit status.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, applied

Copy link
Contributor

@beetrees beetrees left a comment

Choose a reason for hiding this comment

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

LGTM

@tgross35 tgross35 enabled auto-merge (rebase) May 29, 2025 15:38
@tgross35 tgross35 disabled auto-merge May 29, 2025 15:38
tgross35 added 3 commits May 29, 2025 15:38
These are now provided by `compiler-builtins`, so there is no need to
also build the C versions. This was detected by checking for duplicate
symbols and not excluding weak symbols (like CI currently does).
This should be less error-prone and adaptable than the `nm` version, and
have better cross-platform support without needing LLVM `nm` installed.
Since a working `nm` is no longer needed as part of CI, the rustup
component can be removed.
@tgross35 tgross35 merged commit bfd4058 into rust-lang:master May 29, 2025
35 checks passed
@tgross35 tgross35 deleted the symbol-check branch May 29, 2025 15:53
@tgross35
Copy link
Contributor Author

Thank you for reviewing!

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.

2 participants