From 8580542ac718e4228d7f1eb8b3c07226845f6ae6 Mon Sep 17 00:00:00 2001 From: Mike Solar Date: Mon, 13 Jul 2026 13:29:55 +0800 Subject: [PATCH] render: write graph snapshots to AppLocalData instead of system temp The worker process on macOS could not see the graph snapshot when it was placed in /var/folders/.../T (likely sandbox/working-directory visibility). Write snapshots to a 'render-graphs' subdirectory of the application's persistent data location instead, which both the editor and the worker can access on all platforms. --- app/render/renderworkerpool.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/app/render/renderworkerpool.cpp b/app/render/renderworkerpool.cpp index d5d20dbe1..831586609 100644 --- a/app/render/renderworkerpool.cpp +++ b/app/render/renderworkerpool.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -621,7 +622,20 @@ bool RenderWorkerPool::PrepareJob(RenderTicketPtr ticket, bool RenderWorkerPool::WriteGraphSnapshot(Project *project, QString *path) { - QTemporaryFile file(QDir::temp().filePath(QStringLiteral("oak-render-graph-XXXXXX.ove"))); + // Write the snapshot into the application's persistent data directory so + // that the worker process can always reach it, regardless of sandbox + // restrictions or working directory. System temp directories are not + // reliably shared between the editor and its child worker on macOS. + const QString base_dir = QStandardPaths::writableLocation( + QStandardPaths::AppLocalDataLocation); + const QString graph_dir = QDir(base_dir).filePath(QStringLiteral("render-graphs")); + if (!QDir(graph_dir).mkpath(QStringLiteral("."))) { + qWarning() << "RenderWorkerPool failed to create graph snapshot directory" + << graph_dir; + return false; + } + + QTemporaryFile file(QDir(graph_dir).filePath(QStringLiteral("oak-render-graph-XXXXXX.ove"))); file.setAutoRemove(false); if (!file.open()) { qWarning() << "RenderWorkerPool failed to create graph snapshot temp file"