spack icon indicating copy to clipboard operation
spack copied to clipboard

require_url_format() fails to take into account valid SSH paths

Open benpm opened this issue 4 years ago • 5 comments

require_url_format() in lib/spack/util/url.py fails to take into account valid SSH path values such as "[email protected]:spack/spack.git". Up until this function was added, I've been successfully using values like this in the git= property of my packages.

Commit that added this function: 4aee27816e7101753aeb392e868096236a26d84d. I've confirmed my package does indeed build and install correctly before this commit.

Error I get when trying to install my package: ==> Error: Invalid url format from url: (tested on a4f32dbf8d3ed3a28692caa09a00560096452168)

I'd like to propose that since the git= property is not actually always a URL, that URL validation should not be run for it.

benpm avatar Apr 18 '22 15:04 benpm

Pinging @scheibelp and @johnwparent since, if I recall correctly, this was added as part of the Windows support.

alalazo avatar Apr 19 '22 08:04 alalazo

I'm running into this too and am not sure of a workaround. git clone [email protected]:HPC/mini-HACC.git works,

SPACK returns ==> Error: Invalid url format from URL

I haven't been able pull the bits out of github with any other syntax.

robers97 avatar Jul 30 '22 23:07 robers97

I am able to reproduce the problem in an existing package that I tweaked (i.e., changed the url property to use that form).

A quick fix allows me to get past the error; however, I am prompted for my SSH passphrase, which could be problematic for packages contributed back to Spack.

@scheibelp What do you think?

tldahlgren avatar Aug 10 '22 23:08 tldahlgren

Using git = "ssh://[email protected]:spack/spack.git" should work (i.e. prepending ssh://). I assume @tldahlgren that's what you mean by a quick fix; the password prompt AFAIK is expected - @benpm I assume you have ssh keys configured for git interaction, but let me know if prepending ssh:// does not produce a satisfactory result.

scheibelp avatar Aug 11 '22 01:08 scheibelp

Using git = "ssh://[email protected]:spack/spack.git" should work (i.e. prepending ssh://). I assume @tldahlgren that's what you mean by a quick fix; the password prompt AFAIK is expected - @benpm I assume you have ssh keys configured for git interaction, but let me know if prepending ssh:// does not produce a satisfactory result.

using ssh:// does indeed work

benpm avatar Aug 11 '22 17:08 benpm

I have the same problem, namely Error: Invalid url format from url: [email protected]:C2SM/icon-exclaim.git. It can be cloned by hand fine. But the prefix "ssh://" does not work for me: git = "ssh://[email protected]:C2SM/icon-exclaim.git" give the error: "ssh: Could not resolve hostname github.com:C2SM" (and it cannot be cloned by hand with the prefix). Am I missing something obvious?

vectorflux avatar Nov 10 '22 18:11 vectorflux

Closing this as require_url_format is no longer in the codebase as of #34452

johnwparent avatar Jan 06 '23 17:01 johnwparent