Skip to content

Fix TRACE_enable panic on missing file to match C fopen append behavior#313

Merged
folkertdev merged 1 commit into
trifectatechfoundation:mainfrom
heroicpixel:fix-trace-file-create
May 13, 2026
Merged

Fix TRACE_enable panic on missing file to match C fopen append behavior#313
folkertdev merged 1 commit into
trifectatechfoundation:mainfrom
heroicpixel:fix-trace-file-create

Conversation

@heroicpixel
Copy link
Copy Markdown
Contributor

Description

Fixes #312

Changes

  • File Creation Parity: Added .create(true) to OpenOptions in programs/zstdcli_trace.rs. This ensures that opening a trace log file with --trace automatically creates the file if it does not exist, matching C's fopen(..., "a") append behavior and resolving the runtime panic on fresh runs.

Verification

Verified locally that running zstdcli on a fresh run successfully creates trace.log, writes the CSV header row, and captures compression metrics without panicking.

PR was supported by AI.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
programs/zstdcli_trace.rs 0.00% 1 Missing ⚠️
Flag Coverage Δ
test-aarch64-apple-darwin 33.03% <0.00%> (-0.02%) ⬇️
test-aarch64-unknown-linux-gnu 31.63% <0.00%> (-0.01%) ⬇️
test-i686-unknown-linux-gnu 31.69% <0.00%> (-0.01%) ⬇️
test-x86_64-unknown-linux-gnu 33.34% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
programs/zstdcli_trace.rs 0.00% <0.00%> (ø)

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@folkertdev folkertdev merged commit b438c75 into trifectatechfoundation:main May 13, 2026
20 of 21 checks passed
@heroicpixel heroicpixel deleted the fix-trace-file-create branch May 18, 2026 09:39
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.

TRACE_enable panics on missing file and skips CSV header row

2 participants