From bc3b73341318449a747e9fb300d3d8ac6c594f1f Mon Sep 17 00:00:00 2001 From: Henrik Lampe Date: Fri, 6 Nov 2026 09:18:54 +0100 Subject: [PATCH 1/6] Update usd-mojo to 0.2.0 for Mojo 1.2.0 --- recipes/usd-mojo/recipe.yaml | 60 ++++++++++++++++++++++++++---------- recipes/usd-mojo/smoke.mojo | 26 +++++++++++++++- 2 files changed, 69 insertions(+), 17 deletions(-) diff --git a/recipes/usd-mojo/recipe.yaml b/recipes/usd-mojo/recipe.yaml index 99d797c1..917900dc 100644 --- a/recipes/usd-mojo/recipe.yaml +++ b/recipes/usd-mojo/recipe.yaml @@ -1,16 +1,16 @@ { "package": { "name": "usd-mojo", - "version": "0.1.0" + "version": "0.2.0" }, "source": { "git": "https://github.com/henlamp/usd-mojo.git", - "rev": "1ba375b5f99c49062d967036063b0f69054178a2" + "rev": "8908e9815627d4d478edb59fe074166fb7962268" }, "build": { "number": 0, - "string": "mojo110_0", - "skip": "not (osx and arm64)", + "string": "mojo120_0", + "skip": "not ((osx and arm64) or (linux and x86_64))", "files": [ "lib/mojo/usd_mojo.mojoc", "lib/libusd_mojo_bridge.*", @@ -32,25 +32,52 @@ "requirements": { "build": [ "python 3.12.*", - "mojo-compiler ==1.1.0", + "mojo-compiler ==1.2.0", "cmake >=3.30,<5", "ninja >=1.12,<2", - "cxx-compiler ==2.0.0" + "cxx-compiler ==2.0.0", + { + "if": "linux", + "then": "sysroot_linux-64 ==2.28" + } ], "host": [ - "mojo-compiler ==1.1.0", - "openusd ==26.08 py312h07b4ffe_0", + "mojo-compiler ==1.2.0", + "openusd ==26.08", "python 3.12.*", - "libcxx ==23.1.3", - "tbb ==2023.0.0" + { + "if": "osx", + "then": "libcxx ==23.1.3" + }, + "tbb ==2023.0.0", + { + "if": "linux", + "then": [ + "libgcc ==15.3.0", + "libstdcxx ==15.3.0" + ] + } ], "run": [ - "mojo-compiler ==1.1.0", - "openusd ==26.08 py312h07b4ffe_0", + "mojo-compiler ==1.2.0", + "openusd ==26.08", "python 3.12.*", - "__osx >=13.0", - "libcxx >=23.1.3,<24", - "tbb >=2023.0.0,<2024" + { + "if": "osx", + "then": [ + "__osx >=13.0", + "libcxx >=23.1.3,<24" + ] + }, + "tbb >=2023.0.0,<2024", + { + "if": "linux", + "then": [ + "__glibc >=2.28", + "libgcc >=15.3.0,<16", + "libstdcxx >=15.3.0,<16" + ] + } ] }, "tests": [ @@ -75,7 +102,8 @@ "LICENSE", "THIRD_PARTY_NOTICES.md", "licenses/OpenUSD-LICENSE.txt", - "licenses/OpenUSD-NOTICE.txt" + "licenses/OpenUSD-NOTICE.txt", + "licenses/MaterialX-LICENSE.txt" ], "summary": "Typed Mojo access to OpenUSD scenes and geometry" }, diff --git a/recipes/usd-mojo/smoke.mojo b/recipes/usd-mojo/smoke.mojo index 2b89d101..e91c5397 100644 --- a/recipes/usd-mojo/smoke.mojo +++ b/recipes/usd-mojo/smoke.mojo @@ -1,5 +1,13 @@ from std.sys import argv -from usd_mojo import Stage +from usd_mojo import ( + Stage, + Layer, + SceneSnapshot, + SchemaSnapshot, + poll_changes, + ArraySnapshot, + validate_stage, +) def main() raises: @@ -9,4 +17,20 @@ def main() raises: var points = mesh.points() if len(points) != 9 or points[3] != 1 or points[7] != 1: raise Error("Installed USD mesh differs") + var scene = SceneSnapshot(stage) + if len(scene.transforms()) != 32: + raise Error("Installed scene snapshot differs") + var schema = SchemaSnapshot(stage, "/World/Mesh") + if schema.value("points").numbers[3] != 1: + raise Error("Installed schema snapshot differs") + var root = Layer(stage) + if root.is_anonymous() or poll_changes(stage).generation != 0: + raise Error("Installed layer/notice behavior differs") + var array = ArraySnapshot(stage, "/World/Mesh", "points") + if array.view[DType.float32]()[3] != 1: + raise Error("Installed native array differs") + if not validate_stage( + stage, validators=[String("usd_mojo:MeshTopology")] + ).is_valid(): + raise Error("Installed scene validation differs") print("PASS: installed usd-mojo with resolved SDK") From a41bce3796fb0c8e675d81f0dd8f77c873f8d1db Mon Sep 17 00:00:00 2001 From: Henrik Lampe Date: Mon, 9 Nov 2026 20:28:49 +0100 Subject: [PATCH 2/6] Normalize usd-mojo source and toolchain paths in Conda builds --- recipes/usd-mojo/recipe.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/usd-mojo/recipe.yaml b/recipes/usd-mojo/recipe.yaml index 917900dc..19a7abf9 100644 --- a/recipes/usd-mojo/recipe.yaml +++ b/recipes/usd-mojo/recipe.yaml @@ -18,6 +18,7 @@ "share/usd-mojo/**" ], "script": [ + "export CXXFLAGS=\"${CXXFLAGS:-} -ffile-prefix-map=${SRC_DIR}=source -ffile-prefix-map=${BUILD_PREFIX}=build-tools\"", "python tools/conda_install.py" ], "dynamic_linking": { From a54be509b425a911fad64f96b458a3f68ba3eb4a Mon Sep 17 00:00:00 2001 From: Henrik Lampe Date: Mon, 9 Nov 2026 21:10:40 +0100 Subject: [PATCH 3/6] Remove Conda toolchain RPATHs from the installed USD bridge --- recipes/usd-mojo/install-rpath.patch | 11 +++++++++++ recipes/usd-mojo/recipe.yaml | 5 ++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 recipes/usd-mojo/install-rpath.patch diff --git a/recipes/usd-mojo/install-rpath.patch b/recipes/usd-mojo/install-rpath.patch new file mode 100644 index 00000000..8e885c8c --- /dev/null +++ b/recipes/usd-mojo/install-rpath.patch @@ -0,0 +1,11 @@ +diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt +--- a/native/CMakeLists.txt ++++ b/native/CMakeLists.txt +@@ -38,6 +38,7 @@ if(TARGET Python3::Python) + target_link_libraries(usd_mojo_bridge PRIVATE Python3::Python) + endif() + set_target_properties(usd_mojo_bridge PROPERTIES ++ INSTALL_REMOVE_ENVIRONMENT_RPATH TRUE + CXX_VISIBILITY_PRESET default VISIBILITY_INLINES_HIDDEN NO + BUILD_RPATH "${USDM_SDK_RPATH}") + diff --git a/recipes/usd-mojo/recipe.yaml b/recipes/usd-mojo/recipe.yaml index 19a7abf9..a9e01c48 100644 --- a/recipes/usd-mojo/recipe.yaml +++ b/recipes/usd-mojo/recipe.yaml @@ -5,7 +5,10 @@ }, "source": { "git": "https://github.com/henlamp/usd-mojo.git", - "rev": "8908e9815627d4d478edb59fe074166fb7962268" + "rev": "8908e9815627d4d478edb59fe074166fb7962268", + "patches": [ + "install-rpath.patch" + ] }, "build": { "number": 0, From 6e1f784a6be47b1d0947bb47cb361b5941db8587 Mon Sep 17 00:00:00 2001 From: Henrik Lampe Date: Mon, 9 Nov 2026 21:11:19 +0100 Subject: [PATCH 4/6] Keep the RPATH patch free of trailing whitespace --- recipes/usd-mojo/install-rpath.patch | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes/usd-mojo/install-rpath.patch b/recipes/usd-mojo/install-rpath.patch index 8e885c8c..81780304 100644 --- a/recipes/usd-mojo/install-rpath.patch +++ b/recipes/usd-mojo/install-rpath.patch @@ -1,11 +1,10 @@ diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt --- a/native/CMakeLists.txt +++ b/native/CMakeLists.txt -@@ -38,6 +38,7 @@ if(TARGET Python3::Python) +@@ -38,5 +38,6 @@ if(TARGET Python3::Python) target_link_libraries(usd_mojo_bridge PRIVATE Python3::Python) endif() set_target_properties(usd_mojo_bridge PROPERTIES + INSTALL_REMOVE_ENVIRONMENT_RPATH TRUE CXX_VISIBILITY_PRESET default VISIBILITY_INLINES_HIDDEN NO BUILD_RPATH "${USDM_SDK_RPATH}") - From 595d2a8d4bcfd11e0af8d93aed8dbfd5de3b4ffb Mon Sep 17 00:00:00 2001 From: Henrik Lampe Date: Mon, 9 Nov 2026 21:52:15 +0100 Subject: [PATCH 5/6] Normalize the complete Linux bridge RPATH before package validation --- recipes/usd-mojo/install-rpath.patch | 46 ++++++++++++++++++++++------ recipes/usd-mojo/recipe.yaml | 5 ++- 2 files changed, 40 insertions(+), 11 deletions(-) diff --git a/recipes/usd-mojo/install-rpath.patch b/recipes/usd-mojo/install-rpath.patch index 81780304..f08a1e98 100644 --- a/recipes/usd-mojo/install-rpath.patch +++ b/recipes/usd-mojo/install-rpath.patch @@ -1,10 +1,36 @@ -diff --git a/native/CMakeLists.txt b/native/CMakeLists.txt ---- a/native/CMakeLists.txt -+++ b/native/CMakeLists.txt -@@ -38,5 +38,6 @@ if(TARGET Python3::Python) - target_link_libraries(usd_mojo_bridge PRIVATE Python3::Python) - endif() - set_target_properties(usd_mojo_bridge PROPERTIES -+ INSTALL_REMOVE_ENVIRONMENT_RPATH TRUE - CXX_VISIBILITY_PRESET default VISIBILITY_INLINES_HIDDEN NO - BUILD_RPATH "${USDM_SDK_RPATH}") +--- a/tools/conda_install.py ++++ b/tools/conda_install.py +@@ -21,4 +21,26 @@ + runpy.run_path(str(Path(__file__).resolve().parents[1] / "share/usd-mojo/compile.py"), run_name="__main__") + """ ++ ++ ++def normalize_linux_rpath(bridge, native): ++ current = subprocess.check_output( ++ ["patchelf", "--print-rpath", str(bridge)], text=True ++ ).strip() ++ if not current: ++ raise RuntimeError("Installed bridge has no runtime search path") ++ script = native / "normalize_rpath.cmake" ++ script.write_text( ++ 'file(RPATH_CHANGE FILE "${BRIDGE}" OLD_RPATH "${OLD_RPATH}" ' ++ 'NEW_RPATH "$ORIGIN")\n' ++ ) ++ subprocess.run( ++ ["cmake", f"-DBRIDGE={bridge}", f"-DOLD_RPATH={current}", "-P", str(script)], ++ check=True, ++ ) ++ actual = subprocess.check_output( ++ ["patchelf", "--print-rpath", str(bridge)], text=True ++ ).strip() ++ if actual != "$ORIGIN": ++ raise RuntimeError("Installed bridge runtime search path is not relative") + + +@@ -107,4 +129,6 @@ + ) + subprocess.run(["codesign", "--force", "--sign", "-", str(bridge)], check=True) ++ elif sys.platform == "linux": ++ normalize_linux_rpath(bridge, native) + owned = [modules / "usd_mojo.mojoc", bridge] + owned.extend(p for p in share.rglob("*") if p.is_file()) diff --git a/recipes/usd-mojo/recipe.yaml b/recipes/usd-mojo/recipe.yaml index a9e01c48..fea94b05 100644 --- a/recipes/usd-mojo/recipe.yaml +++ b/recipes/usd-mojo/recipe.yaml @@ -42,7 +42,10 @@ "cxx-compiler ==2.0.0", { "if": "linux", - "then": "sysroot_linux-64 ==2.28" + "then": [ + "sysroot_linux-64 ==2.28", + "patchelf >=0.19,<0.20" + ] } ], "host": [ From 0c64c0de7021644f7d1853c01a5a4e9ba3cfc11d Mon Sep 17 00:00:00 2001 From: Henrik Lampe Date: Mon, 9 Nov 2026 21:53:08 +0100 Subject: [PATCH 6/6] Use patch hunks accepted by the community builder --- recipes/usd-mojo/install-rpath.patch | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/recipes/usd-mojo/install-rpath.patch b/recipes/usd-mojo/install-rpath.patch index f08a1e98..d5a0c4f1 100644 --- a/recipes/usd-mojo/install-rpath.patch +++ b/recipes/usd-mojo/install-rpath.patch @@ -1,8 +1,6 @@ --- a/tools/conda_install.py +++ b/tools/conda_install.py -@@ -21,4 +21,26 @@ - runpy.run_path(str(Path(__file__).resolve().parents[1] / "share/usd-mojo/compile.py"), run_name="__main__") - """ +@@ -22,0 +23,22 @@ + + +def normalize_linux_rpath(bridge, native): @@ -25,12 +23,6 @@ + ).strip() + if actual != "$ORIGIN": + raise RuntimeError("Installed bridge runtime search path is not relative") - - -@@ -107,4 +129,6 @@ - ) - subprocess.run(["codesign", "--force", "--sign", "-", str(bridge)], check=True) +@@ -108,0 +131,2 @@ + elif sys.platform == "linux": + normalize_linux_rpath(bridge, native) - owned = [modules / "usd_mojo.mojoc", bridge] - owned.extend(p for p in share.rglob("*") if p.is_file())