-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Use GOWORK=off in certain targets to prevent missing package errors #47903
Conversation
This pull request is automatically being deployed by Amplify Hosting (learn more). |
This pull request is automatically being deployed by Amplify Hosting (learn more). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to make terraform-resources-up-to-date
once without workspaces for it to install some dependencies, but after that it works.
@@ -29,7 +29,8 @@ clean: tfclean | |||
|
|||
.PHONY: build | |||
build: clean | |||
GOOS=$(OS) GOARCH=$(ARCH) $(CGOFLAG) go build -o $(BUILDDIR)/terraform-provider-teleport $(BUILDFLAGS) | |||
# Turning off GOWORK to prevent missing package errors. | |||
GOWORK=off GOOS=$(OS) GOARCH=$(ARCH) $(CGOFLAG) go build -o $(BUILDDIR)/terraform-provider-teleport $(BUILDFLAGS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably GOWORK=off in the bin/tfplugindocs target below.
Other targets like test
and gen-tfschema
also have potentially problematic Go invocations, but we can wait for them to break.
Another alternative is to pass GOWORK=off straight from the terraform-resources-up-to-date
. Or, do nothing of this and set it straight in the make invocation in the shell (so no code changes).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added to the bin/tfplugindocs
target.
This should prevent errors like this one:
main module (github.com/gravitational/teleport) does not contain package github.com/gravitational/teleport/integrations/terraform
.