fix(release): use panic=unwind so the plugin catch_unwind guard works #1
No reviewers
Labels
No labels
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
h-dv/code-index!1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/release-panic-unwind"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The release profile set
panic = "abort", which makesstd::panic::catch_unwinda no-op — a panic aborts the process before it can be caught. That defeated the guard inparse_with_plugin(crates/indexer/src/index.rs), which wraps the tree-sitterplugin.extract()call incatch_unwindspecifically so a panicking grammar degrades into a recordedparse_errorrow instead of crashing. In release builds, a single plugin panic would SIGABRT the whole long-lived daemon.Fix
Switch
[profile.release]topanic = "unwind", with an inline comment tying the setting to the guard so it isn't "optimized" back toabort. The other size optimizations (lto,codegen-units,strip) remain.Verification
Proven end-to-end under the real
[profile.release]via a throwaway--release --examplethat drives the production path (index_path→select_plugin→parse_with_plugin→catch_unwind(plugin.extract)) with a plugin that panics inextract:parse_errorrow written (IndexStats.parse_errors=1).Note: this regression is invisible to
cargo test— the test harness forcespanic = "unwind"regardless of the profile, which is why theabortsetting slipped in unnoticed.🤖 Generated with Claude Code