From 226f8eb1849d5a957ca518cdbd8b450ac4504298 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Wed, 11 Jun 2025 11:45:09 +0100 Subject: [PATCH 1/9] Make it so --- Makefile | 13 +++++++++++++ build/Program.fs | 14 +++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 688c6c81..153dc3fe 100644 --- a/Makefile +++ b/Makefile @@ -34,4 +34,17 @@ lint:: --path-prefix $(pkg)) \ &&) true +# Clean all generated SDK files +clean:: + cd sdk && dotnet clean + rm -rf sdk/*/{bin,obj} + +# Build the SDK +build-sdk:: + @echo "Building Pulumi SDK" + $(MAKE) clean-sdk + cd sdk && dotnet restore --no-cache + $(eval SDK_VERSION := $(shell cd pulumi-language-dotnet && grep -oP 'github.com/pulumi/pulumi/sdk/v3 v\K[0-9.]+' go.mod)) + cd sdk && dotnet build --configuration Release -p:PulumiSdkVersion=$(SDK_VERSION) + .PHONY: install build diff --git a/build/Program.fs b/build/Program.fs index a9f9d426..b4446d0d 100644 --- a/build/Program.fs +++ b/build/Program.fs @@ -92,15 +92,11 @@ let listIntegrationTests() = printfn $"{testName}" let buildSdk() = - cleanSdk() - restoreSdk() - match findGoSDKVersion(pulumiLanguageDotnet) with - | None -> failwith "Could not find the Pulumi SDK version in go.mod" - | Some(version) -> - printfn "Building Pulumi SDK" - if Shell.Exec("dotnet", "build --configuration Release -p:PulumiSdkVersion=" + version, sdk) <> 0 - - then failwith "build failed" + printfn "Deprecated: calling `make build-sdk` instead" + let cmd = Cli.Wrap("make").WithArguments("build-sdk").WithWorkingDirectory(repositoryRoot) + let output = cmd.ExecuteAsync().GetAwaiter().GetResult() + if output.ExitCode <> 0 then + failwith "Build failed" /// Publishes packages for Pulumi, Pulumi.Automation and Pulumi.FSharp to nuget. /// Requires NUGET_PUBLISH_KEY and PULUMI_VERSION environment variables. From 63e89c9caacc7c407bca28b3bfc9e65d29fd5582 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Wed, 11 Jun 2025 12:17:06 +0100 Subject: [PATCH 2/9] Well done --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 153dc3fe..34c3c2cb 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ clean:: # Build the SDK build-sdk:: @echo "Building Pulumi SDK" - $(MAKE) clean-sdk + $(MAKE) clean cd sdk && dotnet restore --no-cache $(eval SDK_VERSION := $(shell cd pulumi-language-dotnet && grep -oP 'github.com/pulumi/pulumi/sdk/v3 v\K[0-9.]+' go.mod)) cd sdk && dotnet build --configuration Release -p:PulumiSdkVersion=$(SDK_VERSION) From 747179535ac4840d7595961d9cd259ba4abf5141 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Sat, 14 Jun 2025 08:21:13 +0100 Subject: [PATCH 3/9] Tidying --- Makefile | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index ed010b1e..f1f89cd4 100644 --- a/Makefile +++ b/Makefile @@ -3,12 +3,19 @@ GO := go # Try to get the dev version using changie, otherwise fall back FALLBACK_DEV_VERSION := 3.0.0-dev.0 DEV_VERSION := $(shell if command -v changie > /dev/null; then changie next patch -p dev.0; else echo "$(FALLBACK_DEV_VERSION)"; fi) +SDK_VERSION := $(shell cd pulumi-language-dotnet && sed -n 's/^.*github\.com\/pulumi\/pulumi\/sdk\/v3 v//p' go.mod) install:: cd pulumi-language-dotnet && ${GO} install \ -ldflags "-X github.com/pulumi/pulumi-dotnet/pulumi-language-dotnet/v3/version.Version=$(DEV_VERSION)" ./... -build:: +build: clean build_sdk build_language_host + +build_sdk: + cd sdk && dotnet restore --no-cache + cd sdk && dotnet build --configuration Release -p:PulumiSdkVersion=$(SDK_VERSION) + +build_language_host: cd pulumi-language-dotnet && ${GO} build \ -ldflags "-X github.com/pulumi/pulumi-dotnet/pulumi-language-dotnet/v3/version.Version=$(DEV_VERSION)" . @@ -38,12 +45,4 @@ lint:: --path-prefix $(pkg)) \ &&) true -# Build the SDK -build_sdk:: - @echo "Building Pulumi SDK" - $(MAKE) clean - cd sdk && dotnet restore --no-cache - $(eval SDK_VERSION := $(shell cd pulumi-language-dotnet && grep -oP 'github.com/pulumi/pulumi/sdk/v3 v\K[0-9.]+' go.mod)) - cd sdk && dotnet build --configuration Release -p:PulumiSdkVersion=$(SDK_VERSION) - -.PHONY: install build build_sdk clean +.PHONY: install build build_language_host build_sdk clean From a754633a5b03ca00cbcb1e979d64bbb362a08ef9 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Sat, 14 Jun 2025 08:22:25 +0100 Subject: [PATCH 4/9] No hyphens --- build/Program.fs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/Program.fs b/build/Program.fs index a72525db..4e632ba3 100644 --- a/build/Program.fs +++ b/build/Program.fs @@ -81,8 +81,8 @@ let listIntegrationTests() = printfn $"{testName}" let buildSdk() = - printfn "Deprecated: calling `make build-sdk` instead" - let cmd = Cli.Wrap("make").WithArguments("build-sdk").WithWorkingDirectory(repositoryRoot) + printfn "Deprecated: calling `make build_sdk` instead" + let cmd = Cli.Wrap("make").WithArguments("build_sdk").WithWorkingDirectory(repositoryRoot) let output = cmd.ExecuteAsync().GetAwaiter().GetResult() if output.ExitCode <> 0 then failwith "Build failed" From 54fa511cf5554175e6171da46f80160e7907679c Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Sat, 14 Jun 2025 08:25:57 +0100 Subject: [PATCH 5/9] Same fix --- build/Program.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Program.fs b/build/Program.fs index 4e632ba3..751299e2 100644 --- a/build/Program.fs +++ b/build/Program.fs @@ -83,7 +83,7 @@ let listIntegrationTests() = let buildSdk() = printfn "Deprecated: calling `make build_sdk` instead" let cmd = Cli.Wrap("make").WithArguments("build_sdk").WithWorkingDirectory(repositoryRoot) - let output = cmd.ExecuteAsync().GetAwaiter().GetResult() + let output = cmd.ExecuteBufferedAsync().GetAwaiter().GetResult() if output.ExitCode <> 0 then failwith "Build failed" From 1863a2294c328fb3598df0c3e7ebdd03132e266e Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Sat, 14 Jun 2025 08:26:53 +0100 Subject: [PATCH 6/9] GHA --- .github/workflows/pr.yml | 2 +- .github/workflows/release-sdk.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index a8847a64..5aaa3a6f 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -138,7 +138,7 @@ jobs: with: pulumi-version: dev - name: Build Pulumi SDK - run: dotnet run build-sdk + run: make build_sdk - name: Workspace clean (are xml doc file updates committed?) uses: pulumi/git-status-check-action@v1 with: diff --git a/.github/workflows/release-sdk.yml b/.github/workflows/release-sdk.yml index 2d514878..ff461e06 100644 --- a/.github/workflows/release-sdk.yml +++ b/.github/workflows/release-sdk.yml @@ -68,7 +68,7 @@ jobs: with: pulumi-version: dev - name: Build Pulumi SDK - run: dotnet run build-sdk + run: make build_sdk - name: Test Pulumi SDK run: dotnet run test-sdk - name: Test Pulumi Automation SDK From 9a56ecd8e4d9141110dcecdb538290cbc02d216b Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Mon, 16 Jun 2025 11:01:00 +0200 Subject: [PATCH 7/9] Update Makefile Co-authored-by: Thomas Gummerer --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f1f89cd4..aebbd4d2 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ install:: cd pulumi-language-dotnet && ${GO} install \ -ldflags "-X github.com/pulumi/pulumi-dotnet/pulumi-language-dotnet/v3/version.Version=$(DEV_VERSION)" ./... -build: clean build_sdk build_language_host +build: build_sdk build_language_host build_sdk: cd sdk && dotnet restore --no-cache From 79ed0af570e79f6746d7035dc5a74479e77609c3 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Mon, 16 Jun 2025 11:03:22 +0200 Subject: [PATCH 8/9] Restore is already implicit --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index aebbd4d2..ce6dc730 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,6 @@ install:: build: build_sdk build_language_host build_sdk: - cd sdk && dotnet restore --no-cache cd sdk && dotnet build --configuration Release -p:PulumiSdkVersion=$(SDK_VERSION) build_language_host: From daa1238edec49c58eab997281f76491eb3d6e465 Mon Sep 17 00:00:00 2001 From: Tom Harding Date: Mon, 16 Jun 2025 12:08:30 +0200 Subject: [PATCH 9/9] README --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6b7b2f0e..63174c53 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ Then you can run one of the following commands: ```bash # Build the Pulumi SDK -dotnet run build-sdk +make build_sdk # Running tests for the Pulumi SDK dotnet run test-sdk @@ -89,7 +89,7 @@ make install # Building the language plugin. A binary will be built into the pulumi-language-dotnet folder. # this is the binary that will be used by the integration tests. -make build +make build_language_host # Testing the language plugin dotnet run test-language-plugin