Repository navigation
fix(File): fall back to copy+remove on cross-device rename (EXDEV) - #9207
Conversation
std::filesystem::rename fails with EXDEV across filesystems, unlike Qt's QFile::rename which silently copied and removed. PR #8938 replaced the Qt call without preserving that fallback, breaking TOPP adapters (CometAdapter -pin_out, MSGFPlusAdapter -mzid_out) that move files from a tmp dir to a bind-mounted output — a common container layout. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughUpdated the Changes
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Restore ProSE/FragmentIndex/File entries dropped by the FeatureFinderCentroided reorganization commit (#9159) and add new entries for commits merged after the last sync: - #9188: ProSE BREAKING: default isotope error range changed to [0,+2] - #9191: ProSE SNES mother-peptide indexing for non-specific searches - #9195: ProSE fix: defer PSM FDR when Percolator enabled; valid .pin output - #9203: FragmentIndex: fixed bucket_size 4096 for tighter candidate lists - #9204: ProSE: resolve PercolatorAdapter via findSiblingTOPPExecutable - #9205: ProSE: per-file output isolation + dangling decoy ref crash fix - #9207: File::rename: cross-device fallback (copy+remove on EXDEV) Co-authored-by: GitHub Copilot <[email protected]> Co-authored-by: Copilot <[email protected]>
Summary
File::rename()now falls back tostd::filesystem::copy_file+std::filesystem::removewhenstd::filesystem::renamefails withEXDEV(cross-device link). This restores the cross-filesystem semantics thatQFile::renameprovided before PR #8938 replaced Qt withstd::filesystem.Why
std::filesystem::renamefollows POSIXrename(2)and fails withEXDEVwhen source and destination are on different mounts.QFile::rename(the pre-#8938 implementation) silently copied + removed in that case. The regression surfaced as:…when running OpenMS TOPP tools inside a container where
/tmpis on an overlay FS and the output dir is a bind mount.Affected TOPP tools (all move files from
tmp_dir.getPath()to a user-specified output):CometAdapter -pin_outMSGFPlusAdapter -mzid_outMSFraggerAdapter(optional pepXML out, lower risk — source is typically next to the input mzML)Since all three go through
File::rename, fixing it once inFile.cppcovers them all.Behavior
std::filesystem::rename.false.Test plan
File_teststill passes (same-FS path unchanged)./tmpand the build dir share a mount). The fix is narrow (the addedif (rename_ec == std::errc::cross_device_link)block is ~17 lines) and relies on code review + downstream integration testing in the container environment that originally tripped the bug.CometAdapter -pin_outwithout the "Could not move" error.If desired, a follow-up could add an env-gated test (e.g.
OPENMS_TEST_CROSSFS_DIRpointing at a path on a different mount) that runs only where a second filesystem is available.🤖 Generated with Claude Code
Summary by CodeRabbit