@@ -23,9 +23,11 @@ Thank you for your interest in contributing to CUDA Python! Based on the type of
2323 - [ Recommended clone] ( #recommended-clone )
2424 - [ Fixing an existing clone] ( #fixing-an-existing-clone )
2525 - [ Symptoms of a bad clone] ( #symptoms-of-a-bad-clone )
26+ - [ Development on Windows] ( #development-on-windows )
27+ - [ Enabling git symlinks] ( #enabling-git-symlinks )
28+ - [ Pre-commit lychee workaround] ( #pre-commit-lychee-workaround )
2629 - [ Type stubs for cuda.core] ( #type-stubs-for-cudacore )
2730 - [ Pre-commit] ( #pre-commit )
28- - [ Pre-commit on Windows] ( #pre-commit-on-windows )
2931 - [ Pixi lockfiles] ( #pixi-lockfiles )
3032 - [ Signing Your Work] ( #signing-your-work )
3133 - [ Code signing] ( #code-signing )
@@ -42,6 +44,11 @@ Thank you for your interest in contributing to CUDA Python! Based on the type of
4244
4345## Cloning the repository
4446
47+ > ** Windows contributors (not WSL):** configure Git for symlinks * before*
48+ > cloning, or the shared PEP 517 build-hook file lands as a text stub instead
49+ > of a working symlink. See [ Enabling git symlinks] ( #enabling-git-symlinks )
50+ > under Development on Windows.
51+
4552Every package in this repository derives its version from git tags using
4653[ ` setuptools-scm ` ] ( https://setuptools-scm.readthedocs.io/ ) , so ** how you clone
4754determines whether you can build at all, and whether the version you build is
@@ -128,6 +135,63 @@ hyphens replaced by underscores: `..._FOR_CUDA_BINDINGS`, `..._FOR_CUDA_CORE`,
128135genuinely cannot provide tags; it is not a substitute for a correct clone.
129136
130137
138+ ## Development on Windows
139+
140+ This section collects the Windows-specific setup a contributor needs when
141+ working outside of WSL. WSL contributors can follow the Linux flow in the rest
142+ of this document.
143+
144+ ### Enabling git symlinks
145+
146+ The ` cuda_core ` PEP 517 backend shares source-of-truth helper files with
147+ ` cuda_bindings ` via symbolic links. Git materializes symlinks by default on
148+ Linux and macOS, but on Windows it needs to be configured before cloning,
149+ otherwise the "symlinks" land in your working tree as plain text files that
150+ contain the target path — enough to look right in ` git status ` , but not enough
151+ to actually build.
152+
153+ 1 . ** [ Activate Developer Mode] ( https://learn.microsoft.com/en-us/windows/apps/get-started/enable-your-device-for-development#activate-developer-mode ) **
154+ so Git can create symlinks without Administrator privileges.
155+
156+ 2 . ** Enable Git symlink support globally** so newly-cloned repositories inherit
157+ the setting:
158+
159+ ``` console
160+ $ git config --global core.symlinks true
161+ ```
162+
163+ Then clone as usual (see [ Cloning the repository] ( #cloning-the-repository ) ).
164+
165+ If you already cloned without these settings, note that ` git clone ` probes
166+ symlink support at clone time and writes ` core.symlinks=false ` into the
167+ repo-local config when the probe fails. Repo-local config overrides
168+ ` --global ` , so you must clear it * inside the existing clone* — the global
169+ setting alone won't take effect:
170+
171+ ``` console
172+ $ git config core.symlinks true # no --global — clears the repo-local override
173+ $ git rm --cached cuda_core/_build_shared.py
174+ $ git checkout HEAD -- cuda_core/_build_shared.py
175+ ```
176+
177+ In practice, deleting the checkout and re-cloning after the two steps at
178+ the top of this section (Developer Mode + `git config --global core.symlinks
179+ true`) is usually simpler and less error-prone than repairing an existing
180+ clone in place.
181+
182+ ### Pre-commit lychee workaround
183+
184+ For development on Windows (not WSL), the ` lychee ` pre-commit task will not
185+ work when running ` pre-commit run --all-files ` . This problem does not occur
186+ if you install the pre-commit hook and run it automatically as part of your
187+ ` git commit ` workflow. To resolve this, you can either:
188+
189+ 1 . Run ` pre-commit ` in Git Bash, rather than directly in PowerShell or cmd
190+
191+ 2 . Skip it by setting the environment variable ` SKIP ` to ` lychee ` . This would
192+ be ` $env:SKIP = "lychee" ` in PowerShell or ` set SKIP=lychee ` in cmd.
193+
194+
131195## Type stubs for cuda.core
132196
133197` cuda.core ` is a PEP 561-compliant package: it ships a ` py.typed ` marker and
@@ -168,17 +232,7 @@ between commits, leaving stale headers or out-of-date stubs in the history.
168232If the hook isn't installed, ` pre-commit run ` (and CI) will print a visible
169233warning reminding you to run ` pre-commit install ` .
170234
171- ### Pre-commit on Windows
172-
173- For development on Windows (not WSL), the ` lychee ` pre-commit task will not work
174- when running ` pre-commit run --all-files ` . This problem does not occur if you
175- install the pre-commit hook and run it automatically as part of your `git
176- commit` workflow. To resolve this, you can either:
177-
178- 1 . Run ` pre-commit ` in Git Bash, rather than directly in PowerShell or cmd
179-
180- 2 . Skip it by setting the environment variable ` SKIP ` to ` lychee ` . This would
181- be ` $env:SKIP = "lychee" ` in PowerShell or ` set SKIP=lychee ` in cmd.
235+ Windows contributors: see [ Pre-commit lychee workaround] ( #pre-commit-lychee-workaround ) under Development on Windows.
182236
183237## Pixi lockfiles
184238
0 commit comments