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

Export Error with .NET 9 on iOS #100123

Open
atlasapplications opened this issue Dec 6, 2024 · 4 comments · May be fixed by #100187
Open

Export Error with .NET 9 on iOS #100123

atlasapplications opened this issue Dec 6, 2024 · 4 comments · May be fixed by #100187

Comments

@atlasapplications
Copy link

Tested versions

Reproducible in 4.3.stable.mono

System information

macOS Sequoia (15.1.1) - Mac Mini (2018)

Issue description

With .NET 9 out of RC I tested for any errors and there is an error that prevents exporting specifically for iOS.

MSB3030: Could not copy the file "/Users/[username]/.nuget/packages/microsoft.netcore.app.runtime.nativeaot.ios-arm64/9.0.0/runtimes/ios-arm64/native/icudt.dat" because it was not found. /Users/[username]/.nuget/packages/godot.net.sdk/4.3.0/Sdk/iOSNativeAOT.targets(18,5)

Checking this directory shows that indeed this file no longer exists and that the entire structure is different now. A quick search shows that icudt.dat is not longer bundled in .NET 9 as outlined here.

Steps to reproduce

  • Create C# enabled Godot project
  • Use .NET 9
  • Export for iOS

Minimal reproduction project (MRP)

N/A

@raulsntos
Copy link
Member

I don't know why we're copying the ICU file, I assume it's needed in .NET 8 which is the minimum version required for exporting to iOS and we wouldn't want to break that.

You didn't include an MRP so I'm not sure if you have changed anything in your .csproj. I'm not sure that the ICU file is always missing. We could copy it only if it exists in the expected path:

<Copy SourceFiles="%(ResolvedRuntimePack.PackageDirectory)/runtimes/$(RuntimeIdentifier)/native/icudt.dat" DestinationFolder="$(PublishDir)"/>

As a workaround for now, disabling "hybrid globalization" may still produce the ICU file. Try adding this to your .csproj:

<HybridGlobalization>false</HybridGlobalization>

@atlasapplications
Copy link
Author

My .csproj file is similar to what's generated by default but with the Native AOT bits, so I don't think anything custom should be occurring.

I tested the proposed workaround but unfortunately the file isn't being generated still, so the export still fails.

I'm also puzzled why this file is copied just for iOS as I've tested .NET 8 and .NET 9 with Native AOT enabled on other platforms and it doesn't seem to make a difference that it's not copied there. Maybe on other platforms my code didn't require the presence of that file or the export process is different and it is actually being included, I'm not sure.

@atlasapplications
Copy link
Author

@raulsntos

Since .NET seems to be going towards leveraging the target platform's native API for localization info, would you recommend that the export process change by checking for icudt.dat, then icudt_hybrid.dat (since that is the name of the new slimmed down file for hybrid ICU in .NET 9), and if they're not found, simply skip past and proceed with a successful export?

@raulsntos
Copy link
Member

I'm also puzzled why this file is copied just for iOS as I've tested .NET 8 and .NET 9 with Native AOT enabled on other platforms and it doesn't seem to make a difference that it's not copied there.

Exporting to iOS is very different from other platforms, we need to use Xcode to create the final binaries. I assume we need to do this so Xcode is able to include the file, but I'm not very familiar with iOS exports and if you can confirm we don't need to do this then we can stop doing it.

Since .NET seems to be going towards leveraging the target platform's native API for localization info, would you recommend that the export process change by checking for icudt.dat, then icudt_hybrid.dat (since that is the name of the new slimmed down file for hybrid ICU in .NET 9), and if they're not found, simply skip past and proceed with a successful export?

That works for me too. If you can confirm that doing this doesn't break the resulting export.

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