Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/9.0] Stable branding for GA #108899

Merged
merged 5 commits into from
Oct 16, 2024

Conversation

carlossanlop
Copy link
Member

No description provided.

@carlossanlop carlossanlop added this to the 9.0.0 milestone Oct 15, 2024
@carlossanlop carlossanlop self-assigned this Oct 15, 2024
@carlossanlop carlossanlop added the Servicing-approved Approved for servicing release label Oct 15, 2024
Copy link
Contributor

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

@carlossanlop
Copy link
Member Author

The emsdk stable branding deps flow PR is #108898

@mmitche
Copy link
Member

mmitche commented Oct 15, 2024

@carlossanlop @akoeplinger Test is failing on check a stable branding string. emsdk is merged but I don't see any failrues here that are a result of not flowing emsdk bits yet. Test failure is here:

#if STABILIZE_PACKAGE_VERSION
            // a stabilized version looks like 8.0.0
            Assert.DoesNotContain("-", version);
            Assert.True(Version.TryParse(version, out Version _));
#else
            // a non-stabilized version looks like 8.0.0-preview.5.23280.8 or 8.0.0-dev
            Assert.Contains("-", version);
            var versionNumber = version.Substring(0, version.IndexOf("-"));
            Assert.True(Version.TryParse(versionNumber, out Version _));
#endif

@carlossanlop
Copy link
Member Author

carlossanlop commented Oct 15, 2024

The test is expecting to not see the "-" character in the version, but PR CI results are (AFAIK) always expected to have the "-ci" suffix added to them, and local builds are expected to have the "-dev" suffix.

[19:03:40] info: [FAIL] System.Runtime.InteropServices.RuntimeInformationTests.DescriptionNameTests.VerifyFrameworkDescriptionContainsCorrectVersion
[19:03:40] info: Assert.DoesNotContain() Failure: Sub-string found
[19:03:40] info:               ↓ (pos 5)
[19:03:40] info: String: "9.0.0-ci"
[19:03:40] info: Found:  "-"
[19:03:40] info:    at System.Runtime.InteropServices.RuntimeInformationTests.DescriptionNameTests.VerifyFrameworkDescriptionContainsCorrectVersion()
[19:03:40] info:    at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
[19:03:40] info:    at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
[19:03:40] info: Finished:    System.Runtime.InteropServices.RuntimeInformation.Tests.dll

I suspect the test will pass in rolling builds where "-ci" or "-dev" is not added.

Fixing the test by making it more specific.

@mmitche
Copy link
Member

mmitche commented Oct 16, 2024

The test is expecting to not see the "-" character in the version, but PR CI results are (AFAIK) always expected to have the "-ci" suffix added to them, and local builds are expected to have the "-dev" suffix.

[19:03:40] info: [FAIL] System.Runtime.InteropServices.RuntimeInformationTests.DescriptionNameTests.VerifyFrameworkDescriptionContainsCorrectVersion
[19:03:40] info: Assert.DoesNotContain() Failure: Sub-string found
[19:03:40] info:               ↓ (pos 5)
[19:03:40] info: String: "9.0.0-ci"
[19:03:40] info: Found:  "-"
[19:03:40] info:    at System.Runtime.InteropServices.RuntimeInformationTests.DescriptionNameTests.VerifyFrameworkDescriptionContainsCorrectVersion()
[19:03:40] info:    at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
[19:03:40] info:    at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
[19:03:40] info: Finished:    System.Runtime.InteropServices.RuntimeInformation.Tests.dll

I suspect the test will pass in rolling builds where "-ci" or "-dev" is not added.

Fixing the test by making it more specific.

Hmm, the shipping assets maybe should not have -ci. At least, when i build winforms stable with -ci, shipping packages are 9.0.0. Maybe this is just specific to the framework description? We def need to verify on an official build.

@dkurepa
Copy link
Member

dkurepa commented Oct 16, 2024

We didn't see any -ci suffix in 9.0.0 test build https://dev.azure.com/dnceng/internal/_build/results?buildId=2531164&view=results. So I guess it's just a PR build?

// A stabilized version looks like 9.0.0
// In local builds, the version looks like 9.0.0-dev, and in PRs CI, the version looks like 9.0.0-ci.
// Both are acceptable.
if (!version.Contains("-dev") && !version.Contains("-ci"))
Copy link
Member

@akoeplinger akoeplinger Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not correct. The FrameworkDescription should always contain the stabilized version irrespective of the build environment.

This is a regression caused by #102164. Before it was reading the AssemblyInformationalVersion from System.Private.CoreLib.dll which is 9.0.0*, now it's reading it from the generators assembly and that contains 9.0.0-dev (basically what Stephen noticed in #102164 (comment))

* this is because we override it here:

<!-- Override InformationalVersion during servicing as it's returned via public api. -->
<InformationalVersion Condition="'$(PreReleaseVersionLabel)' == 'servicing'">$(ProductVersion)</InformationalVersion>
<InformationalVersion Condition="'$(StabilizePackageVersion)' == 'true'">$(ProductVersion)</InformationalVersion>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed a fix. There is potential to clean up overriding the version in SPC.dll now I think but that can be done separately.

@ViktorHofer
Copy link
Member

Should these lines now get removed (at least in main when we forward port this change)?

  • <!-- Override InformationalVersion during servicing as it's returned via public api. -->
    <InformationalVersion Condition="'$(PreReleaseVersionLabel)' == 'servicing'">$(ProductVersion)</InformationalVersion>
    <InformationalVersion Condition="'$(StabilizePackageVersion)' == 'true'">$(ProductVersion)</InformationalVersion>
  • <!-- Override InformationalVersion during servicing as it's returned via public api. -->
    <InformationalVersion Condition="'$(PreReleaseVersionLabel)' == 'servicing'">$(ProductVersion)</InformationalVersion>
    <InformationalVersion Condition="'$(StabilizePackageVersion)' == 'true'">$(ProductVersion)</InformationalVersion>
  • <!-- Override InformationalVersion during servicing as it's returned via public api. -->
    <InformationalVersion Condition="'$(PreReleaseVersionLabel)' == 'servicing'">$(ProductVersion)</InformationalVersion>
    <InformationalVersion Condition="'$(StabilizePackageVersion)' == 'true'">$(ProductVersion)</InformationalVersion>

@akoeplinger
Copy link
Member

Yeah I mentioned it above.

@mmitche
Copy link
Member

mmitche commented Oct 16, 2024

Looks like some additional test failures that may be test issues rather than product issues

@carlossanlop
Copy link
Member Author

carlossanlop commented Oct 16, 2024

Build Analysis says most failures are known. There is one in Installer Host Activation that I have not seen before. @NikolaMilosavljevic does this look familiar? https://dev.azure.com/dnceng-public/public/_build/results?buildId=844459&view=logs&j=34fcf1e9-20e8-52c9-c21d-1ed3608ac124&t=3f5386ba-6526-5d7f-4342-42281a824185&l=489

Edit: I re-ran Build Analysis and the failure was captured byhttps://github.com//issues/108921 but I am worried it might be overreacting and capturing too much.

@mmitche
Copy link
Member

mmitche commented Oct 16, 2024

image

Those are the ones i think are interesting.

@carlossanlop
Copy link
Member Author

carlossanlop commented Oct 16, 2024

Those are the ones i think are interesting.

The failure is coming from the build output argument passed to this method:

static void AssertRuntimePackPath(string buildOutput, string targetFramework)
{
var match = s_runtimePackPathRegex.Match(buildOutput);
if (!match.Success || match.Groups.Count != 2)
throw new XunitException($"Could not find the pattern in the build output: '{s_runtimePackPathPattern}'.{Environment.NewLine}Build output: {buildOutput}");
string expectedRuntimePackDir = s_buildEnv.GetRuntimePackDir(targetFramework);
string actualPath = match.Groups[1].Value;
if (string.Compare(actualPath, expectedRuntimePackDir) != 0)
throw new XunitException($"Runtime pack path doesn't match.{Environment.NewLine}Expected: '{expectedRuntimePackDir}'{Environment.NewLine}Actual: '{actualPath}'");
}

Log: https://helixre107v0xd1eu3ibi6ka.blob.core.windows.net/dotnet-runtime-refs-pull-108899-merge-651f2a552cc9403fa1/Workloads-ST-Wasm.Build.Tests/1/console.8c4328cb.log?helixlogtype=result

  Discovered:  Wasi.Build.Tests (found 11 of 13 test cases)
  Starting:    Wasi.Build.Tests (parallel test collections = on [2 threads], stop on fail = off)
    Wasi.Build.Tests.WasiTemplateTests.ConsoleBuildAndRunAOT(config: "Debug", singleFileBundle: False) [STARTING]
    Wasi.Build.Tests.SdkMissingTests.SimpleBuildDoesNotFail(config: "Debug") [STARTING]
    Wasi.Build.Tests.SdkMissingTests.SimpleBuildDoesNotFail(config: "Debug") [FAIL]
      Runtime pack path doesn't match.
      Expected: '/root/helix/work/workitem/e/dotnet-latest/packs/Microsoft.NETCore.App.Runtime.Mono.wasi-wasm/9.0.0-ci'
      Actual:   '/root/helix/work/workitem/e/dotnet-latest/packs/Microsoft.NETCore.App.Runtime.Mono.wasi-wasm/9.0.0'
      Stack Trace:
        /_/src/mono/wasi/Wasi.Build.Tests/BuildTestBase.cs(354,0): at Wasm.Build.Tests.BuildTestBase.AssertRuntimePackPath(String buildOutput, String targetFramework)
        /_/src/mono/wasi/Wasi.Build.Tests/BuildTestBase.cs(259,0): at Wasm.Build.Tests.BuildTestBase.BuildProject(BuildArgs buildArgs, String id, BuildProjectOptions options)
        /_/src/mono/wasi/Wasi.Build.Tests/SdkMissingTests.cs(70,0): at Wasi.Build.Tests.SdkMissingTests.BuildWithInvalidSdkPath(String config, String extraProperties, Boolean publish, Boolean expectSuccess)
        /_/src/mono/wasi/Wasi.Build.Tests/SdkMissingTests.cs(58,0): at Wasi.Build.Tests.SdkMissingTests.SimpleBuildDoesNotFail(String config)
           at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
           at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
      Output:
        [] Executing (Captured Output) - /root/helix/work/workitem/e/dotnet-latest/dotnet new wasiconsole  -  in pwd /root/helix/work/workitem/e/wbt artifacts/Debug_qpld2yyi_a5x
        [] The template "Wasi Console App" was created successfully.
        [] 

@lewing @akoeplinger

@carlossanlop
Copy link
Member Author

carlossanlop commented Oct 16, 2024

We generate the build out of this portion of the code, which we then pass to AssertRuntimePackPath. I wonder if we need to pass an environment variable to indicate that we are using a stabilizing build.

var envVars = s_buildEnv.EnvVars;
if (options.ExtraBuildEnvironmentVariables is not null)
{
envVars = new Dictionary<string, string>(s_buildEnv.EnvVars);
foreach (var kvp in options.ExtraBuildEnvironmentVariables!)
envVars[kvp.Key] = kvp.Value;
}
envVars["NUGET_PACKAGES"] = _nugetPackagesDir;
if (UseWBTOverridePackTargets && s_buildEnv.IsWorkload)
envVars["WBTOverrideRuntimePack"] = "true";
result = AssertBuild(sb.ToString(), id, expectSuccess: options.ExpectSuccess, envVars: envVars);

Edit: I just realized the problem is not in the actual but in the expected string, which is coming from:

public string GetRuntimePackDir(string tfm = BuildTestBase.DefaultTargetFramework, RuntimeVariant runtimeType = RuntimeVariant.SingleThreaded)
=> Path.Combine(WorkloadPacksDir,
runtimeType is RuntimeVariant.SingleThreaded
? $"Microsoft.NETCore.App.Runtime.Mono.{DefaultRuntimeIdentifier}"
: $"Microsoft.NETCore.App.Runtime.Mono.multithread.{DefaultRuntimeIdentifier}",
GetRuntimePackVersion(tfm));

It seems we are getting the value of the suffix from an environment variable called RUNTIME_PACK_VER9. I wonder if we need to indicate that we're working with a stabilized build in these tests as well.

@carlossanlop
Copy link
Member Author

Opened two issues to get the failures fixed separately:

I'll merge this to unblock stable branding.

@lewing @akoeplinger

@carlossanlop carlossanlop merged commit d398172 into dotnet:release/9.0 Oct 16, 2024
147 of 157 checks passed
@carlossanlop carlossanlop deleted the StableBranding9 branch October 16, 2024 18:45
@carlossanlop
Copy link
Member Author

Good news: The release/9.0 rolling build that included this change did not hit the failures reported above: https://dev.azure.com/dnceng/internal/_build/results?buildId=2562281&view=results

So they indeed are only happening in PRs.

@github-actions github-actions bot locked and limited conversation to collaborators Nov 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Infrastructure Servicing-approved Approved for servicing release
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants