-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In ea37dae an error was introduced invalidating the production provider build - a subtle error by moving a `go:embed` directory to wildcards and FS type. Per https://pkg.go.dev/embed#hdr-Strings_and_Bytes the path to a go:embed directory is a pattern. Apparently in the case of pulumi-aws CI the binary is built twice, once for testing and once for production release. In the for-testing build environment, schema-embed.json is a file which works as expected. In the for-production build environment, schema-embed.json is a folder created by the download-artifacts action that contains a single file. Before the change, this code worked correctly in both cases: ``` //go:embed schema-embed.json var pulumiSchema []byte ``` After the change, unfortunately the replacement code worked only for the for-test build scenario where schema-embed.json is a straight file, while failing in production. This change goes back to using the `[]byte` version of go:embed and makes sure the builds recompute the minimal schema as necessary for both builds to succeed. This fixes #4863 We still should address the root cause and refactor the builds to reduce double-building the provider, so that the exact release build is qualified by integration tests; which is tracked in pulumi/ci-mgmt#967
- Loading branch information
Showing
3 changed files
with
23 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
minimal_schema: tfgen minimal_schema_no_deps | ||
minimal_schema: provider/cmd/pulumi-resource-aws/schema-minimal-embed.json | ||
|
||
minimal_schema_no_deps: | ||
.PHONY: minimal_schema | ||
|
||
provider/cmd/pulumi-resource-aws/schema-minimal-embed.json: provider/cmd/pulumi-resource-aws/schema.json | ||
echo "Computing minimal schema" | ||
cd provider/cmd/pulumi-resource-aws && PULUMI_AWS_MINIMAL_SCHEMA=true VERSION=$(VERSION_GENERIC) go generate | ||
.PHONY: minimal_schema minimal_schema_no_deps | ||
|
||
# To work around CI limitations, ensure that minimal schema is rebuilt for embedding right before the provider binary is | ||
# built for a given platform. | ||
bin/linux-amd64/$(PROVIDER): minimal_schema_no_deps | ||
bin/linux-arm64/$(PROVIDER): minimal_schema_no_deps | ||
bin/darwin-amd64/$(PROVIDER): minimal_schema_no_deps | ||
bin/darwin-arm64/$(PROVIDER): minimal_schema_no_deps | ||
bin/windows-amd64/$(PROVIDER).exe: minimal_schema_no_deps | ||
provider_no_deps: minimal_schema_no_deps | ||
provider: minimal_schema_no_deps | ||
# In build_provider.yml workflow, minimal schema needs to be rebuilt right before the provider binary. | ||
bin/linux-amd64/$(PROVIDER): minimal_schema | ||
bin/linux-arm64/$(PROVIDER): minimal_schema | ||
bin/darwin-amd64/$(PROVIDER): minimal_schema | ||
bin/darwin-arm64/$(PROVIDER): minimal_schema | ||
bin/windows-amd64/$(PROVIDER).exe: minimal_schema | ||
|
||
# In prerequisites.yml workflow, minimal schema needs to be rebuilt right before the provider binary. | ||
bin/pulumi-resource-aws: minimal_schema |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters