From 9d8e6275a566d63069f7227512bb0171f6707017 Mon Sep 17 00:00:00 2001 From: Florian Stadler Date: Tue, 21 Jan 2025 23:02:14 +0100 Subject: [PATCH] Remove unsupported LangVersion from dotnet example (#2003) dotnet builds started failing, due to the upgrade of the github runners to ubuntu 24.04. The `RoleCS` test was failing with issues in selecting `LanguageVersion` 11. I've removed that version identifier from the `csproj` of the failing test to align with the other CS tests and changed it to not use features from language version 11. ### Why did this work before? Previously this worked, because the test implicitly used v8 of the dotnet runtime instead of the requested v6 (configured in ci-mgmt https://github.com/pulumi/ci-mgmt/issues/1307). The `setup-dotnet` action implicitly installs the latest LTS before installing other versions. We're requesting 6.0.x and on Ubuntu 22.04 this was already pre-installed, so this happened: - Install latest LTS (v8) - Install v6.0.x -> Already present -> Noop Because of that v8 was on the path first and used for tests. Now on Ubuntu 24.04 v8 is pre-installed, so this happens: - Install latest LTS (v8) -> Already present -> Noop - Install v6.0.x Now we're actually using the requested v6, but the `RoleCs` test is not compatible with that. --- examples/role-cs/MyStack.cs | 20 +++++++++----------- examples/role-cs/role-cs.csproj | 1 - 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/examples/role-cs/MyStack.cs b/examples/role-cs/MyStack.cs index 5ea37d8e29..2552270b78 100644 --- a/examples/role-cs/MyStack.cs +++ b/examples/role-cs/MyStack.cs @@ -12,19 +12,17 @@ public MyStack() { var testRole = new Role("role-test", new RoleArgs { - AssumeRolePolicyDocument = """ - { - "Version": "2012-10-17", - "Statement": [{ - "Sid": "", - "Effect": "Allow", - "Principal": { - "Service": "ec2.amazonaws.com" + AssumeRolePolicyDocument = @"{ + ""Version"": ""2012-10-17"", + ""Statement"": [{ + ""Sid"": """", + ""Effect"": ""Allow"", + ""Principal"": { + ""Service"": ""ec2.amazonaws.com"" }, - "Action": "sts:AssumeRole" + ""Action"": ""sts:AssumeRole"" }] - } - """, + }", Policies = new[] { new IamInputs.RolePolicyArgs diff --git a/examples/role-cs/role-cs.csproj b/examples/role-cs/role-cs.csproj index 190809b34d..d475a53fb0 100644 --- a/examples/role-cs/role-cs.csproj +++ b/examples/role-cs/role-cs.csproj @@ -1,7 +1,6 @@  - 11 Exe net6.0 enable