fix(chimeric): create output parent directory before writing#37
Open
pinin4fjords wants to merge 2 commits into
Open
fix(chimeric): create output parent directory before writing#37pinin4fjords wants to merge 2 commits into
pinin4fjords wants to merge 2 commits into
Conversation
The chimeric output writer constructs its path as <outFileNamePrefix>/Chimeric.out.junction, treating the prefix as a directory regardless of whether it ends in `/`. In two-pass mode the chim writer fires before any other output creates that directory, so the file open fails with "No such file or directory" and the entire run aborts. Call create_dir_all on the parent of the chim output path before opening the file. Without two-pass mode the bug was masked because another output writer happened to create the dir first. Fixes scverse#35
Author
|
Verified the fix end-to-end on macOS/aarch64 with the binary built from Ran the exact failure mode from the issue (PE + Pre-fix the same invocation crashed before any output was written: After the fix the run completes cleanly, the parent dir is created by |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rustar-aligner --chimSegmentMin > 0combined with--twopassMode Basicaborts the run when--outFileNamePrefixdoesn't end in/:The chim writer constructs its path as
<prefix>/Chimeric.out.junction(treating--outFileNamePrefixas a directory, per the existing behaviour tracked in #26). In two-pass mode the chim writer fires before any other output writer creates that directory, so theFile::createcall fails. Without two-pass mode the bug is masked because another output writer incidentally creates the dir first.Fix
Call
std::fs::create_dir_allon the parent of the chim output path before opening the file. Minimal, scoped fix - does not change the existing prefix-as-dir behaviour (that's left to #26).Test plan
cargo buildcargo clippy --all-targets -- -D warningscargo fmt --checkAfter the fix,
rustar-aligner --chimSegmentMin 12 --twopassMode Basic --outFileNamePrefix sample. ...completes and writessample./Chimeric.out.junction(with 14-column content matching STAR's format).Fixes #35