Experiment: Move natvis files from src/etc/natvis to debugger_visualizer attributes#154027
Experiment: Move natvis files from src/etc/natvis to debugger_visualizer attributes#154027clarfonthey wants to merge 1 commit intorust-lang:mainfrom
src/etc/natvis to debugger_visualizer attributes#154027Conversation
|
r? @clubby789 rustbot has assigned @clubby789. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
|
Some changes occurred in src/tools/compiletest cc @jieyouxu |
|
rust/compiler/rustc_codegen_ssa/src/back/linker.rs Lines 1087 to 1105 in a3903b1 |
|
LGTM from the compiletest side once the pretty printer files changes are removed, but I don't have a Windows system to check if the above comment about the linker is true |
|
I also don't have windows |
|
I haven't really touched Windows in years and never did any native development on it. I know some linkage related things because I was trying to get weak linkage working on Windows for EII. As such I don't think I'm a suitable reviewer. |
|
Hmm... @michaelwoerister reviewed this code originally. Any thoughts? |
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
Looking into it, this appears to be the case; the loop below this section that collects the natvis files from all compiled crates should be sufficient. Removed it. |
b14e911 to
40db624
Compare
This comment has been minimized.
This comment has been minimized.
|
This looks right to me. The only possible downside I can think of is that this now loads all the natvis files into memory and then writes them out to temporary files (with more obscure file names). But a) the size is not large and b) that's just like how user natvis files are treated anyway. So I don't think it's much of a downside. If it is advantageous to optimise this then such an optimisation should be applied outside of the standard library too. |
|
I would be truly shocked if 14KiB of XML was what broke the bank for compiling on Windows. |
This is the "easy part" of a massive rabbit hole that I fell into trying to figure out how the current debug visualizers for hashmaps could potentially be moved into the
hashbrowncrate, while still being able to leverage them for libstd.For natvis, it's pretty easy to separate out what belongs where, and we basically already do this. This just takes it a slight step further and attempts to move them into their relevant crates, and we'll see if it breaks everything in CI. For lack of a better place, this moves the "intrinsic" (should probably be renamed to "primitive") natvis file into the libcore crate, since
no_coreis unstable anyway.The Python scripts are an absolute mess, and that's going to take some asking around. So, instead of stalling this part on that being done, I decided to just offer this PR and we'll see if it can work and hopefully make it easier for people to modify the debug visualizers in the standard library, at least for Windows.
Worth also mentioning right now that I don't have a copy of Windows proper to test this on, so, I'm mostly relying on CI/others to verify that this actually doesn't break anything.