diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index f9c7d19e8..74add0f97 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -45,15 +45,10 @@ jobs: with: fetch-depth: 0 # Full history for accurate git describe - # CMakePresets.json defines one preset per supported Python (py3.11 … py3.13), - # each configuring an isolated build/cmake-cpython-3XX directory. Derive the - # preset name and its build directory once here; later steps (ctest, coverage, - # test packaging, install) need the directory the preset chose. - - name: Resolve CMake preset - run: | - py="${{ matrix.python_version }}" - echo "CMAKE_PRESET=py${py}" >> "$GITHUB_ENV" - echo "BUILD_DIR=build/cmake-cpython-${py//./}" >> "$GITHUB_ENV" + # One build directory per job; later steps (ctest, coverage, test packaging, + # install) all refer to it through BUILD_DIR. + - name: Resolve build directory + run: echo "BUILD_DIR=build" >> "$GITHUB_ENV" - name: Install uv uses: ./.github/actions/setup-uv @@ -113,9 +108,9 @@ jobs: path: | ~/vcpkg ${{ env.BUILD_DIR }}/vcpkg_installed - key: vcpkg-${{ runner.os }}-${{ runner.arch }}-${{ env.CMAKE_PRESET }}-${{ env.VCPKG_COMMIT }}-${{ hashFiles('cmake/DepthAIVcpkgManifest.cmake') }} + key: vcpkg-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}-${{ env.VCPKG_COMMIT }}-${{ hashFiles('cmake/DepthAIVcpkgManifest.cmake') }} restore-keys: | - vcpkg-${{ runner.os }}-${{ runner.arch }}-${{ env.CMAKE_PRESET }}-${{ env.VCPKG_COMMIT }}- + vcpkg-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python_version }}-${{ env.VCPKG_COMMIT }}- - name: Setup vcpkg run: | @@ -152,9 +147,8 @@ jobs: ) fi - # The preset supplies ISAAC_TELEOP_PYTHON_VERSION and the per-Python - # build directory; everything else is a command-line -D override. - cmake --preset "${CMAKE_PRESET}" \ + cmake -B "${BUILD_DIR}" \ + -DISAAC_TELEOP_PYTHON_VERSION=${{ matrix.python_version }} \ -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \ -DCMAKE_C_COMPILER_LAUNCHER=ccache \ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ @@ -167,7 +161,7 @@ jobs: "${coverage_args[@]}" - name: Build - run: cmake --build --preset "${CMAKE_PRESET}" --parallel 4 + run: cmake --build "${BUILD_DIR}" --parallel 4 - name: ccache stats run: ccache --show-stats diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 2ca2aa8bb..030ba13de 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -25,11 +25,8 @@ jobs: env: SCCACHE_GHA_ENABLED: "true" - # CMakePresets.json preset used to configure/build, and the build directory - # it selects. Windows has no Python matrix, so it pins the CMakeLists - # default (3.11); keep the two in sync if that changes. - CMAKE_PRESET: py3.11 - BUILD_DIR: build/cmake-cpython-311 + # Windows has no Python matrix, so it takes the CMakeLists default (3.11). + BUILD_DIR: build strategy: matrix: @@ -55,18 +52,16 @@ jobs: # vcpkg - required when BUILD_PLUGIN_OAK_CAMERA=ON for DepthAI v3.x deps # # vcpkg installs manifest ports into ${CMAKE_BINARY_DIR}/vcpkg_installed, so - # this path tracks the preset's build directory. The preset is part of the key - # for the same reason: an entry saved from a different build directory would - # restore to a path this job never reads. + # this path tracks the build directory. - name: Cache vcpkg uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: | C:\vcpkg ${{ env.BUILD_DIR }}/vcpkg_installed - key: vcpkg-${{ runner.os }}-${{ env.CMAKE_PRESET }}-${{ hashFiles('cmake/DepthAIVcpkgManifest.cmake') }} + key: vcpkg-${{ runner.os }}-${{ hashFiles('cmake/DepthAIVcpkgManifest.cmake') }} restore-keys: | - vcpkg-${{ runner.os }}-${{ env.CMAKE_PRESET }}- + vcpkg-${{ runner.os }}- - name: Setup vcpkg run: | @@ -104,14 +99,11 @@ jobs: - name: Configure CMake # Note: - # The py3.11 preset selects Python 3.11 (the CMakeLists default) and the - # build/cmake-cpython-311 build directory; the generator and the flags below - # are command-line additions on top of it. # sccache does not work with VSBuild, so we use Ninja generator here. # -G Ninja would pickup mingw64 by default on Windows, so we explicitly set the compiler to cl.exe # Force embedded debug info (Z7) to avoid PDB contention whenever debug info is generated. run: > - cmake --preset ${{ env.CMAKE_PRESET }} -G Ninja + cmake -B ${{ env.BUILD_DIR }} -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DENABLE_EXPERIMENTAL_WINDOWS_BUILD=ON -DCMAKE_C_COMPILER_LAUNCHER=sccache @@ -124,7 +116,7 @@ jobs: -DCMAKE_TOOLCHAIN_FILE="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" - name: Build - run: cmake --build --preset ${{ env.CMAKE_PRESET }} --parallel + run: cmake --build ${{ env.BUILD_DIR }} --parallel - name: Run All Tests run: ctest --test-dir ${{ env.BUILD_DIR }} --output-on-failure --parallel diff --git a/.gitignore b/.gitignore index f3d14020a..cfdda8806 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ package-lock.json # Build directories build/ +build-wheel/ _build/ **/build/ install/ diff --git a/CMakePresets.json b/CMakePresets.json deleted file mode 100644 index 3df021faf..000000000 --- a/CMakePresets.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "version": 3, - "cmakeMinimumRequired": { "major": 3, "minor": 21, "patch": 0 }, - "configurePresets": [ - { - "name": "py3.11", - "displayName": "Python 3.11 (build/cmake-cpython-311)", - "binaryDir": "${sourceDir}/build/cmake-cpython-311", - "cacheVariables": { "ISAAC_TELEOP_PYTHON_VERSION": "3.11" } - }, - { - "name": "py3.12", - "displayName": "Python 3.12 (build/cmake-cpython-312)", - "binaryDir": "${sourceDir}/build/cmake-cpython-312", - "cacheVariables": { "ISAAC_TELEOP_PYTHON_VERSION": "3.12" } - }, - { - "name": "py3.13", - "displayName": "Python 3.13 (build/cmake-cpython-313)", - "binaryDir": "${sourceDir}/build/cmake-cpython-313", - "cacheVariables": { "ISAAC_TELEOP_PYTHON_VERSION": "3.13" } - } - ], - "buildPresets": [ - { "name": "py3.11", "configurePreset": "py3.11" }, - { "name": "py3.12", "configurePreset": "py3.12" }, - { "name": "py3.13", "configurePreset": "py3.13" } - ] -} diff --git a/CMakePresets.json.license b/CMakePresets.json.license deleted file mode 100644 index 817df2442..000000000 --- a/CMakePresets.json.license +++ /dev/null @@ -1,2 +0,0 @@ -SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. -SPDX-License-Identifier: Apache-2.0 diff --git a/cmake/SetupPython.cmake b/cmake/SetupPython.cmake index 4ce67f6da..a717eeaca 100644 --- a/cmake/SetupPython.cmake +++ b/cmake/SetupPython.cmake @@ -67,6 +67,27 @@ isaac_teleop_enforce_python_version( option(BUILD_PYTHON_BINDINGS "Build Python bindings" ON) +# Build trees configured before this stamp existed hold a bare TRUE. Their version +# is unknowable, so adopt them instead of failing on a value we cannot compare. +if(ISAAC_TELEOP_PYTHON_CONFIGURED STREQUAL "TRUE") + set(ISAAC_TELEOP_PYTHON_CONFIGURED "${ISAAC_TELEOP_PYTHON_VERSION}" CACHE INTERNAL + "Python version this build directory was configured for") +endif() + +# Discovery runs once per build tree. Re-running it on a version change would not +# be enough anyway: the NumPy build venv below is keyed to the interpreter it was +# created from. So reject the change and require a fresh directory, rather than +# configuring for one version while compiling extensions against another. +if(ISAAC_TELEOP_PYTHON_CONFIGURED AND + NOT ISAAC_TELEOP_PYTHON_CONFIGURED STREQUAL ISAAC_TELEOP_PYTHON_VERSION) + 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.") +endif() + # Guard to prevent multiple inclusions from overwriting our settings if(NOT ISAAC_TELEOP_PYTHON_CONFIGURED) if(SKBUILD) @@ -142,8 +163,9 @@ if(NOT ISAAC_TELEOP_PYTHON_CONFIGURED) set(PYTHON_INCLUDE_DIRS "${Python3_INCLUDE_DIRS}" CACHE PATH "Python include dirs" FORCE) set(PYTHON_LIBRARIES "${Python3_LIBRARIES}" CACHE FILEPATH "Python libraries" FORCE) - # Mark as configured to prevent re-running - set(ISAAC_TELEOP_PYTHON_CONFIGURED TRUE CACHE INTERNAL "Python configuration completed") + # Stamp the version, not a bare TRUE, so the guard above can catch a change. + set(ISAAC_TELEOP_PYTHON_CONFIGURED "${ISAAC_TELEOP_PYTHON_VERSION}" CACHE INTERNAL + "Python version this build directory was configured for") endif() # ============================================================================== diff --git a/docs/source/getting_started/build_from_source/index.rst b/docs/source/getting_started/build_from_source/index.rst index 1cf89b2bb..1f5123144 100644 --- a/docs/source/getting_started/build_from_source/index.rst +++ b/docs/source/getting_started/build_from_source/index.rst @@ -107,30 +107,28 @@ See :ref:`dedicated-cloudxr-runtime`. 2. CMake: Configure and build ----------------------------- -From the project root, configure with a **preset** — there is one per supported -Python version (``py3.11`` … ``py3.13``; see :code-file:`CMakePresets.json`). A -preset selects the Python version and an isolated per-version build directory, so -different versions never share (and clobber) one configured CMake cache: +From the project root: .. code-block:: bash - cmake --preset py3.12 # configure - cmake --build --preset py3.12 --parallel # build - cmake --install build/cmake-cpython-312 # install + cmake -B build # configure + cmake --build build --parallel # build + cmake --install build # install -``cmake --preset py3.12`` is shorthand for the explicit configure it expands to — -an isolated build directory plus the Python version: +Add any other options as ``-D`` flags on the configure line, for example +``cmake -B build -DCMAKE_BUILD_TYPE=Debug``. -.. code-block:: bash +.. important:: + + 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: - cmake -B build/cmake-cpython-312 -DISAAC_TELEOP_PYTHON_VERSION=3.12 + .. code-block:: bash -Add any other options as ``-D`` flags on the same line; a command-line ``-D`` -overrides the preset (e.g. ``cmake --preset py3.12 -DCMAKE_BUILD_TYPE=Debug``). -Pick the preset that matches your interpreter rather than overriding -``ISAAC_TELEOP_PYTHON_VERSION`` by hand. (A bare ``cmake -B build`` still works -for a quick default build — Python 3.11 into ``./build`` — but the presets are -the recommended path.) + cmake -B build-py3.12 -DISAAC_TELEOP_PYTHON_VERSION=3.12 + cmake --build build-py3.12 --parallel This will: @@ -151,7 +149,7 @@ To disable enforcement, set ``ENABLE_CLANG_FORMAT_CHECK`` to ``OFF``: .. code-block:: bash - cmake --preset py3.12 -DENABLE_CLANG_FORMAT_CHECK=OFF + cmake -B build -DENABLE_CLANG_FORMAT_CHECK=OFF Useful targets: @@ -160,8 +158,8 @@ Useful targets: .. code-block:: bash - cmake --build --preset py3.12 --target clang_format_check - cmake --build --preset py3.12 --target clang_format_fix + cmake --build build --target clang_format_check + cmake --build build --target clang_format_fix Other Build options ~~~~~~~~~~~~~~~~~~~ @@ -228,55 +226,55 @@ The CMake options (defined in root :code-file:`CMakeLists.txt` and :code-file:`c Examples ~~~~~~~~ -Build for a different Python version — use the matching preset (``py3.11``, -``py3.12``, ``py3.13``): +Build for a different Python version — each needs its own build directory +(``3.11``, ``3.12``, ``3.13`` are supported): .. code-block:: bash - cmake --preset py3.12 - cmake --build --preset py3.12 --parallel + cmake -B build-py3.12 -DISAAC_TELEOP_PYTHON_VERSION=3.12 + cmake --build build-py3.12 --parallel Debug build: .. code-block:: bash - cmake --preset py3.12 -DCMAKE_BUILD_TYPE=Debug - cmake --build --preset py3.12 + cmake -B build -DCMAKE_BUILD_TYPE=Debug + cmake --build build Build without examples: .. code-block:: bash - cmake --preset py3.12 -DBUILD_EXAMPLES=OFF - cmake --build --preset py3.12 + cmake -B build -DBUILD_EXAMPLES=OFF + cmake --build build Build without Python bindings: .. code-block:: bash - cmake --preset py3.12 -DBUILD_PYTHON_BINDINGS=OFF - cmake --build --preset py3.12 + cmake -B build -DBUILD_PYTHON_BINDINGS=OFF + cmake --build build Build with OAK camera plugin (pulls Hunter/DepthAI): .. code-block:: bash - cmake --preset py3.12 -DBUILD_PLUGIN_OAK_CAMERA=ON - cmake --build --preset py3.12 + cmake -B build -DBUILD_PLUGIN_OAK_CAMERA=ON + cmake --build build Build only the teleop_ros2 example (e.g. for Docker, as in :code-file:`build-ubuntu.yml <.github/workflows/build-ubuntu.yml>` teleop-ros2-docker job): .. code-block:: bash - cmake --preset py3.12 -DBUILD_EXAMPLES=OFF -DBUILD_EXAMPLE_TELEOP_ROS2=ON - cmake --build --preset py3.12 + cmake -B build -DBUILD_EXAMPLES=OFF -DBUILD_EXAMPLE_TELEOP_ROS2=ON + cmake --build build -Clean rebuild (``--fresh`` wipes the preset's CMake cache and reconfigures): +Clean rebuild (``--fresh`` wipes the CMake cache and reconfigures): .. code-block:: bash - cmake --preset py3.12 --fresh - cmake --build --preset py3.12 + cmake -B build --fresh + cmake --build build 3. Running tests ---------------- @@ -285,10 +283,10 @@ When ``BUILD_TESTING`` is ``ON``, CTest is enabled at the top level. Run all tes .. code-block:: bash - cmake --build --preset py3.12 --target test + cmake --build build --target test # Or with ctest (e.g. parallel, output on failure) - ctest --test-dir build/cmake-cpython-312 --output-on-failure --parallel + ctest --test-dir build --output-on-failure --parallel The CI uses ``ctest`` (see :code-file:`build-ubuntu.yml <.github/workflows/build-ubuntu.yml>`). @@ -327,12 +325,11 @@ the released wheels) is unchanged, so the two coexist. .. note:: - The CMake build tree is kept under ``build/wheel-/`` (e.g. - ``build/wheel-cpython-311/``) — one per Python version, so different + The CMake build tree is kept under ``build-wheel//`` (e.g. + ``build-wheel/cpython-311/``) — one per Python version, so different interpreters never share a configured CMake cache — instead of a temporary - directory. Re-installs are therefore incremental. The classic CMake path uses - sibling ``build/cmake-/`` trees (via the presets below) with the same - per-version tag, so the two never collide; ``build/`` is gitignored. + directory. Re-installs are therefore incremental. It sits outside ``build/``, so + it never collides with a classic ``cmake -B build`` tree. Both are gitignored. What this path does and how it differs from the classic flow: diff --git a/docs/source/getting_started/lerobot/data_collection_sim.rst b/docs/source/getting_started/lerobot/data_collection_sim.rst index 3c205c7fb..9ae44a33c 100644 --- a/docs/source/getting_started/lerobot/data_collection_sim.rst +++ b/docs/source/getting_started/lerobot/data_collection_sim.rst @@ -123,16 +123,16 @@ Collect Teleop Data sudo apt-get install -y build-essential cmake libx11-dev clang-format-14 ccache patchelf Then clone, configure, build, and install (see - :doc:`/getting_started/build_from_source/index` for the full prerequisite list, the CMake - presets, and all build options): + :doc:`/getting_started/build_from_source/index` for the full prerequisite list and all + build options): .. code-block:: bash git clone https://github.com/NVIDIA/IsaacTeleop.git cd IsaacTeleop - cmake --preset py3.12 # configure (use the preset matching your Python) - cmake --build --preset py3.12 --parallel # build - cmake --install build/cmake-cpython-312 # install into ./install + cmake -B build # configure + cmake --build build --parallel # build + cmake --install build # install into ./install The plugin lands at:: @@ -150,7 +150,7 @@ Collect Teleop Data .. code-block:: bash - cmake --build --preset py3.12 --target so101_leader_plugin + cmake --build build --target so101_leader_plugin .. admonition:: Build troubleshooting :class: tip @@ -165,20 +165,20 @@ Collect Teleop Data ``cmake/ClangFormat.cmake``) - Install the pinned formatter: ``sudo apt-get install -y clang-format-14``. To skip the gate instead, reconfigure with - ``cmake --preset py3.12 -DENABLE_CLANG_FORMAT_CHECK=OFF``. + ``cmake -B build -DENABLE_CLANG_FORMAT_CHECK=OFF``. * - ``so101_leader_plugin: No such file or directory`` - - The build was never installed. Re-run ``cmake --install build/cmake-cpython-312``, + - The build was never installed. Re-run ``cmake --install build``, or run the binary from the build tree at - ``build/cmake-cpython-312/src/plugins/so101_leader/so101_leader_plugin``. + ``build/src/plugins/so101_leader/so101_leader_plugin``. * - Configure fails downloading dependencies - OpenXR SDK, yaml-cpp, pybind11, FlatBuffers, and MCAP are fetched by CMake ``FetchContent`` — an internet connection (and any proxy settings) is required at configure time. * - ``Could NOT find Python`` / wrong interpreter - - Use the preset matching your interpreter (``py3.11``, ``py3.12``, ``py3.13``) - rather than overriding ``ISAAC_TELEOP_PYTHON_VERSION``. + - Set ``-DISAAC_TELEOP_PYTHON_VERSION`` on a **fresh** build directory; it cannot + be changed on an existing one. * - Stale cache after changing options - - ``cmake --preset py3.12 --fresh`` wipes the cache and reconfigures. + - ``cmake -B build --fresh`` wipes the cache and reconfigures. **2. Set up and calibrate the leader arm** diff --git a/docs/source/references/build.rst b/docs/source/references/build.rst index 0aa17e24e..3e002628e 100644 --- a/docs/source/references/build.rst +++ b/docs/source/references/build.rst @@ -69,7 +69,7 @@ After building, install the wheel with ``uv`` or ``pip``: Installing from source with pip (scikit-build-core) --------------------------------------------------- -In addition to the CMake ``--preset`` flow above (which stages the package +In addition to the classic CMake flow above (which stages the package and produces a wheel under ``install/wheels/``), the repository ships a root :code-file:`pyproject.toml` that exposes ``isaacteleop`` through the `scikit-build-core `_ build backend, @@ -88,38 +88,40 @@ subpackages under an editable install — see Build directory layout and per-Python-version builds ---------------------------------------------------- -A CMake binary directory holds exactly one configured Python version (the -interpreter and ABI are baked into ``CMakeCache.txt``), so the two build paths use -distinct, per-version directories under ``build/`` — never a shared one. Both key -the directory off the interpreter's ``cache_tag`` (``sys.implementation.cache_tag``, -e.g. ``cpython-312``) so the per-version tag is consistent between them: +A CMake binary directory holds exactly one configured Python version — the +interpreter and ABI are baked into ``CMakeCache.txt`` and into the build venv. The +two build paths therefore never share a directory: -- **pip / scikit-build-core** → ``build/wheel-/`` (e.g. - ``build/wheel-cpython-312/``), set by ``build-dir`` in - :code-file:`pyproject.toml` and chosen automatically per interpreter. -- **classic CMake** → ``build/cmake-/``, via the presets in - :code-file:`CMakePresets.json` (``py3.11`` … ``py3.13``). Each preset sets - ``ISAAC_TELEOP_PYTHON_VERSION`` and its own ``binaryDir``: +- **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. .. code-block:: bash - cmake --preset py3.12 # configures build/cmake-cpython-312 - cmake --build --preset py3.12 --parallel - cmake --install build/cmake-cpython-312 + cmake -B build + cmake --build build --parallel + cmake --install build -The wheel/ABI tag (``cp312-cp312-linux_aarch64``) can't be expressed as a CMake -preset, so ``cache_tag`` is the common tag both paths share. Because each Python -version gets its own directory, switching versions never reuses a stale configured -cache. ``build/`` is gitignored. + cmake -B build-py3.12 -DISAAC_TELEOP_PYTHON_VERSION=3.12 # a second version + +- **pip / scikit-build-core** → ``build-wheel//`` (e.g. + ``build-wheel/cpython-312/``), set by ``build-dir`` in + :code-file:`pyproject.toml` and chosen automatically per interpreter, keyed off + ``sys.implementation.cache_tag``. It lives outside ``build/`` so ``pip install`` + and a classic ``cmake -B build`` never collide, and ``rm -rf build`` leaves the + incremental wheel tree intact. + +``build/`` and ``build-wheel/`` are gitignored. Output locations ---------------- -After a successful build and install: +After a successful build and install, relative to your build directory: -- **C++ libraries:** ``build/src/core/`` (and under each module) -- **Python wheel:** ``build/wheels/isaacteleop-*.whl`` -- **Examples (binaries):** under ``build/examples/`` (e.g. ``build/examples/oxr/cpp/``) +- **C++ libraries:** ``src/core/`` (and under each module) +- **Python wheel:** ``wheels/isaacteleop-*.whl`` +- **Examples (binaries):** under ``examples/`` (e.g. ``examples/oxr/cpp/``) - **Installed files:** ``install/`` (or your ``CMAKE_INSTALL_PREFIX``) - Libraries: ``install/lib/`` - Headers: ``install/include/`` @@ -145,18 +147,18 @@ CMake can't find OpenXR ~~~~~~~~~~~~~~~~~~~~~~~ OpenXR is fetched automatically; it is not a system package. If configuration fails, try a clean configure -(``--fresh`` wipes the preset's CMake cache and reconfigures): +(``--fresh`` wipes the CMake cache and reconfigures): .. code-block:: bash - cmake --preset py3.12 --fresh + cmake -B build --fresh Examples or tests can't find the library ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ When building from the top-level, examples and tests use the build tree. Ensure you run -``cmake --build --preset py3.12`` from the project root and run executables from the build directory -(``build/cmake-cpython-312/``, or use ``cmake --install build/cmake-cpython-312`` and run from ``install/``). +``cmake --build build`` from the project root and run executables from the build directory +(or use ``cmake --install build`` and run from ``install/``). uv or Python version ~~~~~~~~~~~~~~~~~~~~ diff --git a/pyproject.toml b/pyproject.toml index 5d93e2ab7..814a735ff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -91,15 +91,12 @@ package = false cmake.version = ">=3.20,<4" cmake.build-type = "Release" -# Keep the CMake build tree under build/wheel-/ (e.g. -# build/wheel-cpython-312/) rather than a temp dir: re-installs are incremental, +# Keep the CMake build tree under build-wheel// (e.g. +# build-wheel/cpython-312/) rather than a temp dir: re-installs are incremental, # and different Python versions never share one configured CMake cache (which -# would silently reuse the wrong interpreter). {cache_tag} (sys.implementation. -# cache_tag) is used so the tag matches the classic CMake path's -# build/cmake-/ trees (see CMakePresets.json) — the wheel/ABI tag can't -# be expressed as a CMake preset, so cache_tag is the common per-version tag. -# build/ is gitignored. -build-dir = "build/wheel-{cache_tag}" +# would silently reuse the wrong interpreter). It sits outside build/ so it never +# collides with a classic `cmake -B build` tree. Both are gitignored. +build-dir = "build-wheel/{cache_tag}" # No cmake.define overrides: BUILD_EXAMPLES, BUILD_TESTING, BUILD_PLUGINS and the # Linux clang-format gate all stay at their CMake defaults. So a `pip install`