Skip to content
This repository was archived by the owner on Sep 9, 2020. It is now read-only.

Path sanity check fails when $GOPATH contains double slashes. #1946

Closed
jpentland opened this issue Jul 17, 2018 · 2 comments
Closed

Path sanity check fails when $GOPATH contains double slashes. #1946

jpentland opened this issue Jul 17, 2018 · 2 comments

Comments

@jpentland
Copy link
Contributor

jpentland commented Jul 17, 2018

My $GOPATH was set to /home/user//.gopath. In the beginning dep checks to make sure it is being run in gopath. This check fails in this case because the PWD will be /home/user/.gopath/src, without the two slashes.

The reason for the double slash was a system misconfig where /etc/passwd contained a trailing slash for the user home directory, so ~/.gopath results in two slashes.

It should be possible to sanitise the GOPATH and the PWD first before comparing that they match.

What version of dep are you using (dep version)?

v0.4.1-264-g45be32ba

What dep command did you run?

dep ensure -v
/home/user/.gopath/src/github.com/lightningnetwork/lnd is not within a known GOPATH/src
@sdboyer
Copy link
Member

sdboyer commented Jul 18, 2018

Yeah, seems like this should be pretty easy. PR welcome 😄

jpentland added a commit to jpentland/dep that referenced this issue Jul 18, 2018
Removes artefacts such as trailing and repeated separators, directory
navigation symbols ('./' '../').

Also add a test case to ensure that repeated separators are handled
correctly (relevant for golang#1946).
jpentland added a commit to jpentland/dep that referenced this issue Jul 18, 2018
Removes artefacts such as trailing and repeated separators, directory
navigation symbols ('./' '../').

Also add a test case to ensure that repeated separators are handled
correctly (relevant for golang#1946).
jpentland added a commit to jpentland/dep that referenced this issue Jul 18, 2018
Removes artifacts such as trailing and repeated separators, directory
navigation symbols ('./' '../').

Also add a test case to ensure that repeated separators are handled
correctly (relevant for golang#1946).
@jpentland
Copy link
Contributor Author

PR here #1948

sdboyer added a commit that referenced this issue Jul 23, 2018
Improve handling of paths containing repeated separators (fix #1946).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants