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

[dotnet] ILStrip fails when building F# projects from Windows #14841

Closed
rolfbjarne opened this issue Apr 28, 2022 · 3 comments · Fixed by #18508
Closed

[dotnet] ILStrip fails when building F# projects from Windows #14841

rolfbjarne opened this issue Apr 28, 2022 · 3 comments · Fixed by #18508
Labels
bug If an issue is a bug or a pull request a bug fix dotnet An issue or pull request related to .NET (6) windows-only The issue only occur on Windows
Milestone

Comments

@rolfbjarne
Copy link
Member

rolfbjarne commented Apr 28, 2022

Repro project: fsharp.zip

Build:

dotnet build dotnet/iOS/.fsproj -bl -p:RuntimeIdentifier=ios-arm64 -p:Configuration=Release -p:UseLlvm=true

Binlog: msbuild.binlog.zip

"C:\Users\rolf\source\fsharp\dotnet\iOS\fsharp.fsproj" (default target) (1:7) ->
(_StripAssemblyIL target) ->
  C:\...\targets\Xamarin.Shared.Sdk.targets(739,3): error : ILStrip failed for C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/ko/FSharp.Core.resources.dll: File '/Users/rolf/Library/Caches/Xamarin/mtbs/builds/fsharp/0a37d198e93da924afce6d66d7832fe80a3eb34fcfd38a4c15ff33390117d5a8/C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/ko/FSharp.Core.resources.dll' not found.
  C:\...\targets\Xamarin.Shared.Sdk.targets(739,3): error : ILStrip failed for C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/tr/FSharp.Core.resources.dll: File '/Users/rolf/Library/Caches/Xamarin/mtbs/builds/fsharp/0a37d198e93da924afce6d66d7832fe80a3eb34fcfd38a4c15ff33390117d5a8/C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/tr/FSharp.Core.resources.dll' not found.
  C:\...\targets\Xamarin.Shared.Sdk.targets(739,3): error : ILStrip failed for C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/zh-Hant/FSharp.Core.resources.dll: File '/Users/rolf/Library/Caches/Xamarin/mtbs/builds/fsharp/0a37d198e93da924afce6d66d7832fe80a3eb34fcfd38a4c15ff33390117d5a8/C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/zh-Hant/FSharp.Core.resources.dll' not found.
  C:\...\targets\Xamarin.Shared.Sdk.targets(739,3): error : ILStrip failed for C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/it/FSharp.Core.resources.dll: File '/Users/rolf/Library/Caches/Xamarin/mtbs/builds/fsharp/0a37d198e93da924afce6d66d7832fe80a3eb34fcfd38a4c15ff33390117d5a8/C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/it/FSharp.Core.resources.dll' not found.
  C:\...\targets\Xamarin.Shared.Sdk.targets(739,3): error : ILStrip failed for C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/es/FSharp.Core.resources.dll: File '/Users/rolf/Library/Caches/Xamarin/mtbs/builds/fsharp/0a37d198e93da924afce6d66d7832fe80a3eb34fcfd38a4c15ff33390117d5a8/C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/es/FSharp.Core.resources.dll' not found.
  C:\...\targets\Xamarin.Shared.Sdk.targets(739,3): error : ILStrip failed for C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/pt-BR/FSharp.Core.resources.dll: File '/Users/rolf/Library/Caches/Xamarin/mtbs/builds/fsharp/0a37d198e93da924afce6d66d7832fe80a3eb34fcfd38a4c15ff33390117d5a8/C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/pt-BR/FSharp.Core.resources.dll' not found.
  C:\...\targets\Xamarin.Shared.Sdk.targets(739,3): error : ILStrip failed for C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/cs/FSharp.Core.resources.dll: File '/Users/rolf/Library/Caches/Xamarin/mtbs/builds/fsharp/0a37d198e93da924afce6d66d7832fe80a3eb34fcfd38a4c15ff33390117d5a8/C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/cs/FSharp.Core.resources.dll' not found.
  C:\...\targets\Xamarin.Shared.Sdk.targets(739,3): error : ILStrip failed for C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/ru/FSharp.Core.resources.dll: File '/Users/rolf/Library/Caches/Xamarin/mtbs/builds/fsharp/0a37d198e93da924afce6d66d7832fe80a3eb34fcfd38a4c15ff33390117d5a8/C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/ru/FSharp.Core.resources.dll' not found.
  C:\...\targets\Xamarin.Shared.Sdk.targets(739,3): error : ILStrip failed for C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/zh-Hans/FSharp.Core.resources.dll: File '/Users/rolf/Library/Caches/Xamarin/mtbs/builds/fsharp/0a37d198e93da924afce6d66d7832fe80a3eb34fcfd38a4c15ff33390117d5a8/C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/zh-Hans/FSharp.Core.resources.dll' not found.
  C:\...\targets\Xamarin.Shared.Sdk.targets(739,3): error : ILStrip failed for C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/pl/FSharp.Core.resources.dll: File '/Users/rolf/Library/Caches/Xamarin/mtbs/builds/fsharp/0a37d198e93da924afce6d66d7832fe80a3eb34fcfd38a4c15ff33390117d5a8/C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/pl/FSharp.Core.resources.dll' not found.
  C:\...\targets\Xamarin.Shared.Sdk.targets(739,3): error : ILStrip failed for C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/ja/FSharp.Core.resources.dll: File '/Users/rolf/Library/Caches/Xamarin/mtbs/builds/fsharp/0a37d198e93da924afce6d66d7832fe80a3eb34fcfd38a4c15ff33390117d5a8/C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/ja/FSharp.Core.resources.dll' not found.
  C:\...\targets\Xamarin.Shared.Sdk.targets(739,3): error : ILStrip failed for C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/fr/FSharp.Core.resources.dll: File '/Users/rolf/Library/Caches/Xamarin/mtbs/builds/fsharp/0a37d198e93da924afce6d66d7832fe80a3eb34fcfd38a4c15ff33390117d5a8/C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/fr/FSharp.Core.resources.dll' not found.
  C:\...\targets\Xamarin.Shared.Sdk.targets(739,3): error : ILStrip failed for C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/de/FSharp.Core.resources.dll: File '/Users/rolf/Library/Caches/Xamarin/mtbs/builds/fsharp/0a37d198e93da924afce6d66d7832fe80a3eb34fcfd38a4c15ff33390117d5a8/C:/Users/rolf/.nuget/packages/fsharp.core/6.0.4-beta.22178.3/lib/netstandard2.1/de/FSharp.Core.resources.dll' not found.

Workaround:

<PropertyGroup>
    <EnableAssemblyILStripping>false</EnableAssemblyILStripping>
</PropertyGroup>
@rolfbjarne rolfbjarne added bug If an issue is a bug or a pull request a bug fix dotnet An issue or pull request related to .NET (6) labels Apr 28, 2022
@rolfbjarne rolfbjarne added this to the .NET 7 milestone Apr 28, 2022
@rolfbjarne rolfbjarne modified the milestones: .NET 7, .NET 8 Aug 26, 2022
@BioTurboNick
Copy link

BioTurboNick commented Jan 8, 2023

Seems to be the same issue as dotnet/maui#12296 ; it's not just F#

So all localized iOS projects are blocked? (though trying the workaround) The workaround works!

@rolfbjarne
Copy link
Member Author

So all localized iOS projects are blocked?

Yes, that might be the case.

We'll fix this for .NET 8 (and potentially a .NET 7 service release, depending on when it's fixed and the actual fix).

@divil5000
Copy link

We are blocked by this issue too, aside from the workaround. We have just ported from Xamarin to .net iOS (no forms/maui) and simply could not get release builds on a device to have all their resources left intact by the build process. Rolf's workaround to disable assembly IL stripping works, but this seems like a fairly major issue.

Are all projects that use localisation broken on netX.0-ios?

rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Jun 28, 2023
Any assembly that's not already on the Mac must be copied there, so do that.
We detect if an assembly exist on the Mac by checking the file size of the
file on Windows: a 0-length file is an output file from an assembly that exist
on the Mac, otherwise it doesn't and must be copied.

Fixes xamarin#17009.
Fixes xamarin#14841.
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1817898.
rolfbjarne added a commit that referenced this issue Jun 29, 2023
Any assembly that's not already on the Mac must be copied there, so do that.
We detect if an assembly exist on the Mac by checking the file size of the
file on Windows: a 0-length file is an output file from an assembly that exist
on the Mac, otherwise it doesn't and must be copied.

Fixes #17009.
Fixes #14841.
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1817898.
rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Jun 29, 2023
… Windows.

Any assembly that's not already on the Mac must be copied there, so do that.
We detect if an assembly exist on the Mac by checking the file size of the
file on Windows: a 0-length file is an output file from an assembly that exist
on the Mac, otherwise it doesn't and must be copied.

Fixes xamarin#17009.
Fixes xamarin#14841.
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1817898.

Backport of xamarin#18508.
dalexsoto pushed a commit that referenced this issue Jun 30, 2023
… Windows. (#18511)

Any assembly that's not already on the Mac must be copied there, so do
that.
We detect if an assembly exist on the Mac by checking the file size of
the
file on Windows: a 0-length file is an output file from an assembly that
exist
on the Mac, otherwise it doesn't and must be copied.

Fixes #17009.
Fixes #14841.
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1817898.

Backport of #18508.
vs-mobiletools-engineering-service2 pushed a commit to vs-mobiletools-engineering-service2/xamarin-macios that referenced this issue Jun 30, 2023
Any assembly that's not already on the Mac must be copied there, so do that.
We detect if an assembly exist on the Mac by checking the file size of the
file on Windows: a 0-length file is an output file from an assembly that exist
on the Mac, otherwise it doesn't and must be copied.

Fixes xamarin#17009.
Fixes xamarin#14841.
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1817898.
@ghost ghost locked as resolved and limited conversation to collaborators Jul 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug If an issue is a bug or a pull request a bug fix dotnet An issue or pull request related to .NET (6) windows-only The issue only occur on Windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants