Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: upgrade jsii-pacmak and other jsii tools to 1.106.0 (#33057)
After the version upgrade of `@aws-cdk/cloud-assembly-schema` to `^39.2.0` in #32998 our cli integration and init tests started failing with the following error in all .NET projects: ``` /tmp/CdkInteg0Rk0Rq9U2Tk.csproj : error NU1605: Warning As Error: Detected package downgrade: Amazon.JSII.Runtime from 1.106.0 to 1.104.0. Reference the package directly from the project to select a different version. /tmp/CdkInteg0Rk0Rq9U2Tk.csproj : error NU1605: CdkInteg0Rk0Rq9U2Tk -> Amazon.CDK.Lib 2.177.0-rc.0 -> Amazon.CDK.CloudAssembly.Schema 39.2.0 -> Amazon.JSII.Runtime (>= 1.106.0 && < 2.0.0) /tmp//CdkInteg0Rk0Rq9U2Tk.csproj : error NU1605: CdkInteg0Rk0Rq9U2Tk -> Amazon.CDK.Lib 2.177.0-rc.0 -> Amazon.JSII.Runtime (>= 1.104.0 && < 2.0.0) ``` ### Reason for this change This error is documented in the NuGet docs as [Example 1](https://learn.microsoft.com/en-us/nuget/reference/errors-and-warnings/nu1605#example-1). The .NET CDK project that is created in these tests declares a dependency on depending on `Amazon.CDK.Lib`. `Amazon.CDK.Lib` declares a direct dependency on `Amazon.JSII.Runtime (>= 1.104.0 && < 2.0.0)`. But it also declares an indirect dependency on `Amazon.JSII.Runtime (>= 1.106.0 && < 2.0.0)` through the `Amazon.CDK.CloudAssembly.Schema` package: ``` TestProject -> Amazon.CDK.Lib 2.177.0-rc.0 -> Amazon.CDK.CloudAssembly.Schema 39.2.0 -> Amazon.JSII.Runtime (>= 1.106.0 && < 2.0.0) TestProject -> Amazon.CDK.Lib 2.177.0-rc.0 -> Amazon.JSII.Runtime (>= 1.104.0 && < 2.0.0) ``` Because of the [direct-dependency-wins](https://learn.microsoft.com/en-us/nuget/concepts/dependency-resolution#direct-dependency-wins) rule `Amazon.JSII.Runtime (>= 1.104.0 && < 2.0.0)` would be selected. It overrules the distant package and thus causes the package downgrade, which is an error. #### Why does the issue surface now? The previous (released) version of `Amazon.CDK.Lib` declares these dependencies ([Source](https://www.nuget.org/packages/Amazon.CDK.Lib/2.176.0#dependencies-body-tab)): ``` Amazon.CDK.CloudAssembly.Schema (>= 39.0.1 && < 40.0.0) Amazon.JSII.Runtime (>= 1.104.0 && < 2.0.0) ``` And `Amazon.CDK.CloudAssembly.Schema` v39.0.1 declares this dependency ([Source](https://www.nuget.org/packages/Amazon.CDK.CloudAssembly.Schema/39.0.1#dependencies-body-tab)): ``` Amazon.JSII.Runtime (>= 1.104.0 && < 2.0.0) ``` As you can see, both versions of `Amazon.JSII.Runtime` are the same. The pre-released package of `Amazon.CDK.Lib` however has updated its dependency on `Amazon.CDK.CloudAssembly.Schema` to `(>= 39.2.0 && < 40.0.0)`. And if we check the distant dependencies for the newer version of `Amazon.CDK.CloudAssembly.Schema`, we get this ([Source](https://www.nuget.org/packages/Amazon.CDK.CloudAssembly.Schema/39.2.0#dependencies-body-tab)): ``` Amazon.JSII.Runtime (>= 1.106.0 && < 2.0.0) ``` **This is where the problem stems from.** #### Root cause The dependency constraint for `Amazon.JSII.Runtime` is determined by the used version of `jsii-pacmak` in each package. The root cause is that the tested versions of `aws-cdk-lib` and `@aws-cdk/cloud-assembly-schema` are build with a different version of `jsii-pacmak`. ### Description of changes Update the version of `jsii-pacmak` in all monorepo packages to be the latest version and the same as in `@aws-cdk/cloud-assembly-schema`. ### Describe any new or updated permissions being added n/a ### Description of how you validated changes Run through the integration test pipeline. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
- Loading branch information