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

[iOS][tvOS] Building tests fails with "Trimming assemblies requires .NET Core 3.0 or higher" #91535

Closed
simonrozsival opened this issue Sep 4, 2023 · 9 comments · Fixed by #91542
Assignees
Labels
area-Infrastructure-mono blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab os-ios Apple iOS os-tvos Apple tvOS

Comments

@simonrozsival
Copy link
Member

simonrozsival commented Sep 4, 2023

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=394436
Build error leg or test failing: Build / tvos-arm64 Release AllSubsets_Mono_RuntimeTests / Build Tests
Pull request: #91520

The last scheduled CI run of runtime-extra-platforms on main built correctly on Aug 31, 2023 at 11:00 AM GMT+2 (ff2de363f393f2270d5752eeb3db345fcf770c5c, https://dev.azure.com/dnceng-public/public/_build/results?buildId=391626&view=results).

The next scheduled CI run on Aug 31, 2023 at 11:00 PM GMT+2 failed (cd4a25371c721f83be3fa3367be6cb143709dadc, https://dev.azure.com/dnceng-public/public/_build/results?buildId=392353&view=logs&j=59056779-c81b-5864-b8d0-ad352b49f318&t=8f67da1d-4989-5758-2e5c-fa15a4fd6276) and CI has been failing since.

Affected pipelines:

  • runtime-extra-platforms
  • runtime-ioslike

Error Message

{
  "ErrorMessage": "error NETSDK1124: Trimming assemblies requires .NET Core 3.0 or higher.",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=394436
Error message validated: error NETSDK1124: Trimming assemblies requires .NET Core 3.0 or higher.
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 9/4/2023 9:41:44 AM UTC

Report

Build Definition Step Name Console log Pull Request
397682 dotnet/runtime Build product Log #91468
397525 dotnet/runtime Build Tests Log
397233 dotnet/runtime Build Tests Log #91684
397052 dotnet/runtime Build Tests Log #91458
397028 dotnet/runtime Build Tests Log #91290
396849 dotnet/runtime Build Tests Log #91019
396755 dotnet/runtime Build Tests Log #91660
396634 dotnet/runtime Build Tests Log
396207 dotnet/runtime Build product Log #91468
396162 dotnet/runtime Build product Log #91468
396111 dotnet/runtime Build Tests Log
395837 dotnet/runtime Run Trimming Tests Log #91468
395833 dotnet/runtime Build product Log #91468
395791 dotnet/runtime Build Tests Log #91458
395438 dotnet/runtime Build Tests Log #91458
395416 dotnet/runtime Build Tests Log
395186 dotnet/runtime Build Tests Log
394754 dotnet/runtime Build Tests Log #91116
394654 dotnet/runtime Build Tests Log
394471 dotnet/runtime Build Tests Log
394436 dotnet/runtime Build Tests Log #91520
394347 dotnet/runtime Build Tests Log

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
8 22 22
@simonrozsival simonrozsival added blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' os-ios Apple iOS os-tvos Apple tvOS Known Build Error Use this to report build issues in the .NET Helix tab labels Sep 4, 2023
@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Sep 4, 2023
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Sep 4, 2023
@ghost
Copy link

ghost commented Sep 4, 2023

Tagging subscribers to 'os-ios': @steveisok, @akoeplinger, @kotlarmilos
See info in area-owners.md if you want to be subscribed.

Issue Details

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=394436
Build error leg or test failing: Build / tvos-arm64 Release AllSubsets_Mono_RuntimeTests / Build Tests
Pull request: #91520

The last scheduled CI run of runtime-extra-platforms on main built correctly on Aug 31, 2023 at 11:00 AM GMT+2 (ff2de363f393f2270d5752eeb3db345fcf770c5c, https://dev.azure.com/dnceng-public/public/_build/results?buildId=391626&view=results).

The next scheduled CI run on Aug 31, 2023 at 11:00 PM GMT+2 failed (cd4a25371c721f83be3fa3367be6cb143709dadc, https://dev.azure.com/dnceng-public/public/_build/results?buildId=392353&view=logs&j=59056779-c81b-5864-b8d0-ad352b49f318&t=8f67da1d-4989-5758-2e5c-fa15a4fd6276) and the

Affected pipelines:

  • runtime-extra-platforms
  • runtime-ioslike

Error Message

{
  "ErrorMessage": "error NETSDK1124: Trimming assemblies requires .NET Core 3.0 or higher.",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}
Author: simonrozsival
Assignees: -
Labels:

blocking-clean-ci, os-ios, os-tvos, Known Build Error

Milestone: -

@simonrozsival
Copy link
Member Author

@ViktorHofer
Copy link
Member

ViktorHofer commented Sep 4, 2023

cc @sbomer @agocke @vitek-karas

XUnitWrapperGenerator.csproj targets netstandard2.0 so I assume the project somehow has set set IsTrimmable=true? cc @jkoritzinsky

@vitek-karas
Copy link
Member

@sbomer - there's a somewhat weird case here. The project gets PublishTrimmed=true - because we want to trim all executables in the subtree. But the project is a library, so it actually won't be trimmed - this alone is not a good reason since PublishAot=true has the same effect and that can work on a library. But we don't publish the project, we just build it (publishing a library is effectively an undefined operation for SDK in lot of situations). In the end by normal logic, it should not matter that trimming doesn't work on netstandard2.0 library, if nobody tried to publish it.

That said, this is something few people will run into - PublishTrimmed is expected to be set on per-project basis, not globally for entire subtrees. So this is probably not something we need to fix (and the fix is problematic, SDK has a hard time differentiating between normal build and publish for such a core piece as "resolve framework references").

@vitek-karas
Copy link
Member

Side question - how does one get a binlog for the internal MSbuild execution which happens during RestoreTaskEx? Normal /bl is useless unfortunately:
image

It seems to propagate most properties inside automagically (unlike normal tasks which take parameters but don't react to MSBuild properties inside the task).

@ghost
Copy link

ghost commented Sep 4, 2023

Tagging subscribers to this area: @directhex
See info in area-owners.md if you want to be subscribed.

Issue Details

Build Information

Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=394436
Build error leg or test failing: Build / tvos-arm64 Release AllSubsets_Mono_RuntimeTests / Build Tests
Pull request: #91520

The last scheduled CI run of runtime-extra-platforms on main built correctly on Aug 31, 2023 at 11:00 AM GMT+2 (ff2de363f393f2270d5752eeb3db345fcf770c5c, https://dev.azure.com/dnceng-public/public/_build/results?buildId=391626&view=results).

The next scheduled CI run on Aug 31, 2023 at 11:00 PM GMT+2 failed (cd4a25371c721f83be3fa3367be6cb143709dadc, https://dev.azure.com/dnceng-public/public/_build/results?buildId=392353&view=logs&j=59056779-c81b-5864-b8d0-ad352b49f318&t=8f67da1d-4989-5758-2e5c-fa15a4fd6276) and CI has been failing since.

Affected pipelines:

  • runtime-extra-platforms
  • runtime-ioslike

Error Message

{
  "ErrorMessage": "error NETSDK1124: Trimming assemblies requires .NET Core 3.0 or higher.",
  "BuildRetry": false,
  "ExcludeConsoleLog": false
}

Known issue validation

Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=394436
Error message validated: error NETSDK1124: Trimming assemblies requires .NET Core 3.0 or higher.
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 9/4/2023 9:41:44 AM UTC

Report

Build Definition Step Name Console log Pull Request
394654 dotnet/runtime Build Tests Log
394471 dotnet/runtime Build Tests Log
394436 dotnet/runtime Build Tests Log #91520
394347 dotnet/runtime Build Tests Log

Summary

24-Hour Hit Count 7-Day Hit Count 1-Month Count
3 4 4
Author: simonrozsival
Assignees: -
Labels:

blocking-clean-ci, untriaged, area-Infrastructure-mono, os-ios, os-tvos, Known Build Error, needs-area-label

Milestone: -

@ViktorHofer
Copy link
Member

Side question - how does one get a binlog for the internal MSbuild execution which happens during RestoreTaskEx? Normal /bl is useless unfortunately

Set the following env var: https://github.com/NuGet/NuGet.Client/blob/46c44c7ca8d2f994367125153360893ec13373f6/src/NuGet.Core/NuGet.Build.Tasks.Console/MSBuildStaticGraphRestore.cs#L894

set RESTORE_TASK_BINLOG_PARAMETERS=nuget.binlog

@kotlarmilos kotlarmilos self-assigned this Sep 5, 2023
@kotlarmilos
Copy link
Member

In the end by normal logic, it should not matter that trimming doesn't work on netstandard2.0 library, if nobody tried to publish it.

I agree. Should we open an issue in the msbuild or sdk repo?

@vitek-karas
Copy link
Member

That would in the sdk repo, but the priority of this is so low I doubt we'll bother with it. If we some day actually define a behavior for "trimming libraries" we would actually want the current behavior, so it's not that bad to keep it :-)

I think the cleaner solution would be to actually define "publish for libraries", even if it means "invalid" - but that's a very complex problem to solve currently (mostly we don't know if somebody has dependencies on the existing semi broken behavior).

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Sep 6, 2023
@ghost ghost removed in-pr There is an active PR which will close this issue when it is merged untriaged New issue has not been triaged by the area owner labels Sep 7, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Oct 7, 2023
@am11 am11 removed the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jul 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Infrastructure-mono blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' Known Build Error Use this to report build issues in the .NET Helix tab os-ios Apple iOS os-tvos Apple tvOS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants