pulumi / pulumi-dotnet

.NET support for Pulumi
Apache License 2.0
28 stars 25 forks source link

Panic generating SDK with `respectSchemaVersion` #320

Closed danielrbradley closed 3 months ago

danielrbradley commented 3 months ago

Running pulumi package gen-sdk schema.json --language dotnet --out . with respectSchemaVersion set to true results in the following panic:

================================================================================
The Pulumi CLI encountered a fatal error. This is a bug!
We would appreciate a report: https://github.com/pulumi/pulumi/issues/
Please provide all of the below text in your report.
================================================================================
Pulumi Version:   v3.129.0
Go Version:       go1.22.6
Go Compiler:      gc
Architecture:     arm64
Operating System: darwin
Panic:            fatal: An assertion has failed: duplicate file: version.txt

goroutine 1 [running]:
runtime/debug.Stack()
        /opt/homebrew/Cellar/go/1.22.6/libexec/src/runtime/debug/stack.go:24 +0x64
main.panicHandler(0x140021bff1f)
        /private/tmp/pulumi-20240812-4892-rtkrd8/pkg/cmd/pulumi/main.go:34 +0x44
panic({0x1035b1d80?, 0x14001d700f0?})
        /opt/homebrew/Cellar/go/1.22.6/libexec/src/runtime/panic.go:770 +0x124
github.com/pulumi/pulumi/sdk/v3/go/common/util/contract.failfast(...)
        /private/tmp/pulumi-20240812-4892-rtkrd8/sdk/go/common/util/contract/failfast.go:23
github.com/pulumi/pulumi/sdk/v3/go/common/util/contract.Assertf(0x8d?, {0x1028eb5a2?, 0x1028b768d?}, {0x140021bf5e8?, 0x0?, 0x0?})
        /private/tmp/pulumi-20240812-4892-rtkrd8/sdk/go/common/util/contract/assert.go:35 +0xe0
github.com/pulumi/pulumi/pkg/v3/codegen.Fs.Add(...)
        /private/tmp/pulumi-20240812-4892-rtkrd8/pkg/codegen/utilities.go:180
github.com/pulumi/pulumi/pkg/v3/codegen/dotnet.genPackageMetadata(0x14000af5040, {0x14001937640, 0xd}, 0x140019ed200, {0x0, 0x0, 0x0}, 0x140019ed4a0, 0x0)
        /private/tmp/pulumi-20240812-4892-rtkrd8/pkg/codegen/dotnet/gen.go:2242 +0x34c
github.com/pulumi/pulumi/pkg/v3/codegen/dotnet.GeneratePackage({0x102893b39?, 0x6?}, 0x14000af5040, 0x140019ed080, 0x0)
        /private/tmp/pulumi-20240812-4892-rtkrd8/pkg/codegen/dotnet/gen.go:2625 +0x288
main.genSDK.func2({0x102893b39?, 0x100b7f6fc?}, 0x6e746f64641bf7b8?, 0x100b27465?)
        /private/tmp/pulumi-20240812-4892-rtkrd8/pkg/cmd/pulumi/package_gen_sdk.go:139 +0x24
main.genSDK.genSDK.func1.func6({0x14001937420, 0x6}, 0x0?, 0x105223a40?)
        /private/tmp/pulumi-20240812-4892-rtkrd8/pkg/cmd/pulumi/package_gen_sdk.go:111 +0x40
main.genSDK({0x16f3e35e6, 0x6}, {0x16f3e35f3, 0x1}, 0x14000af5040, {0x0, 0x0}, 0x0)
        /private/tmp/pulumi-20240812-4892-rtkrd8/pkg/cmd/pulumi/package_gen_sdk.go:221 +0x274
main.newGenSdkCommand.func1(0x140007f0608, {0x14001097680, 0x1, 0x5})
        /private/tmp/pulumi-20240812-4892-rtkrd8/pkg/cmd/pulumi/package_gen_sdk.go:87 +0x4b4
main.newGenSdkCommand.RunFunc.func3(0x0?, {0x14001097680?, 0x0?, 0x0?})
        /private/tmp/pulumi-20240812-4892-rtkrd8/sdk/go/common/util/cmdutil/exit.go:99 +0x28
main.newGenSdkCommand.RunFunc.RunResultFunc.func4(0x140007f0608, {0x14001097680, 0x1, 0x5})
        /private/tmp/pulumi-20240812-4892-rtkrd8/sdk/go/common/util/cmdutil/exit.go:115 +0x34
github.com/spf13/cobra.(*Command).execute(0x140007f0608, {0x14001097630, 0x5, 0x5})
        /Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:987 +0x828
github.com/spf13/cobra.(*Command).ExecuteC(0x14001724908)
        /Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1115 +0x344
github.com/spf13/cobra.(*Command).Execute(...)
        /Users/brew/Library/Caches/Homebrew/go_mod_cache/pkg/mod/github.com/spf13/cobra@v1.8.0/command.go:1039
main.main()
        /private/tmp/pulumi-20240812-4892-rtkrd8/pkg/cmd/pulumi/main.go:55 +0x54