From 750df46e278f5322d28b971087fa10bd129b7f15 Mon Sep 17 00:00:00 2001 From: Jiwen Cai Date: Fri, 21 Aug 2026 17:18:30 +0000 Subject: [PATCH] docs: drop the removed CMake presets from the mujoco_xr example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit f8b5eaa59 deleted CMakePresets.json and rewrote the build pages, but examples/mujoco_xr kept telling readers to run `cmake --preset py3.12` and to look for the build venv under build/cmake-cpython-312 — commands that now fail outright. Point them at `cmake -B build` instead, in the README and in the two error messages that name a configure command. The example's tests pinned requires-python to ==3.12.*, which only held because the preset always selected 3.12; against the 3.11 default that pin makes `ctest -L mujoco_xr` fail before it runs. Widen it to the >=3.11,<3.14 range the rest of the repo uses — tests/CMakeLists.txt already passes the real build interpreter to `uv run --python`, which is what guarantees the _mujoco_xr*.so ABI match. Also drop the -py3.12 suffix from the build directories the docs and the version-mismatch error suggest: one tree named build/ is enough, and the suffix tied a directory name to an interpreter that the -D flag already selects. Signed-off-by: Jiwen Cai --- cmake/SetupPython.cmake | 6 +++--- .../getting_started/build_from_source/index.rst | 16 ++++++++-------- docs/source/references/build.rst | 6 +++--- examples/mujoco_xr/CMakeLists.txt | 2 +- examples/mujoco_xr/README.md | 12 ++++++------ .../isaacteleop_examples/mujoco_xr/__init__.py | 2 +- examples/mujoco_xr/tests/pyproject.toml | 6 +++--- src/python/isaacteleop/rig/launcher.py | 6 +++--- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/cmake/SetupPython.cmake b/cmake/SetupPython.cmake index a717eeaca..c928bce94 100644 --- a/cmake/SetupPython.cmake +++ b/cmake/SetupPython.cmake @@ -83,9 +83,9 @@ if(ISAAC_TELEOP_PYTHON_CONFIGURED AND message(FATAL_ERROR "This build directory is configured for Python ${ISAAC_TELEOP_PYTHON_CONFIGURED}, " "but ISAAC_TELEOP_PYTHON_VERSION is now ${ISAAC_TELEOP_PYTHON_VERSION}. The Python " - "version is baked into the CMake cache and the build venv; configure a different " - "build directory instead (cmake -B build-py${ISAAC_TELEOP_PYTHON_VERSION} " - "-DISAAC_TELEOP_PYTHON_VERSION=${ISAAC_TELEOP_PYTHON_VERSION}), or delete this one.") + "version is baked into the CMake cache and the build venv; delete this build " + "directory and configure again with " + "-DISAAC_TELEOP_PYTHON_VERSION=${ISAAC_TELEOP_PYTHON_VERSION}.") endif() # Guard to prevent multiple inclusions from overwriting our settings diff --git a/docs/source/getting_started/build_from_source/index.rst b/docs/source/getting_started/build_from_source/index.rst index bfb992807..b10465d92 100644 --- a/docs/source/getting_started/build_from_source/index.rst +++ b/docs/source/getting_started/build_from_source/index.rst @@ -154,13 +154,13 @@ Add any other options as ``-D`` flags on the configure line, for example The Python version is baked into a build directory's CMake cache and its build venv, so ``ISAAC_TELEOP_PYTHON_VERSION`` cannot be changed on an existing tree — - configuring again with a different value fails with an explanatory error. Give - each version its own directory: + configuring again with a different value fails with an explanatory error. Select + it on the first configure, and delete the tree to switch later: .. code-block:: bash - cmake -B build-py3.12 -DISAAC_TELEOP_PYTHON_VERSION=3.12 - cmake --build build-py3.12 --parallel + cmake -B build -DISAAC_TELEOP_PYTHON_VERSION=3.12 + cmake --build build --parallel This will: @@ -260,13 +260,13 @@ The CMake options (defined in root :code-file:`CMakeLists.txt` and :code-file:`c Examples ~~~~~~~~ -Build for a different Python version — each needs its own build directory -(``3.11``, ``3.12``, ``3.13`` are supported): +Build for a different Python version (``3.11``, ``3.12``, ``3.13`` are supported; +delete ``build/`` first if it is already configured for another one): .. code-block:: bash - cmake -B build-py3.12 -DISAAC_TELEOP_PYTHON_VERSION=3.12 - cmake --build build-py3.12 --parallel + cmake -B build -DISAAC_TELEOP_PYTHON_VERSION=3.12 + cmake --build build --parallel Debug build: diff --git a/docs/source/references/build.rst b/docs/source/references/build.rst index 209accdd1..01dbac30c 100644 --- a/docs/source/references/build.rst +++ b/docs/source/references/build.rst @@ -95,15 +95,15 @@ two build paths therefore never share a directory: - **classic CMake** → whatever you pass to ``-B``, ``build/`` by convention. ``ISAAC_TELEOP_PYTHON_VERSION`` selects the interpreter (default ``3.11``), and changing it on an existing tree is rejected with an error rather than silently - reusing the old one — give each version its own directory. + reusing the old one — delete the tree to switch versions. .. code-block:: bash - cmake -B build + cmake -B build # default 3.11 cmake --build build --parallel cmake --install build - cmake -B build-py3.12 -DISAAC_TELEOP_PYTHON_VERSION=3.12 # a second version + cmake -B build -DISAAC_TELEOP_PYTHON_VERSION=3.12 # after rm -rf build - **pip / scikit-build-core** → ``build-wheel//`` (e.g. ``build-wheel/cpython-312/``), set by ``build-dir`` in diff --git a/examples/mujoco_xr/CMakeLists.txt b/examples/mujoco_xr/CMakeLists.txt index 0a74178b0..e311414cd 100644 --- a/examples/mujoco_xr/CMakeLists.txt +++ b/examples/mujoco_xr/CMakeLists.txt @@ -126,7 +126,7 @@ if(NOT _mujoco_probe_rc EQUAL 0) # example, so it names the exact command. Configure CREATES that # interpreter, hence the re-configure step in the README. message(STATUS "mujoco_xr: skipped -- '${Python3_EXECUTABLE}' cannot import mujoco. " - "Install it and re-run cmake --preset with: " + "Install it and re-run cmake -B ${CMAKE_BINARY_DIR} with: " "uv pip install --python ${Python3_EXECUTABLE} \"mujoco==${_mujoco_declared_pin}\"") return() endif() diff --git a/examples/mujoco_xr/README.md b/examples/mujoco_xr/README.md index c3733c6bd..bc44b1066 100644 --- a/examples/mujoco_xr/README.md +++ b/examples/mujoco_xr/README.md @@ -174,23 +174,23 @@ wheel is there. ```bash # 1. Configure once to create the build venv. This first pass necessarily # reports `-- mujoco_xr: skipped ...` — expected, not a failure. -cmake --preset py3.12 -DBUILD_VIZ=ON +cmake -B build -DBUILD_VIZ=ON # 2. Install mujoco into the interpreter configure just created. `python -m pip` # does not work: that venv has no pip. -uv pip install --python build/cmake-cpython-312/teleop_build_venv/bin/python "mujoco==3.11.0" +uv pip install --python build/teleop_build_venv/bin/python "mujoco==3.11.0" # 3. Re-configure. NOW the probe finds mujoco and the example is added. -cmake --preset py3.12 -DBUILD_VIZ=ON +cmake -B build -DBUILD_VIZ=ON # 4. Build. There is no `cmake --install` step for this example. -cmake --build --preset py3.12 --parallel +cmake --build build --parallel ``` A green build does **not** mean this example compiled. The reliable check: ```bash -cmake --preset py3.12 -DBUILD_VIZ=ON 2>&1 | grep '^-- mujoco_xr:' +cmake -B build -DBUILD_VIZ=ON 2>&1 | grep '^-- mujoco_xr:' ``` The `ON` line names the exact `libmujoco.so.*` that was linked. There is no @@ -820,7 +820,7 @@ alpha. No C++ renderer change is needed or wanted for it. ## Tests ```bash -ctest --test-dir build/cmake-cpython-312 -L mujoco_xr --output-on-failure +ctest --test-dir build -L mujoco_xr --output-on-failure ``` | file | covers | diff --git a/examples/mujoco_xr/python/isaacteleop_examples/mujoco_xr/__init__.py b/examples/mujoco_xr/python/isaacteleop_examples/mujoco_xr/__init__.py index 8ce4f1cde..a0c0a539f 100644 --- a/examples/mujoco_xr/python/isaacteleop_examples/mujoco_xr/__init__.py +++ b/examples/mujoco_xr/python/isaacteleop_examples/mujoco_xr/__init__.py @@ -28,7 +28,7 @@ "and project.dependencies) must name one version, and reinstalling recompiles against it: " "uv pip install --reinstall ./examples/mujoco_xr. (If you hit this from the in-tree ctest " "path instead, the extension came from the root build: install that same version into " - "build//teleop_build_venv/bin/python and re-run cmake --preset.) " + "build/teleop_build_venv/bin/python and re-run cmake -B build.) " "mjModel* / mjData* pointers cannot cross this boundary otherwise." ) diff --git a/examples/mujoco_xr/tests/pyproject.toml b/examples/mujoco_xr/tests/pyproject.toml index 25875cbf7..8e19f1dee 100644 --- a/examples/mujoco_xr/tests/pyproject.toml +++ b/examples/mujoco_xr/tests/pyproject.toml @@ -11,9 +11,9 @@ # file rather than this field. name = "isaacteleop-examples-mujoco-xr-tests" version = "0.0.0" -# Pinned because these tests import the ABI-specific _mujoco_xr*.so built by the -# preset's interpreter. -requires-python = "==3.12.*" +# Matches ../pyproject.toml. The ABI match with _mujoco_xr*.so comes from +# CMakeLists.txt passing the build interpreter to `uv run --python`. +requires-python = ">=3.11,<3.14" [project.optional-dependencies] dev = [ diff --git a/src/python/isaacteleop/rig/launcher.py b/src/python/isaacteleop/rig/launcher.py index 212bf780f..7de143021 100644 --- a/src/python/isaacteleop/rig/launcher.py +++ b/src/python/isaacteleop/rig/launcher.py @@ -84,9 +84,9 @@ _CMAKE_CACHE = "CMakeCache.txt" #: Directories that hold build trees: a hand-made ``cmake -B build``, and the -#: managed preset/wheel trees, which are one level down (``build-cmake/ -#: cpython-311``). Only used to sharpen an error message, so an unknown -#: layout costs nothing but a less specific remedy. +#: managed wheel trees, which are one level down (``build-wheel/cpython-311``). +#: Only used to sharpen an error message, so an unknown layout costs nothing +#: but a less specific remedy. _BUILD_DIRS = ("build", "build-cmake", "build-wheel")