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

Use GOWORK=off in certain targets to prevent missing package errors #47903

Merged
merged 2 commits into from
Oct 25, 2024

Conversation

bl-nero
Copy link
Contributor

@bl-nero bl-nero commented Oct 24, 2024

This should prevent errors like this one: main module (github.com/gravitational/teleport) does not contain package github.com/gravitational/teleport/integrations/terraform.

@bl-nero bl-nero added the no-changelog Indicates that a PR does not require a changelog entry label Oct 24, 2024
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-47903.d212ksyjt6y4yg.amplifyapp.com

Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-47903.d3pp5qlev8mo18.amplifyapp.com

Copy link
Contributor

@codingllama codingllama left a 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)
Copy link
Contributor

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).

Copy link
Contributor Author

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.

@espadolini

This comment was marked as resolved.

@bl-nero bl-nero requested a review from codingllama October 25, 2024 05:45
@bl-nero bl-nero added this pull request to the merge queue Oct 25, 2024
Merged via the queue into master with commit 02bb832 Oct 25, 2024
40 checks passed
@bl-nero bl-nero deleted the bl-nero/gowork branch October 25, 2024 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no-changelog Indicates that a PR does not require a changelog entry size/sm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants