Skip to content

Replace -Z ast-json in the check for undefined symbols#284

Merged
dgrunwald merged 4 commits intodgrunwald:masterfrom
tschorr:replace_ast_json
Sep 21, 2022
Merged

Replace -Z ast-json in the check for undefined symbols#284
dgrunwald merged 4 commits intodgrunwald:masterfrom
tschorr:replace_ast_json

Conversation

@tschorr
Copy link
Copy Markdown
Contributor

@tschorr tschorr commented Sep 19, 2022

-Z ast-json ist no longer available in Rust nightly, see also #279 (comment). Suggestion: Let nm report undefined symbols. This should also work for Rust stable.

@tschorr
Copy link
Copy Markdown
Contributor Author

tschorr commented Sep 19, 2022

Could someone approve running the workflow? This will most likely need some tweaks.

@dgrunwald
Copy link
Copy Markdown
Owner

I think nm will only report functions that are actually called, I wanted to check all functions that are declared even if unused.

@tschorr
Copy link
Copy Markdown
Contributor Author

tschorr commented Sep 19, 2022

all functions that are declared even if unused.

I'm not exactly sure what that should cover and I don't have the -Z ast-json output to compare the results. Could you elaborate?
nm -u will report undefined symbols (those external to each object file). It seems to make sense to check if those are provided in the so_files. But there is also nm --defined-only that will report symbols in the text and data sections.

There is also the nightly -Z unpretty=ast-tree,expanded flag to rustc that might provide what you're looking for. But the output ist different from -Z ast-json (e.g. it's not json).

@tschorr
Copy link
Copy Markdown
Contributor Author

tschorr commented Sep 20, 2022

After looking a bit more into the output of the different commands, I have decided to go with -Z unpretty=ast-tree,expanded as it seems closer to the original test than the other options. Also, the .rlib contents differ a lot depending on the link mode.

@tschorr tschorr changed the title WIP: Replace -Z ast-json in the check for undefined symbols Replace -Z ast-json in the check for undefined symbols Sep 20, 2022
@dgrunwald dgrunwald merged commit aa253ef into dgrunwald:master Sep 21, 2022
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