@@ -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
3954development : build
4055only_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
4763help :
4864 @echo " Usage: make [target]"
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
114129include scripts/crossbuild.mk
115130
116131# Permit providers to extend the Makefile with provider-specific Make includes.
0 commit comments