Open dsjense opened 2 years ago
This appears to be a duplicate of https://github.com/spack/spack/pull/29674. I think the documentation should probably be updated to indicate that we have to use the ssh://git@bitbucket.org/name/repo.git
syntax or else merge @certik's fix.
I think my fix should still be merged, so many people keep hitting this issue. But I don't know how to run tests locally (see #29674), so I don't know how to bring it over the finish line.
@certik I ran the test locally and it failed for me. Some debugging shows that the url_util.parse
function thinks git@...
URL syntax uses the file
scheme:
parsed=ParseResult(scheme='file', netloc='', path='/mnt/development/spack_contrib/certik/spack/git@bitbucket.org:name/repo.git', params='', query='', fragment=None)
Changing the test to the following lets it pass but still doesn't look right.
parsed = url_util.parse('git@github.com:spack/spack.git', scheme='git')
assert(parsed.scheme == 'git')
assert(parsed.netloc == '')
assert(parsed.path == 'git@github.com:spack/spack.git')
I was expecting the code to somehow access the parse_git_url
function but it never does. It looks like it tries URLFetchStrategy
in fetch_strategy.py
and then switches to GitFetchStrategy
. The URLFetchStrategy
methods call url_util.parse
(leading to the failure in require_url_format
that needs fixing) before trying to clone the repo with GitFetchStrategy
methods. It makes me wonder what parse_git_url
is even used for.
@dsjense thanks! The actual fix is trivial, so it might be worth just merging without testing, if it is hard to test for.
Steps to reproduce
Git URLs such as
git@host.com:path/to/repo.git
are currently broken thanks to the filter in the functionrequire_url_format
inlib/spack/spack/util/url.py
. The fix is pretty simple and amounts to replacinggit://
withgit|
in that function. This is related to Issue https://github.com/spack/spack/pull/29765. I have a branch with the change at https://github.com/dsjense/spack/tree/bugfix/allow_git_urls. We probably should add a unit test though so that this bug doesn't sneak in again.I'm mainly interested in using URLs of the form
git@host.com:path/to/repo.git
for my private repositories but this bug is easy to reproduce by taking any code with github URLs and switching them to use thegit@github.com
syntax. For example, I put the following in the faust package to trigger the bug:Just to emphasize, there is nothing wrong with the faust package. I was just looking for a package with few dependencies that I could modify to trigger this bug.
Error message
Information on your system
General information
spack debug report
and reported the version of Spack/Python/Platform