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

When compiling local module based package i get "unknown import path" error #16

Closed
jvsteiner opened this issue May 15, 2019 · 9 comments
Labels
bug Something isn't working

Comments

@jvsteiner
Copy link

I have a local module based code base with CGO dependancies, which builds on my host OS (OSX). I am working with it outside the GOPATH which is why I am using this fork. My packages import path is, let's say, "github.com/foo/bar". I have a cmd directory, with a "server" command, which would then be at "github.com/foo/bar/cmd/server". My xgo command is something like:

xgo -targets=linux/amd64 -out dist/linux/hsmserver ./cmd/server

but it fails with:

can't load package: package github.com/foo/bar: unknown import path "github.com/foo/bar": cannot find module providing package github.com/foo/bar
@anjmao
Copy link

anjmao commented Sep 18, 2019

I have the same issue. It doesn't work because of this code https://github.com/techknowlogick/xgo/blob/master/docker/base/build.sh#L153

@techknowlogick I can fix it, could you let me know if you accept pull requests.

@kolaente
Copy link
Collaborator

@anjmao Sure, either @techknowlogick or I will review.

@kolaente
Copy link
Collaborator

@anjmao any updates?

@kolaente kolaente added the bug Something isn't working label Sep 24, 2019
@anjmao
Copy link

anjmao commented Sep 26, 2019

Hi @kolaente Sorry, for late response. I end up using my own fork since your fork doesn't support gomobile.

@anjmao
Copy link

anjmao commented Oct 16, 2019

In my fork I dropped support for old GOPATH based builds https://github.com/anjmao/xgo and fixed this issue too.
There is docker image anjmao/xgo:go-1.13.1 on docker hub. Once I finish testing we could probably merge changes back to this repo.

@kolaente
Copy link
Collaborator

@anjmao That sounds awesome! We've been wanting to do this since Go 1.10 is eol.

@techknowlogick
Copy link
Owner

Yeah, we could probably drop gopath support now that we support a minimum of golang 1.13

@zeripath
Copy link
Collaborator

This may have been solved recently - please try again

@techknowlogick
Copy link
Owner

Closing, but please re open if issue remains

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants