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

if all files has build constraints will cause "Error determining list of magefiles" #262

Closed
yinheli opened this issue Sep 4, 2019 · 4 comments · Fixed by #265
Closed
Labels

Comments

@yinheli
Copy link

yinheli commented Sep 4, 2019

After upgrade to go1.13, some of my projects build failed, with message

Error determining list of magefiles: failed to list non-mage gofiles: exit status 1
exit status 1

And clone mage repository, check out master branch, run go test -race ./... failed too.

go list files cause error if all files has build constraints. For example, cd mage/testdata/no_default, then run go list -f '{{join .GoFiles "||"}}', error occurs with message

build .: cannot find module for path .
@robinkb
Copy link

robinkb commented Sep 4, 2019

I'm facing the same issue. To work around this bug until a patch is a released, create an empty Go file in the working directory:

$ touch dummy.go

Mage will compile just fine.

@gbrlsnchs
Copy link

@yinheli Does this fail if magefile.go is in the root alongside other Go files?

@zeevallin
Copy link

I've got the same issue as you.

@natefinch
Copy link
Member

Ahh, yeah, I think they maybe changed go list so that it returns an error now if there are no files..... which is super annoying.

natefinch added a commit that referenced this issue Sep 12, 2019
This fixes #262. go list will error out if there are no go files. So we ignore that specific error.
natefinch added a commit that referenced this issue Sep 12, 2019
* swallow error on no non-magefiles

This fixes #262. go list will error out if there are no go files. So we ignore that specific error.
mojzesh pushed a commit to mojzesh/mage that referenced this issue Oct 12, 2019
* swallow error on no non-magefiles

This fixes magefile#262. go list will error out if there are no go files. So we ignore that specific error.
mojzesh pushed a commit to mojzesh/mage that referenced this issue Oct 12, 2019
* swallow error on no non-magefiles

This fixes magefile#262. go list will error out if there are no go files. So we ignore that specific error.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants