Remove the GO111MODULE=off
env var from go list
#415
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Before this PR
When running
./godelw artifacts build
or./godelw products
in golang 1.21 there is an edge case that causes the underlyinggo list
command to fail.If you have a repo that has a
main.go
file in the root of the repo and then subsequent sub packages with a main.go the afore mentioned commands fail to run. Or more specifically,go list
fails to run. I've tracked it down toGO111MODULE=off
being hardcoded as an environment variable in therunGoList
function.I've validated this by running
go list -f "{{.Name}} {{.ImportPath}}" "./..."
from the root of the affected repo and thenGO111MODULE=off go list -f "{{.Name}} {{.ImportPath}}" "./..."
. The former works and the latter fails with the same error as distgo.The error, heavily truncated, is as follows
It appears for whatever reason that in Go 1.21 the behaviour has changed.
After this PR
This PR removes
GO111MODULE=off
so that distgo can work once again with the style of repos mentioned earlier.==COMMIT_MSG==
Remove the
GO111MODULE=off
env var from go list==COMMIT_MSG==
Possible downsides?
It is possible go list will now not find all the modules in a repo and thus cause inconsistencies with the current behaviour.
This change is