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

[BUG] new assembly metadata of #3038 breaks build #3045

Closed
BerndStoltefuss opened this issue Jan 8, 2024 · 3 comments · Fixed by #3051
Closed

[BUG] new assembly metadata of #3038 breaks build #3045

BerndStoltefuss opened this issue Jan 8, 2024 · 3 comments · Fixed by #3051

Comments

@BerndStoltefuss
Copy link

BerndStoltefuss commented Jan 8, 2024

Description

Latests ci build including the "feat: Add IsTrimmable False metadata to assembly" breaks build in publish mode.

Steps to Reproduce

  1. Create a maui app using latest ci builds of prism.
  2. build app with "dotnet publish" (without PublishTrimmed=FALSE in the project file)

Platform with bug

.NET MAUI

Affected platforms

iOS, I was not able test on other platforms

Did you find any workaround?

Rollback to a pre january version of prism as disabling trimming is not possible for iOS.

Relevant log output

Fehler beim Buildvorgang.

       "/Users/jenkins/slave/workspace/NWAI-ToHarvest-macpipeline8/LBS_Rapid.sln" (Publish Ziel) (1) ->
       "/Users/jenkins/slave/workspace/NWAI-ToHarvest-macpipeline8/LBS_Rapid/LBS_Rapid.csproj" (Publish Ziel) (2) ->
       (_RunILLink Ziel) -> 
         /Users/jenkins/.nuget/packages/prism.container.abstractions/9.0.80-pre/lib/net8.0/Prism.Container.Abstractions.dll : error IL2102: Invalid AssemblyMetadata("IsTrimmable", "False") attribute in assembly 'Prism.Container.Abstractions'. Value must be "True". [/Users/jenkins/slave/workspace/NWAI-ToHarvest-macpipeline8/LBS_Rapid/LBS_Rapid.csproj::TargetFramework=net8.0-ios]
         /Users/jenkins/.nuget/packages/prism.container.dryioc/9.0.80-pre/lib/net8.0/Prism.Container.DryIoc.dll : error IL2102: Invalid AssemblyMetadata("IsTrimmable", "False") attribute in assembly 'Prism.Container.DryIoc'. Value must be "True". [/Users/jenkins/slave/workspace/NWAI-ToHarvest-macpipeline8/LBS_Rapid/LBS_Rapid.csproj::TargetFramework=net8.0-ios]
         /Users/jenkins/.nuget/packages/prism.core/9.0.349-pre/lib/net6.0/Prism.dll : error IL2102: Invalid AssemblyMetadata("IsTrimmable", "False") attribute in assembly 'Prism'. Value must be "True". [/Users/jenkins/slave/workspace/NWAI-ToHarvest-macpipeline8/LBS_Rapid/LBS_Rapid.csproj::TargetFramework=net8.0-ios]
         /Users/jenkins/.nuget/packages/prism.dryioc.maui/9.0.349-pre/lib/net8.0/Prism.DryIoc.Maui.dll : error IL2102: Invalid AssemblyMetadata("IsTrimmable", "False") attribute in assembly 'Prism.DryIoc.Maui'. Value must be "True". [/Users/jenkins/slave/workspace/NWAI-ToHarvest-macpipeline8/LBS_Rapid/LBS_Rapid.csproj::TargetFramework=net8.0-ios]
         /Users/jenkins/.nuget/packages/prism.events/9.0.349-pre/lib/net6.0/Prism.Events.dll : error IL2102: Invalid AssemblyMetadata("IsTrimmable", "False") attribute in assembly 'Prism.Events'. Value must be "True". [/Users/jenkins/slave/workspace/NWAI-ToHarvest-macpipeline8/LBS_Rapid/LBS_Rapid.csproj::TargetFramework=net8.0-ios]
         /Users/jenkins/.nuget/packages/prism.maui.rx/9.0.349-pre/lib/net8.0/Prism.Maui.Rx.dll : error IL2102: Invalid AssemblyMetadata("IsTrimmable", "False") attribute in assembly 'Prism.Maui.Rx'. Value must be "True". [/Users/jenkins/slave/workspace/NWAI-ToHarvest-macpipeline8/LBS_Rapid/LBS_Rapid.csproj::TargetFramework=net8.0-ios]
         /Users/jenkins/.nuget/packages/prism.maui/9.0.349-pre/lib/net8.0/Prism.Maui.dll : error IL2102: Invalid AssemblyMetadata("IsTrimmable", "False") attribute in assembly 'Prism.Maui'. Value must be "True". [/Users/jenkins/slave/workspace/NWAI-ToHarvest-macpipeline8/LBS_Rapid/LBS_Rapid.csproj::TargetFramework=net8.0-ios]


       "/Users/jenkins/slave/workspace/NWAI-ToHarvest-macpipeline8/LBS_Rapid.sln" (Publish Ziel) (1) ->
       "/Users/jenkins/slave/workspace/NWAI-ToHarvest-macpipeline8/LBS_Rapid/LBS_Rapid.csproj" (Publish Ziel) (2) ->
       (ILLink Ziel) -> 
         /Users/jenkins/.nuget/packages/microsoft.net.illink.tasks/8.0.0/build/Microsoft.NET.ILLink.targets(87,5): error NETSDK1144: Fehler bei der Größenoptimierung von Assemblys. Die Optimierung kann durch Festlegen der PublishTrimmed-Eigenschaft auf FALSE deaktiviert werden. [/Users/jenkins/slave/workspace/NWAI-ToHarvest-macpipeline8/LBS_Rapid/LBS_Rapid.csproj::TargetFramework=net8.0-ios]
@BerndStoltefuss
Copy link
Author

BerndStoltefuss commented Jan 9, 2024

As requested my csproj file LBS_Rapid.csproj.txt.
The correspondig build command is:
dotnet publish LBS_Rapid.sln -v normal -f net8.0-ios -c Release -p:ArchiveOnBuild=true -p:RuntimeIdentifier=ios-arm64 -p:CodesignProvision=LBSGoDistributionV2 '-p:CodesignKey=iPhone Distribution: LBS Go' -p:BuildIpa=true -p:SetVersion=true -p:BuildNumber=40 -p:Version=0232.101 '-p:MyConstants="NEW_PROPERTY_SYSTEM;UMG_FKT_WEITERENTW;DUMMY"'

Please note that with target iOS it is not allowed to use <PublishTrimmed>false</PublishTrimmed>.

@BerndStoltefuss
Copy link
Author

According to dotnet/maui#18658 third party libs like prism will not be trimmed unless you opt-in with IsTrimmable=true. So the easiest solution might be to reverse the "IsTrimmable=false" change.

@dansiegel
Copy link
Member

@BerndStoltefuss can you please provide an actual sample project that we can run and duplicate your issue. Thanks.

@dansiegel dansiegel mentioned this issue Jan 18, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants