When using the Automation API to install a version of Pulumi, we're currently seeing an error occuring when running the install command to install the Pulumi cli.
Unhandled exception. System.FormatException: Empty string is not a valid version.
at Semver.SemVersion.Parse(String version, SemVersionStyles style, Int32 maxLength)
at Pulumi.Automation.PulumiSdkVersionAttribute..ctor(String value)
at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, RuntimeType type, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
at System.Reflection.CustomAttribute.AddCustomAttributes(ListBuilder`1& attributes, RuntimeModule decoratedModule, Int32 decoratedMetadataToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, ListBuilder`1 derivedAttributes)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType)
at Pulumi.Automation.Commands.LocalPulumiCommand.Install(LocalPulumiCommandOptions options, CancellationToken cancellationToken)
Example
Given the following Pulumi program
using Pulumi.Automation.Commands;
await LocalPulumiCommand.Install(new LocalPulumiCommandOptions
{
Version = new Semver.SemVersion(3, 129, 0),
Root = "./"
});
Running dotnet run returns the above exception. I would expect this to install version 3.129.0 of the Pulumi cli.
Output of pulumi about
N/A
Additional context
I believe this is because the published binaries do not include an expected Assembly Attribute.
Vote on this issue by adding a š reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
What happened?
When using the Automation API to install a version of Pulumi, we're currently seeing an error occuring when running the install command to install the Pulumi cli.
Example
Given the following Pulumi program
Running
dotnet run
returns the above exception. I would expect this to install version 3.129.0 of the Pulumi cli.Output of
pulumi about
N/A
Additional context
I believe this is because the published binaries do not include an expected Assembly Attribute.
https://github.com/pulumi/pulumi-dotnet/pull/226 introduced a required Assembly Attributed called
PulumiSdkVersion
which is obtained during build from thego.mod
in the project. However this was only added to the build target and not the publish. Publish runs it's own build step but excludes the required property to set the attribute value - https://github.com/pulumi/pulumi-dotnet/blob/e105d3278fea40be1f3008e36642756b0085e981/build/Publish.fs#L38Contributing
Vote on this issue by adding a š reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).