Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix package paths on windows #87

Merged
merged 1 commit into from
Apr 18, 2018
Merged

Conversation

jon-walton
Copy link
Contributor

Hello,

I wasn't able to run gqlgen on windows due to a rather cryptic error:

cannot find package "C:\\Users\\jonwa\\go\\src\\gitlab.com\\***\\backend\\dashboard\\internal\\graph" in any of:
	C:\Users\jonwa\go\src\gitlab.com\***\vendor\C:\Users\jonwa\go\src\gitlab.com\***\backend\dashboard\internal\graph (vendor tree)
	C:\Go\src\C:\Users\jonwa\go\src\gitlab.com\***\backend\dashboard\internal\graph (from $GOROOT)
	C:\Users\jonwa\go\src\C:\Users\jonwa\go\src\gitlab.com\***\backend\dashboard\internal\graph (from $GOPATH)
failed to generate code: couldn't load packages due to errors: C:\Users\jonwa\go\src\gitlab.com\***\backend\dashboard\internal\graph
rootResolver.go:1: running "gorunpkg": exit status 1

Process finished with exit code 1

this was due to the gopath splitting using unix separators and gopath += "/src/" resulted in gopath being set to c:\Users\jonwa\go/src/ so the package name didn't get set correctly.

not sure what you want to do with the error. it's rather cryptic (passed straight from go's loader) but once you remember the package is gitlab.com\\***\\backend\\dashboard\\internal\\graph and not C:\\Users\\jonwa\\go\\src\\gitlab.com\\***\\backend\\dashboard\\internal\\graph it makes sense

@vektah vektah merged commit 091d25a into 99designs:master Apr 18, 2018
@vektah
Copy link
Collaborator

vektah commented Apr 18, 2018

Thanks for the pr, I've tried to stick to windows compatible methods, but really should find a windows ci host to make sure these kind of breaks don't happen.

I think in this case the error message is fine, if gqlgen was generating paths correctly it would be what the user did wrong

cgxxv pushed a commit to cgxxv/gqlgen that referenced this pull request Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants