Skip to content

Make rust-demangler installable #83529

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
Apr 4, 2021
Merged

Make rust-demangler installable #83529

merged 3 commits into from
Apr 4, 2021

Conversation

richkadel
Copy link
Contributor

@richkadel richkadel commented Mar 26, 2021

Adds bootstrap rules to support installing rust-demangler, as an optional, in-tree extended tool. It can be included by updating config.toml, setting extended = true, and then either (a) adding "rust-demangler" to the tools array, or by enabling profiler = true. In other words, it is a default extended tool if profiler = true.

When compiling with -Z instrument-coverage, the coverage reports are
generated by llvm-cov. llvm-cov includes a built-in demangler for
C++, and an option to supply an alternate demangler. For Rust, we have
rust-demangler, currently used in rustc coverage tests.

Fuchsia's toolchain for Rust is built via ./x.py install. Fuchsia is
adding support for Rust coverage, and we need to include the
rust-demangler in the installed bin directory.

r? @tmandry

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

I am trying to understand what happened here with the license files -- is there a reason those have been dropped into the rust-demangler source code directory? Generally that feels like the wrong move; we may instead copy the root-level licenses during packaging.

@richkadel

This comment has been minimized.

@richkadel
Copy link
Contributor Author

we may instead copy the root-level licenses during packaging.

I'll make that change. Thanks!

@camelid camelid added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Mar 26, 2021
@rust-log-analyzer

This comment has been minimized.

@richkadel

This comment has been minimized.

@Mark-Simulacrum
Copy link
Member

I would expect you to be able to either comment out rustfmt or test with something like x.py install src/tools/rust-demangler

@richkadel

This comment has been minimized.

@richkadel richkadel force-pushed the demangler branch 2 times, most recently from df1dc4b to d64e905 Compare March 28, 2021 23:24
@rust-log-analyzer

This comment has been minimized.

@richkadel
Copy link
Contributor Author

I updated the PR comment, first paragraph, based on my most recent patch, to make rust-demangler a default extended tool if profiler = true (the setting required to enable -Z instrument-coverage support).

I also added tests (to support ./x.py test rust-demangler).

I believe my changes are now complete, pending review.

@richkadel
Copy link
Contributor Author

we may instead copy the root-level licenses during packaging.

I'll make that change. Thanks!

This is done. I updated the README.md file to reference the licenses at the doc root.

@richkadel
Copy link
Contributor Author

@tmandry @wesleywiser - FYI, this is ready for review.

Copy link
Member

@tmandry tmandry left a comment

Choose a reason for hiding this comment

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

LGTM, modulo minor comments that can be addressed in a follow-up. All the other people I'd want to look at this change already have, so

@bors r+ rollup=iffy

@tmandry
Copy link
Member

tmandry commented Mar 31, 2021

@bors r+ rollup=iffy

I guess that doesn't work on review comments.

@bors
Copy link
Collaborator

bors commented Mar 31, 2021

📌 Commit a579912a82f55b19ccee03eda928fed348ec47c3 has been approved by tmandry

@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 Mar 31, 2021
@bors
Copy link
Collaborator

bors commented Mar 31, 2021

⌛ Testing commit a579912a82f55b19ccee03eda928fed348ec47c3 with merge e8c648bd24b9dcd44bd8bda43d3a66b3b3d84ca3...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Mar 31, 2021

💔 Test failed - checks-actions

@bors bors removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Mar 31, 2021
@bors bors added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 31, 2021
@richkadel
Copy link
Contributor Author

I'm trying to reproduce the CI error that failed to find rust-demangler when running x.py dist on Windows, but I keep running into a stack overflow before it completes the build (at least to the point of failure in CI).

Is there something I can do to overcome this stack overflow error?:

   Compiling rustc_interface v0.0.0 (C:\rust\compiler\rustc_interface)
thread 'LTO module rustc_middle.btguyyk8-cgu.4' has overflowed its stack
[RUSTC-TIMING] rustc_middle test:false 1615.740
error: could not compile `rustc_middle`
Click to show stack overflow from `python x.py dist` on windows-msvc:
   Compiling rustc_interface v0.0.0 (C:\rust\compiler\rustc_interface)
[RUSTC-TIMING] rustc_symbol_mangling test:false 343.675
[RUSTC-TIMING] rustc_plugin_impl test:false 178.420
[RUSTC-TIMING] rustc_ty_utils test:false 412.983
[RUSTC-TIMING] rustc_incremental test:false 598.292
[RUSTC-TIMING] rustc_save_analysis test:false 591.511
[RUSTC-TIMING] rustc_privacy test:false 419.040
[RUSTC-TIMING] rustc_ast_lowering test:false 746.298
[RUSTC-TIMING] rustc_parse test:false 757.701
[RUSTC-TIMING] rustc_codegen_ssa test:false 784.703
[RUSTC-TIMING] rustc_builtin_macros test:false 867.048
[RUSTC-TIMING] rustc_lint test:false 957.121
[RUSTC-TIMING] rustc_mir_build test:false 902.907
[RUSTC-TIMING] rustc_infer test:false 1054.076
[RUSTC-TIMING] rustc_expand test:false 1132.934
[RUSTC-TIMING] rustc_metadata test:false 1270.295
[RUSTC-TIMING] rustc_resolve test:false 1264.349
[RUSTC-TIMING] rustc_trait_selection test:false 1327.004
[RUSTC-TIMING] rustc_traits test:false 1192.673
[RUSTC-TIMING] rustc_codegen_llvm test:false 1168.620
[RUSTC-TIMING] rustc_passes test:false 1412.476
[RUSTC-TIMING] rustc_interface test:false 1223.635

thread 'LTO module rustc_middle.btguyyk8-cgu.4' has overflowed its stack
[RUSTC-TIMING] rustc_middle test:false 1615.740
error: could not compile `rustc_middle`

Caused by:
  process didn't exit successfully: `C:\rust\build\bootstrap/debug/rustc --crate-name rustc_middle --edition=2018 compiler\rustc_middle\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C debuginfo=0 -C metadata=49c48b545a6f1e73 -C extra-filename=-49c48b545a6f1e73 --out-dir C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps --target x86_64-pc-windows-msvc -L dependency=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps -L dependency=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\release\deps --extern bitflags=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\libbitflags-e03c9dfd96a4debb.rmeta --extern chalk_ir=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\libchalk_ir-966c239cc2df9d90.rmeta --extern measureme=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\libmeasureme-90f0eb70636ff75c.rmeta --extern polonius_engine=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\libpolonius_engine-0aba9eefa8cd010b.rmeta --extern rustc_rayon_core=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\librustc_rayon_core-92b430a86ac5bcd2.rmeta --extern rustc_apfloat=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\librustc_apfloat-85ddf52c2524e5f3.rmeta --extern rustc_arena=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\librustc_arena-34f3b231bac29114.rmeta --extern rustc_ast=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\librustc_ast-79f3363dc4fba861.rmeta --extern rustc_attr=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\librustc_attr-44b1e3d9b6995d09.rmeta --extern rustc_data_structures=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\librustc_data_structures-c80d9e54d70ff55d.rmeta --extern rustc_errors=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\librustc_errors-01878d15631f1aad.rmeta --extern rustc_feature=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\librustc_feature-9dfd44ff009497fa.rmeta --extern rustc_hir=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\librustc_hir-f1d082e8566d020c.rmeta --extern rustc_index=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\librustc_index-6b52f99ef56658e4.rmeta --extern rustc_macros=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\release\deps\rustc_macros-593d411e4911c3bb.dll --extern rustc_query_system=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\librustc_query_system-740d50df20775353.rmeta --extern rustc_serialize=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\librustc_serialize-4fd24e600f08514a.rmeta --extern rustc_session=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\librustc_session-0b4cb80a8d54fc67.rmeta --extern rustc_span=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\librustc_span-9d7a865d019ad1b8.rmeta --extern rustc_target=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\librustc_target-37eecd04060ec2a8.rmeta --extern rustc_type_ir=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\librustc_type_ir-384fbfa03a4d895a.rmeta --extern smallvec=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\libsmallvec-1f7f64b0734380c5.rmeta --extern tracing=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\deps\libtracing-4c93346f6188a83f.rmeta -Zmacro-backtrace -Ctarget-feature=+crt-static -Ztls-model=initial-exec -Zunstable-options -Wrustc::internal -Cprefer-dynamic -Z binary-dep-depinfo -L native=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\build\stacker-f6e39d316edc7bc1\out -L native=C:\rust\build\x86_64-pc-windows-msvc\stage1-rustc\x86_64-pc-windows-msvc\release\build\psm-b6c7f400dd8ba8bf\out` (exit code: 0xc00000fd, STATUS_STACK_OVERFLOW)
warning: build failed, waiting for other jobs to finish...
[RUSTC-TIMING] rustc_typeck test:false 1683.957
[RUSTC-TIMING] rustc_mir test:false 2105.423
[RUSTC-TIMING] rustc_query_impl test:false 3333.671
error: build failed
command did not execute successfully: "\\\\?\\C:\\rust\\build\\x86_64-pc-windows-msvc\\stage0\\bin\\cargo.exe" "build" "--target" "x86_64-pc-windows-msvc" "-Zbinary-dep-depinfo" "-j" "48" "--release" "--locked" "--features" " llvm max_level_info" "--manifest-path" "C:\\rust\\compiler/rustc/Cargo.toml" "--message-format" "json-render-diagnostics"
expected success, got: exit code: 101
failed to run: C:\rust\build\bootstrap\debug\bootstrap dist
Build completed unsuccessfully in 1:21:46

@tmandry
Copy link
Member

tmandry commented Apr 1, 2021

@bors retry

@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 1, 2021
@tmandry
Copy link
Member

tmandry commented Apr 1, 2021

Nevermind, probably not spurious

@bors r- delegate+

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 1, 2021
@bors
Copy link
Collaborator

bors commented Apr 1, 2021

✌️ @richkadel can now approve this pull request

Adds bootstrap rules to support installing rust-demangler.

When compiling with `-Z instrument-coverage`, the coverage reports are
generated by `llvm-cov`. `llvm-cov` includes a built-in demangler for
C++, and an option to supply an alternate demangler. For Rust, we have
`rust-demangler`, currently used in `rustc` coverage tests.

Fuchsia's toolchain for Rust is built via `./x.py install`. Fuchsia is
adding support for Rust coverage, and we need to include the
`rust-demangler` in the installed `bin` directory.

Configured rust-demangler as an in-tree extended tool.

Added tests to support `./x.py test rust-demangler`.

Install with extended tools by default only if `profiler = true`.
@richkadel
Copy link
Contributor Author

@bors r=tmandry rollup=iffy

@bors
Copy link
Collaborator

bors commented Apr 4, 2021

📌 Commit ed89e6b has been approved by tmandry

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 4, 2021
@bors
Copy link
Collaborator

bors commented Apr 4, 2021

⌛ Testing commit ed89e6b with merge 0850c37...

@bors
Copy link
Collaborator

bors commented Apr 4, 2021

☀️ Test successful - checks-actions
Approved by: tmandry
Pushing 0850c37 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 4, 2021
@bors bors merged commit 0850c37 into rust-lang:master Apr 4, 2021
@rustbot rustbot added this to the 1.53.0 milestone Apr 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants