Skip to content

Include debug_metadata/*.natvis in the published crate to fix debugger_visualizer/docs.rs build#417

Open
teddytennant wants to merge 1 commit into
servo:v1from
teddytennant:fix-natvis-package
Open

Include debug_metadata/*.natvis in the published crate to fix debugger_visualizer/docs.rs build#417
teddytennant wants to merge 1 commit into
servo:v1from
teddytennant:fix-natvis-package

Conversation

@teddytennant

Copy link
Copy Markdown

What

Add debug_metadata/*.natvis to the include allow-list in Cargo.toml so the natvis debugger-visualizer file is shipped in the published crate.

-include = ["Cargo.toml", "LICENSE-MIT", "LICENSE-APACHE", "README.md", "src/**/*.rs"]
+include = ["Cargo.toml", "LICENSE-MIT", "LICENSE-APACHE", "README.md", "src/**/*.rs", "debug_metadata/*.natvis"]

Why

Fixes #415.

The include allow-list added in #397 (to keep dev scripts out of the package) omitted debug_metadata/smallvec.natvis. But src/lib.rs references that file:

#![cfg_attr(
    feature = "debugger_visualizer",
    feature(debugger_visualizer),
    debugger_visualizer(natvis_file = "../debug_metadata/smallvec.natvis")
)]

Because the file is no longer packaged, the published 1.15.2 crate fails to compile whenever the debugger_visualizer feature is enabled:

error: couldn't read src/../debug_metadata/smallvec.natvis: No such file or directory (os error 2)

This is why the docs.rs build for 1.15.2 is red (docs.rs builds with --all-features on nightly), and it also breaks any downstream crate that enables the feature. Shipping the file fixes both, rather than just dropping the feature from docs.rs metadata. The tight debug_metadata/*.natvis glob keeps unrelated dev files out, consistent with #397's intent.

Testing

Metadata/packaging fix, so verified via cargo package:

  • cargo package --list now lists debug_metadata/smallvec.natvis (previously absent).
  • Building the packaged crate reproduces the bug before and confirms the fix after:
    • Before: cd target/package/smallvec-1.15.2 && cargo +nightly build --features debugger_visualizer fails with the couldn't read ...smallvec.natvis error above.
    • After: the same build succeeds.
  • Existing suite unaffected: cargo test passes (no source change); cargo +nightly test --test debugger_visualizer --features debugger_visualizer compiles against the natvis file and passes.

The include allow-list added in servo#397 omitted
debug_metadata/smallvec.natvis, which src/lib.rs references via
debugger_visualizer(natvis_file = ...). As a result the published
crate fails to compile whenever the debugger_visualizer feature is
enabled (including docs.rs, which builds with --all-features on
nightly) with "couldn't read src/../debug_metadata/smallvec.natvis".

Ship the file so both docs.rs and downstream users of the feature
build again.
Copilot AI review requested due to automatic review settings July 8, 2026 16:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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