Repository navigation
Build temp paths with boost::filesystem separators on Windows - #1203
Open
creat3dworld wants to merge 1 commit into
Open
creat3dworld wants to merge 1 commit into
creat3dworld wants to merge 1 commit into
Conversation
1 of 3 tasks
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.
Closes #776
Root cause
Model::get_backup_path()built the temp path by string concatenation with a hardcoded/:backup_path = parent_path.string() + buf.str()wherebufstarts with"/snapmaker_orca_model/". On Windowstemporary_dir()returns backslashes (C:\Users\...\Temp), so the result isC:\...\Temp/snapmaker_orca_model/...— mixed separators, exactly as reported. That path becomes the temp G-code path handed to the post-process script (run_post_process_scripts,path = src_path + ".pp"), and Windows/Python chokes on it. The same function also usedbackup_path + "/3D/Objects"/"/Metadata"/"/lock.txt"string concatenation.Fix
Build
backup_pathwithboost::filesystem::pathoperators (parent_path / "snapmaker_orca_model" / date_dir / time_dir), which insert the native separator, and usetemp_path / "3D" / "Objects"etc. for the subdirectories. The directory layout is unchanged (samesnapmaker_orca_model/<date>/<time>#<pid>#<id>structure).Based on the v2.4.1 tag. Upstream main has moved 25 commits ahead of v2.4.1; this branch is based on v2.4.1, and the files it touches were not changed on main since v2.4.1, so it should merge cleanly.
Verification: the patch was verified to apply cleanly to a fresh v2.4.1 copy (dry-run + byte-compare). It was NOT compile-tested — this VM has no build toolchain for OrcaSlicer. Real verification: slice + run a post-process script on Windows and confirm the temp path is all-backslash and the script succeeds.