coverage: add git safe.directory for linux builds#1829
coverage: add git safe.directory for linux builds#1829rluo8 wants to merge 1 commit intoNVIDIA:mainfrom
Conversation
|
Hi @mdboom , could you please help review it? |
|
mdboom
left a comment
There was a problem hiding this comment.
IIUC, this happens when a git repository is queried by a different user than the one who owns the files in the git repo. Do we know why this is happening? Presumably the whole GHA workflow is run by the same user. Basically, I want to understand the root cause before approving (and also to understand if we should expect to see this issue with setuptools-scm in other workflows...)
@mdboom This problem was exposed because of the setuptools_scm upgrade. Previously, setuptools_scm 9.2.2 was used. Now it used setuptools_scm 10.0.5 when installing cuda_pathfinder. When running pip install -v . under cuda_pathfinder, it eventually calls _git_toplevel in vcs_versioning/_file_finders/_git.py. In version 9.2.2, the same function simply logged the error and returned None, allowing the build to continue: One of the workaround is to mark the workspace as a safe directory after checkout: git config --global --add safe.directory "$GITHUB_WORKSPACE". |
This is to fix the following error when running coverage for Linux:
fatal: detected dubious ownership in repository at '/__w/cuda-python/cuda-python'
To add an exception for this directory, call:
git introspection failed: fatal: detected dubious ownership in repository at '/__w/cuda-python/cuda-python'
This is caused by the setuptools_scm recent changes. setuptools_scm 10.0+ treats git ownership mismatches as hard errors.
The fix is to add repo as safe.directory.