From caaba97834d78ab6c7bff7fc085a41d4b77da47a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Wed, 25 Jun 2025 14:53:04 +0200 Subject: [PATCH] [core] desc.node: Ensure all paths are sent as POSIX strings --- meshroom/core/desc/node.py | 10 +++++----- meshroom/core/graph.py | 8 ++++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/meshroom/core/desc/node.py b/meshroom/core/desc/node.py index 6d7195b1..023d2e23 100644 --- a/meshroom/core/desc/node.py +++ b/meshroom/core/desc/node.py @@ -14,8 +14,8 @@ from .attribute import StringParam, ColorParam import meshroom from meshroom.core import cgroup -_MESHROOM_ROOT = Path(meshroom.__file__).parent.parent -_MESHROOM_COMPUTE = _MESHROOM_ROOT / "bin" / "meshroom_compute" +_MESHROOM_ROOT = Path(meshroom.__file__).parent.parent.as_posix() +_MESHROOM_COMPUTE = (Path(_MESHROOM_ROOT) / "bin" / "meshroom_compute").as_posix() class MrNodeType(enum.Enum): @@ -148,14 +148,14 @@ class BaseNode(object): chunk.saveStatusFile() cmdList = shlex.split(cmd) # Resolve executable to full path - prog = shutil.which(cmdList[0], path=env.get('PATH') if env else None) + prog = shutil.which(cmdList[0], path=env.get("PATH") if env else None) print(f"Starting Process for '{chunk.node.name}'") print(f" - commandLine: {cmd}") print(f" - logFile: {chunk.logFile}") if prog: - cmdList[0] = prog - print(f" - command full path: {prog}") + cmdList[0] = Path(prog).as_posix() + print(f" - command full path: {cmdList[0]}") # Change the process group to avoid Meshroom main process being killed if the # subprocess gets terminated by the user or an Out Of Memory (OOM kill). diff --git a/meshroom/core/graph.py b/meshroom/core/graph.py index 848b0fb3..9360c11f 100644 --- a/meshroom/core/graph.py +++ b/meshroom/core/graph.py @@ -7,6 +7,7 @@ from collections.abc import Iterable import weakref from collections import defaultdict, OrderedDict from contextlib import contextmanager +from pathlib import Path from enum import Enum @@ -1400,9 +1401,12 @@ class Graph(BaseObject): self._unsetFilepath() return - if self._filepath == filepath: + # Make sure the path is stored using the POSIX convention + # so that it can be used when creating sub-processes for node execution. + newFilepath = Path(filepath).as_posix() + if self._filepath == newFilepath: return - self._filepath = filepath + self._filepath = newFilepath # For now: # * cache folder is located next to the graph file # * graph name if the basename of the graph file