Skip to content

.natvis workaround for cargo vendor #3607

Merged
kennykerr merged 1 commit intomasterfrom
natvis-vendor-workaround
May 19, 2025
Merged

.natvis workaround for cargo vendor #3607
kennykerr merged 1 commit intomasterfrom
natvis-vendor-workaround

Conversation

@kennykerr
Copy link
Copy Markdown
Collaborator

This is a quick workaround for what appears to be a cargo vendor issue that fails to include some files that are otherwise included by cargo package.

Fixes: #3606

@kennykerr
Copy link
Copy Markdown
Collaborator Author

I couldn't find a way to test cargo vendor as part of the build as it does not appear to support archiving path-based dependencies.

@tim-weis
Copy link
Copy Markdown
Contributor

Since you are renaming the .natvis files could you consider using the crate names instead (i.e., windows-core.natvis, windows-result.natvis, windows-strings.natvis). That makes it easier to know which visualizers are present in a PDB, or loaded when debugging.

@ChrisDenton
Copy link
Copy Markdown
Collaborator

I couldn't find a way to test cargo vendor as part of the build as it does not appear to support archiving path-based dependencies.

Hm, cargo package might be another option for testing as it should work similarly. Remove (or move) the .git directory and then run, for example, cargo package -p windows-result. That should fail on the current master branch and succeed for this PR.

@kennykerr kennykerr merged commit d9880fa into master May 19, 2025
29 checks passed
@kennykerr kennykerr deleted the natvis-vendor-workaround branch May 19, 2025 15:18
@kennykerr kennykerr mentioned this pull request May 19, 2025
@kennykerr
Copy link
Copy Markdown
Collaborator Author

Thanks Chris, will debug this when I get a moment - in the meantime #3608 should unblock cargo vendor support.

@kennykerr
Copy link
Copy Markdown
Collaborator Author

Since you are renaming the .natvis files could you consider using the crate names instead (i.e., windows-core.natvis, windows-result.natvis, windows-strings.natvis). That makes it easier to know which visualizers are present in a PDB, or loaded when debugging.

Done in #3608

@tim-weis
Copy link
Copy Markdown
Contributor

Since you are renaming the .natvis files could you consider using the crate names instead (i.e., windows-core.natvis, windows-result.natvis, windows-strings.natvis). That makes it easier to know which visualizers are present in a PDB, or loaded when debugging.

Done in #3608

Thanks for incorporating late feedback. Unfortunately, it didn't have the effect I expected: .natvis files dumped into the PDB continue to receive generic names (e.g., <bin crate>-0.nativs, <bin crate>-1.natvis, ...).

If there are no adverse effects, it would be nice to keep the changes regardless.

Apologies for not verifying my assumptions ahead of time.

@kennykerr
Copy link
Copy Markdown
Collaborator Author

kennykerr commented May 20, 2025

Thanks for reporting that behavior - good to know.

@tim-weis
Copy link
Copy Markdown
Contributor

FYI: The behavior is specific to the debugger_visualizer attribute. Natvis visualizers for core Rust libraries (like liballoc.natvis) are processed differently and retain their respective file names.

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.

.natvis file build failure with vendored sources after upgrading from windows-result 0.3.2 to 0.3.3

3 participants