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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions integrations/terraform/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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.


build-darwin-universal: $(addprefix $(BUILDDIR)/terraform-provider-teleport_,arm64 amd64)
lipo -create -output $(BUILDDIR)/terraform-provider-teleport $^
Expand Down Expand Up @@ -195,4 +196,5 @@ $(LOCALBIN):

bin/tfplugindocs: go.mod $(LOCALBIN)
mkdir -p bin
GOBIN=$(LOCALBIN) go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
# Turning off GOWORK to prevent missing package errors.
GOWORK=off GOBIN=$(LOCALBIN) go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
3 changes: 2 additions & 1 deletion version.mk
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ tsh-version:

.PHONY:validate-semver
validate-semver:
cd build.assets/tooling && CGO_ENABLED=0 go run ./cmd/check -check valid -tag v$(VERSION)
# Turning off GOWORK to prevent missing package errors.
GOWORK=off CGO_ENABLED=0 go -C build.assets/tooling run ./cmd/check -check valid -tag v$(VERSION)
Loading