Skip to content

Commit 7a0338c

Browse files
authored
Fix parameterized-go makefile (#1800)
Didn't realize that parameterized-go has a different Makefile than `base`. Need to do the same migration here.
1 parent e00050f commit 7a0338c

File tree

2 files changed

+40
-10
lines changed
  • provider-ci
    • internal/pkg/templates/parameterized-go
    • test-providers/terraform-module

2 files changed

+40
-10
lines changed

provider-ci/internal/pkg/templates/parameterized-go/Makefile

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,32 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_STRIP_SYMBOLS)
4141
# Ensure all directories exist before evaluating targets to avoid issues with `touch` creating directories.
4242
_ := $(shell mkdir -p .make bin .pulumi/bin)
4343

44+
# Installs all necessary tools with mise and records completion in a sentinel
45+
# file so dependent targets can participate in make's caching behaviour. The
46+
# environment is refreshed via an order-only prerequisite so it still runs on
47+
# every invocation without invalidating the sentinel.
48+
mise_install: .make/mise_install | mise_env
49+
50+
.PHONY: mise_env
51+
mise_env:
52+
@mise env -q > /dev/null
53+
54+
.make/mise_install:
55+
@mise install -q
56+
@touch $@
57+
4458
# Build the provider
45-
build: install_plugins provider
59+
build: .make/mise_install provider
60+
build: | mise_env
4661
# Keep aliases for old targets to ensure backwards compatibility
4762
development: build
4863
only_build: build
4964
# Prepare the workspace for building the provider
5065
# Importantly this is run by CI ahead of restoring the bin directory
51-
prepare_local_workspace: install_plugins
66+
prepare_local_workspace: .make/mise_install
67+
prepare_local_workspace: | mise_env
5268
# Creates all generated files which need to be committed
53-
.PHONY: development only_build build
69+
.PHONY: development only_build build mise_install mise_env
5470

5571
help:
5672
@echo "Usage: make [target]"
@@ -71,7 +87,7 @@ help:
7187
@echo ""
7288
@echo "Internal Targets (automatically run as dependencies of other targets)"
7389
@echo " prepare_local_workspace Prepare for building"
74-
@echo " install_plugins Install plugin dependencies"
90+
@echo " mise_install Install tools with mise"
7591
@echo ""
7692
.PHONY: help
7793

@@ -141,7 +157,6 @@ renovate:
141157
.PHONY: renovate
142158
#{{- end }}#
143159

144-
include scripts/plugins.mk
145160
include scripts/crossbuild.mk
146161

147162
# Permit providers to extend the Makefile with provider-specific Make includes.

provider-ci/test-providers/terraform-module/Makefile

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,32 @@ LDFLAGS=$(LDFLAGS_PROJ_VERSION) $(LDFLAGS_STRIP_SYMBOLS)
3333
# Ensure all directories exist before evaluating targets to avoid issues with `touch` creating directories.
3434
_ := $(shell mkdir -p .make bin .pulumi/bin)
3535

36+
# Installs all necessary tools with mise and records completion in a sentinel
37+
# file so dependent targets can participate in make's caching behaviour. The
38+
# environment is refreshed via an order-only prerequisite so it still runs on
39+
# every invocation without invalidating the sentinel.
40+
mise_install: .make/mise_install | mise_env
41+
42+
.PHONY: mise_env
43+
mise_env:
44+
@mise env -q > /dev/null
45+
46+
.make/mise_install:
47+
@mise install -q
48+
@touch $@
49+
3650
# Build the provider
37-
build: install_plugins provider
51+
build: .make/mise_install provider
52+
build: | mise_env
3853
# Keep aliases for old targets to ensure backwards compatibility
3954
development: build
4055
only_build: build
4156
# Prepare the workspace for building the provider
4257
# Importantly this is run by CI ahead of restoring the bin directory
43-
prepare_local_workspace: install_plugins
58+
prepare_local_workspace: .make/mise_install
59+
prepare_local_workspace: | mise_env
4460
# Creates all generated files which need to be committed
45-
.PHONY: development only_build build
61+
.PHONY: development only_build build mise_install mise_env
4662

4763
help:
4864
@echo "Usage: make [target]"
@@ -63,7 +79,7 @@ help:
6379
@echo ""
6480
@echo "Internal Targets (automatically run as dependencies of other targets)"
6581
@echo " prepare_local_workspace Prepare for building"
66-
@echo " install_plugins Install plugin dependencies"
82+
@echo " mise_install Install tools with mise"
6783
@echo ""
6884
.PHONY: help
6985

@@ -110,7 +126,6 @@ ci-mgmt: .ci-mgmt.yaml
110126
go run github.com/pulumi/ci-mgmt/provider-ci@master generate
111127
.PHONY: ci-mgmt
112128

113-
include scripts/plugins.mk
114129
include scripts/crossbuild.mk
115130

116131
# Permit providers to extend the Makefile with provider-specific Make includes.

0 commit comments

Comments
 (0)