From c1b04844959cad9d2d0f22d04b8f1a712f81ca3c Mon Sep 17 00:00:00 2001 From: Tommaso Bianchi Date: Sun, 26 Jul 2026 12:22:38 +0200 Subject: [PATCH] 3mf test: give the BBS save a writable temp dir, instead of the filesystem root MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit store_bbs_3mf reaches Model::get_backup_path(), which builds temporary_dir() + "/orcaslicer_model/" + timestamp. temporary_dir() returns a file-static that ONLY OrcaSlicer.cpp's startup sets, so in a test binary it is the empty string and the backup path becomes "/orcaslicer_model/..." — absolute, at the filesystem root. An unprivileged process cannot create that, so the save returned false and the scenario died on REQUIRE(store_bbs_3mf(sp)). This was the SINGLE failure in this fork's Unit Tests — 1 of 566, on Linux x86_64, Linux aarch64 and macOS arm64 — from CI run 30191490709: Failed to create backup path "/orcaslicer_model/Sun_Jul_26/08_49_41#5398#1": boost::filesystem::create_directories: Permission denied [system:13] It hid because that job had never run to completion on this branch before: every earlier run was cancelled by the concurrency group first. It also passed on Windows x64, where the drive-root path is writable, and it passes in the local build container, which runs as root. Verified against the same defect in the Snapmaker fork by running the built binary as uid 1000: permission denied before, 4 assertions passing after. snaporca-vg8 Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01LyRwbuq6fjn3VV9U9UvhBM --- tests/libslic3r/test_3mf.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/libslic3r/test_3mf.cpp b/tests/libslic3r/test_3mf.cpp index 435b3bbf25..c991d7f65a 100644 --- a/tests/libslic3r/test_3mf.cpp +++ b/tests/libslic3r/test_3mf.cpp @@ -9,6 +9,7 @@ #include "libslic3r/Preset.hpp" #include "libslic3r/MultiNozzleUtils.hpp" #include "libslic3r/ProjectTask.hpp" +#include "libslic3r/Utils.hpp" // set_temporary_dir #include #include @@ -184,6 +185,16 @@ SCENARIO("CAD recipe blob survives a 3mf save/load cycle", "[3mf]") { // way load_bbs_3mf does. The full GUI reopen is verified live on the Design tab. SCENARIO("CAD recipe is embedded in the BBS 3mf archive", "[3mf]") { GIVEN("a model carrying a binary cad_recipe") { + // store_bbs_3mf reaches Model::get_backup_path(), which builds + // temporary_dir() + "/orcaslicer_model/...". temporary_dir() is a static that ONLY + // OrcaSlicer.cpp's startup sets, so in a test binary it is the empty string and the + // backup path becomes "/orcaslicer_model/..." — absolute, at the filesystem root. + // The CI runners cannot create that, so the test died on + // "create_directories: Permission denied". It passed locally only because the build + // container runs as root, and on Windows only because that drive root is writable — + // which is why this went unnoticed until Unit Tests first ran to completion. + set_temporary_dir(boost::filesystem::temp_directory_path().string()); + Model model; std::string src = std::string(TEST_DATA_DIR) + "/test_3mf/Prusa.stl"; load_stl(src.c_str(), &model);