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

Modules issue building locally vs from reference #84

Open
mcdee opened this issue Aug 19, 2022 · 1 comment
Open

Modules issue building locally vs from reference #84

mcdee opened this issue Aug 19, 2022 · 1 comment

Comments

@mcdee
Copy link

mcdee commented Aug 19, 2022

If I clone a repository locally and run xgo on it, it generates a binary as expected:

git clone [email protected]:wealdtech/ethdo
cd ethdo
xgo --targets="windows/amd64" .

However if I try to do the same thing with a referenced repository it fails:

xgo --targets="windows/amd64" github.com/wealdtech/ethdo

The main difference appears to be that the former sets GO111MODULE to on and the latter sets GO111MODULE to off. The repository uses the go module system, so unsure why this is happening. If you could shed any light on this issue it would be much appreciated.

@danhunsaker
Copy link

At the moment, the code doesn't check for module support unless you're building a local path - it assumes no module support is needed. This causes problems when modules are used in the target repo, or any of its dependencies. It also causes problems if dependencies use the /v2 suffix mechanism to differentiate between versions (usually in addition to SemVer, which Go didn't properly support until 1.11 modules were introduced). The workaround is to work on a local path, as you've discovered, until the code for xgo is updated to check for module support in remote paths as well.

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

No branches or pull requests

2 participants