Skip to content

Build fails with prebuilt errors that were previously warnings #5691

Closed

Description

@corngood

Describe the Bug

In v10.0.114 this happens:

                   Task "ValidateUsageAgainstBaseline" (TaskId:144)
                     Task Parameter:BaselineDataFile=/var/tmp/nix-shell.1uHuw9/dotnet-10.0.114/eng/tools/prebuilt-baseline.xml (TaskId:144)
                     Task Parameter:OutputBaselineFile=/var/tmp/nix-shell.1uHuw9/dotnet-10.0.114/artifacts/log/Release/generated-new-baseline.xml (TaskId:144)
                     Task Parameter:OutputReportFile=/var/tmp/nix-shell.1uHuw9/dotnet-10.0.114/artifacts/log/Release/baseline-comparison.xml (TaskId:144)
                     Task Parameter:DataFile=/var/tmp/nix-shell.1uHuw9/dotnet-10.0.114/artifacts/log/Release/prebuilt-usage.xml (TaskId:144)
                     Launching task "ValidateUsageAgainstBaseline" from assembly "/var/tmp/nix-shell.1uHuw9/dotnet-10.0.114/artifacts/bin/Microsoft.DotNet.UnifiedBuild.Tasks/Release/Microsoft.DotNet.UnifiedBuild.Tasks.dll" in an external task host with a runtime of "NET" and a process architecture of "x64". (TaskId:144)
12:50:56.566   8:5>/var/tmp/nix-shell.1uHuw9/dotnet-10.0.114/eng/finish-source-only.proj(136,5): warning : 5 new packages used not in baseline! See report at /var/tmp/nix-shell.1uHuw9/dotnet-10.0.114/artifacts/log/Release/baseline-comparison.xml for more information. Package IDs are:
/var/tmp/nix-shell.1uHuw9/dotnet-10.0.114/eng/finish-source-only.proj(136,5): warning : Microsoft.AspNetCore.App.Runtime.linux-x64.10.0.12
/var/tmp/nix-shell.1uHuw9/dotnet-10.0.114/eng/finish-source-only.proj(136,5): warning : Microsoft.NETCore.App.Crossgen2.linux-x64.10.0.12
/var/tmp/nix-shell.1uHuw9/dotnet-10.0.114/eng/finish-source-only.proj(136,5): warning : Microsoft.NETCore.App.Runtime.linux-x64.10.0.12
/var/tmp/nix-shell.1uHuw9/dotnet-10.0.114/eng/finish-source-only.proj(136,5): warning : runtime.placeholder-rid.Microsoft.NETCore.ILAsm.10.0.12
/var/tmp/nix-shell.1uHuw9/dotnet-10.0.114/eng/finish-source-only.proj(136,5): warning : runtime.placeholder-rid.Microsoft.NETCore.ILDAsm.10.0.12
                     The previous error was converted to a warning because the task was called with ContinueOnError=true. (TaskId:144)
12:50:56.567   8:5>/var/tmp/nix-shell.1uHuw9/dotnet-10.0.114/eng/finish-source-only.proj(136,5): warning : Prebuilt usages are different from the baseline. If detected changes are acceptable, update baseline with:
/var/tmp/nix-shell.1uHuw9/dotnet-10.0.114/eng/finish-source-only.proj(136,5): warning : cp '/var/tmp/nix-shell.1uHuw9/dotnet-10.0.114/artifacts/log/Release/generated-new-baseline.xml' '/var/tmp/nix-shell.1uHuw9/dotnet-10.0.114/eng/tools/prebuilt-baseline.xml'
                     Build continuing because "ContinueOnError" on the task "ValidateUsageAgainstBaseline" is set to "true". (TaskId:144)
                   Done executing task "ValidateUsageAgainstBaseline" -- FAILED. (TaskId:144)

but in v10.0.115, the warnings are now errors:

                   Using "ValidateUsageAgainstBaseline" task from assembly "/var/tmp/nix-shell.AZWLBJ/dotnet-10.0.115/artifacts/bin/Microsoft.DotNet.UnifiedBuild.Tasks/Release/Microsoft.DotNet.UnifiedBuild.Tasks.d
ll".
                   Task "ValidateUsageAgainstBaseline" (TaskId:144)
                     Task Parameter:BaselineDataFile=/var/tmp/nix-shell.AZWLBJ/dotnet-10.0.115/eng/tools/prebuilt-baseline.xml (TaskId:144)
                     Task Parameter:OutputBaselineFile=/var/tmp/nix-shell.AZWLBJ/dotnet-10.0.115/artifacts/log/Release/generated-new-baseline.xml (TaskId:144)
                     Task Parameter:OutputReportFile=/var/tmp/nix-shell.AZWLBJ/dotnet-10.0.115/artifacts/log/Release/baseline-comparison.xml (TaskId:144)
                     Task Parameter:DataFile=/var/tmp/nix-shell.AZWLBJ/dotnet-10.0.115/artifacts/log/Release/prebuilt-usage.xml (TaskId:144)
                     Launching task "ValidateUsageAgainstBaseline" from assembly "/var/tmp/nix-shell.AZWLBJ/dotnet-10.0.115/artifacts/bin/Microsoft.DotNet.UnifiedBuild.Tasks/Release/Microsoft.DotNet.UnifiedBuild.Tasks.dll" in an external task host with a runtime of "NET" and a process architecture of "x64". (TaskId:144)
12:50:42.001   7:5>/var/tmp/nix-shell.AZWLBJ/dotnet-10.0.115/eng/finish-source-only.proj(136,5): error : 5 new packages used not in baseline! See report at /var/tmp/nix-shell.AZWLBJ/dotnet-10.0.115/artifacts/log/Release/baseline-comparison.xml for more information. Package IDs are:
/var/tmp/nix-shell.AZWLBJ/dotnet-10.0.115/eng/finish-source-only.proj(136,5): error : Microsoft.AspNetCore.App.Runtime.linux-x64.10.0.13
/var/tmp/nix-shell.AZWLBJ/dotnet-10.0.115/eng/finish-source-only.proj(136,5): error : Microsoft.NETCore.App.Crossgen2.linux-x64.10.0.13
/var/tmp/nix-shell.AZWLBJ/dotnet-10.0.115/eng/finish-source-only.proj(136,5): error : Microsoft.NETCore.App.Runtime.linux-x64.10.0.13
/var/tmp/nix-shell.AZWLBJ/dotnet-10.0.115/eng/finish-source-only.proj(136,5): error : runtime.placeholder-rid.Microsoft.NETCore.ILAsm.10.0.13
/var/tmp/nix-shell.AZWLBJ/dotnet-10.0.115/eng/finish-source-only.proj(136,5): error : runtime.placeholder-rid.Microsoft.NETCore.ILDAsm.10.0.13
                     The previous error was converted to a warning because the task was called with ContinueOnError=true. (TaskId:144)
12:50:42.002   7:5>/var/tmp/nix-shell.AZWLBJ/dotnet-10.0.115/eng/finish-source-only.proj(136,5): error : Prebuilt usages are different from the baseline. If detected changes are acceptable, update baseline with:
/var/tmp/nix-shell.AZWLBJ/dotnet-10.0.115/eng/finish-source-only.proj(136,5): error : cp '/var/tmp/nix-shell.AZWLBJ/dotnet-10.0.115/artifacts/log/Release/generated-new-baseline.xml' '/var/tmp/nix-shell.AZWLBJ/dotnet-10.0.115/eng/tools/prebuilt-baseline.xml'
                     Build continuing because "ContinueOnError" on the task "ValidateUsageAgainstBaseline" is set to "true". (TaskId:144)
                   Done executing task "ValidateUsageAgainstBaseline" -- FAILED. (TaskId:144)

This results in the overall build.proj build failing instead of succeeding.

Steps to Reproduce

build dotnet sdk 10 from NixOS/nixpkgs#586420

Other Information

I haven't tracked down what actually changed here, or what was downgrading errors to warnings at:

                Log.LogError(
                    $"{diff.Added.Length} new packages used not in baseline! See report " +
                    $"at {OutputReportFile} for more information. Package IDs are:\n" +
                    string.Join("\n", diff.Added.Select(u => u.ToString())));

Perhaps this was always the intended behaviour?

Activity

  1. mthalman commented on Nov 11, 2026

    @mthalman
    Member

    This was introduced by dotnet/dotnet#10307.

    I assume that you're expecting prebuilts to exist because of your build configuration?

  2. corngood commented on Nov 11, 2026

    @corngood
    Author

    This was introduced by dotnet/dotnet#10307.

    Yeah, -warnAsError seems to take precedence over ContinueOnError="WarnAndContinue".

    I assume that you're expecting prebuilts to exist because of your build configuration?

    Yeah, our stage-1 builds use prebuilts for those packages.

  3. mthalman commented on Nov 11, 2026

    @mthalman
    Member

    @akoeplinger - Do you know of any config magic to work around this?

  4. corngood commented on Nov 11, 2026

    @corngood
    Author

    For a workaround I'm going to try to disable either the task or the target:

      <Target Name="ReportPrebuiltUsage"
              Inputs="$(MSBuildProjectFullPath)"
              Outputs="$(BaseIntermediateOutputPath)ReportPrebuiltUsage.complete"
              DependsOnTargets="WritePrebuiltUsageData"
              BeforeTargets="Build">
    [...]
        <ValidateUsageAgainstBaseline
          DataFile="$(PackageReportDataFile)"
          BaselineDataFile="$(BaselineDataFile)"
          OutputBaselineFile="$(ArtifactsLogDir)generated-new-baseline.xml"
          OutputReportFile="$(ArtifactsLogDir)baseline-comparison.xml"
          AllowTestProjectUsage="$(AllowTestProjectUsage)"
          ContinueOnError="$(ContinueOnPrebuiltBaselineError)" />

    I haven't spotted a cleaner way to do it, so I'll probably have to patch this script with a Condition="'$(SkipErrorOnPrebuilts)' != 'true'".

  5. akoeplinger commented on Nov 11, 2026

    @akoeplinger
    Member

    I'd just remove the -warnAsError as a workaround I think. Ideally we want to get rid of it too like we did in 11.0+

  6. corngood commented on Nov 11, 2026

    @corngood
    Author

    I'd just remove the -warnAsError as a workaround I think. Ideally we want to get rid of it too like we did in 11.0+

    Ah, I didn't realised it had been reverted already. That'll be easier. Thanks

  7. mthalman commented on Nov 12, 2026

    @mthalman
    Member

    @corngood - Are you good with closing this since you have a workaround?

  8. corngood commented on Nov 12, 2026

    @corngood
    Author

    Are you good with closing this since you have a workaround?

    Sure, we can track dotnet/dotnet#10916 for a real fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions