Skip to content

build: a plain uv sync builds the C++ module on Windows - #86

Open
NiJingzhe wants to merge 1 commit into
devfrom
fix/windows-uv-sync
Open

NiJingzhe wants to merge 1 commit into
devfrom
fix/windows-uv-sync

Conversation

@NiJingzhe

Copy link
Copy Markdown
Collaborator

Problem

uv run / uv sync on Windows failed after the 2.2.9 release bump: uv rebuilds the editable install when pyproject.toml changes, and without Visual Studio CMake defaulted to NMake ('nmake' -? failed). Contributors had to hand-set CMAKE_GENERATOR, CC, CXX, CMAKE_ARGS.

Change

  • tools/build_backend/scad_build.py: PEP 517 backend wrapping scikit-build-core. On Windows: Ninja + gcc on PATH when VS is absent, OCCT located (SCAD_OCCT_PREFIX, C:/occt, per-user cache, else built once with tools/build_occt.py), job count limited by RAM. User/CI-set variables win; Linux/macOS untouched.
  • [tool.uv] cache-keys: rebuild only when src/cpp changes, not on a version bump.

Build tooling only, the published package is unchanged, so no release.

Tested

Windows 11, no VS, no env vars: a bare uv run builds with Ninja + gcc and imports. The OCCT auto-build path (no OCCT present) and the cibuildwheel/sdist path are only covered by this PR's CI.

🤖 Generated with Claude Code

…d OCCT detection, rebuild only when src/cpp changes)

On a Windows machine without Visual Studio, scikit-build-core left the generator to CMake's default (NMake), the build failed
with "'nmake' -? failed", and every contributor had to hand-set CMAKE_GENERATOR / CC / CXX / CMAKE_ARGS. uv also rebuilt the
editable install on any pyproject.toml change (a version bump), which is how the failure showed up after the 2.2.9 release.

- tools/build_backend/scad_build.py: a PEP 517 backend wrapping scikit-build-core. On Windows it uses Ninja + the gcc on PATH
  when Visual Studio is absent, finds OCCT (SCAD_OCCT_PREFIX, C:/occt, a per-user cache, or builds it once with
  tools/build_occt.py) and limits jobs by RAM (g++ ran out of memory under ninja's default). Anything the user or CI sets wins.
- [tool.uv] cache-keys: rebuild only when src/cpp changes.

Build tooling only: nothing in the published package changes, so no version bump.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant