[doc-only] docs: document setuptools-scm clone requirements for source builds - #2424
[doc-only] docs: document setuptools-scm clone requirements for source builds#2424bharatr21 wants to merge 2 commits into
Conversation
Signed-off-by: Bharat Raghunathan <bharatrgatech@gmail.com>
mdboom
left a comment
There was a problem hiding this comment.
The --filter=blob:none is not necessary -- it just reduces the size of the clone while still making it buildable. It's perfectly fine to just use the "default" clone behavior of git, so I think --filter=blob:none just confuses things and should not be mentioned.
If we are concerned about repository size, we should periodically flatten the history of the gh-pages branch. (That is something we would do in automation -- no need for most developers to know about it).
| Each package is tagged on its own cadence, so the distance from `main` back to | ||
| the relevant tag differs per package and grows as commits land between releases. | ||
| There is no `--depth` value that is safe for all four packages, and any value | ||
| that works today will silently stop working later. | ||
|
|
||
| This makes a partial `--depth` actively dangerous, because it can succeed for one | ||
| package while quietly failing for the others. A `--depth 20` clone taken while | ||
| the nearest `cuda-pathfinder-v*` tag was 10 commits back gives: | ||
|
|
||
| ```text | ||
| cuda_pathfinder -> 1.6.1.dev10+g0d22cb4 # correct | ||
| cuda_core -> 0.1.dev20+g0d22cb444 # wrong, no error | ||
| cuda_bindings -> 0.1.dev20+g0d22cb444 # wrong, no error | ||
| ``` |
There was a problem hiding this comment.
This is way too much detail.
| Each package is tagged on its own cadence, so the distance from `main` back to | |
| the relevant tag differs per package and grows as commits land between releases. | |
| There is no `--depth` value that is safe for all four packages, and any value | |
| that works today will silently stop working later. | |
| This makes a partial `--depth` actively dangerous, because it can succeed for one | |
| package while quietly failing for the others. A `--depth 20` clone taken while | |
| the nearest `cuda-pathfinder-v*` tag was 10 commits back gives: | |
| ```text | |
| cuda_pathfinder -> 1.6.1.dev10+g0d22cb4 # correct | |
| cuda_core -> 0.1.dev20+g0d22cb444 # wrong, no error | |
| cuda_bindings -> 0.1.dev20+g0d22cb444 # wrong, no error | |
| ``` |
| ### Recommended clone | ||
|
|
||
| ```console | ||
| $ git clone --filter=blob:none https://github.com/NVIDIA/cuda-python.git | ||
| ``` | ||
|
|
||
| This is a *treeless* clone: it fetches the complete commit graph and all tags | ||
| (which is what `setuptools-scm` needs) while skipping historical file contents | ||
| (which it does not). It is substantially faster than a plain clone and is | ||
| exactly what CI uses — see the `fetch-depth: 0` plus `filter: blob:none` | ||
| checkout settings in `.github/workflows/build-wheel.yml`. | ||
|
|
||
| Do **not** use `--depth`, `--shallow-since`, or `--no-tags`. |
There was a problem hiding this comment.
I think we just recommend the defaults, tbh.
| ### Recommended clone | |
| ```console | |
| $ git clone --filter=blob:none https://github.com/NVIDIA/cuda-python.git | |
| ``` | |
| This is a *treeless* clone: it fetches the complete commit graph and all tags | |
| (which is what `setuptools-scm` needs) while skipping historical file contents | |
| (which it does not). It is substantially faster than a plain clone and is | |
| exactly what CI uses — see the `fetch-depth: 0` plus `filter: blob:none` | |
| checkout settings in `.github/workflows/build-wheel.yml`. | |
| Do **not** use `--depth`, `--shallow-since`, or `--no-tags`. |
Signed-off-by: Bharat Raghunathan <bharatrgatech@gmail.com>
|
Applied the suggestions. Still leaving in the actual fixes for fetching upstream tags etc. as I believe they will still be useful for contributors |
Description
Closes #2400
Every package in this repo derives its version from git tags via
setuptools-scm,but there's no mention in the docs, and the
git clonecommands in our own install guidesthat are intended to be copied by contributors produce broken builds.
Two of the three bad-clone cases fail silently:
--depth 10.1.dev1+g0d22cb444— no error--no-tags0.1.dev2114+g0d22cb444— no error.git)LookupError— the only case that errorsA partial
--depthis worse than none. With the nearestcuda-pathfinder-v*tag10 commits back, a
--depth 20clone gives:cuda_pathfindercuda_corecuda_bindingsSo "it built and the version looked right" is not evidence the clone is sound,
and no fixed
--depthstays correct as commits land between releases.Changes
CONTRIBUTING.md: new "Cloning the repository" section (plus TOC entries)covering the per-package tag patterns, why
root = ".."means the whole repo isneeded, the recommended treeless clone, recovery for shallow clones and stale
forks, and the symptoms of each failure mode.
git clonecommands in thecuda_coreandcuda_pathfinderguides togit clone --filter=blob:none, and added a pointer tothe new section from all three.
cuda_bindingshas no clone command, so it gets athird requirement bullet alongside the existing CTK header/static-lib ones.
The recommended clone matches what CI already does (
fetch-depth: 0+filter: blob:noneinbuild-wheel.yml): full commit graph and tags, no historicalblobs. It took 6.2s against
github.life-white.uk.Verification
2114-commit graph; all four packages resolve correct versions
(
13.3.2.dev128,1.1.1.dev32,1.6.1.dev10) viapython -m setuptools_scm,so each package's real
pyproject.tomlconfig is exercised.--depth 1,--depth 20,--no-tags, and no-.gitfailure modes all reproducedagainst the real remote.
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_CUDA_COREandgit fetch --unshallow --tagsrecovery paths confirmed working before documenting them.
pre-commithook set passes on all four files with no reformatting; RSTparses clean and lychee reports no broken links.
Checklist