Description
Description
We use MONO_PATH to point to the directory where all the assemblies are for the AOT compiler.
Unfortunately, the Mono allows for multiple paths in MONO_PATH, splitting them by colon:
runtime/src/mono/mono/metadata/assembly.c
Line 137 in 34b6db9
this means that we can't use the AOT compiler for a path with a colon in it.
Now why would that ever happen?
It happens when building remotely from Windows, and [Intermediate]OutputPath is set to a full (Windows) path. In that case, all the assemblies end up in a directory with a colon in it on the Mac: dotnet/macios#14904.
This wasn't very common, because [Intermediate]OutputPath used to be relative paths. However, with the new artifacts output path in .NET 8, [Intermediate]OutputPath are both absolute paths.
Reproduction Steps
mkdir colonexample && cd colonexample
dotnet new ios
dotnet build /p:RuntimeIdentifier=ios-arm64 /p:IntermediateOutputPath=$PWD/l:i:b/ /bl
[...]
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/16.4.7090/targets/Xamarin.Shared.Sdk.targets(1045,3): error : Failed to AOT compile System.Runtime.dll, the AOT compiler exited with code 134 [/Users/rolf/test/dotnet/colonexample/colonexample.csproj]
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/16.4.7090/targets/Xamarin.Shared.Sdk.targets(1045,3): error : Failed to AOT compile System.Runtime.InteropServices.dll, the AOT compiler exited with code 134 [/Users/rolf/test/dotnet/colonexample/colonexample.csproj]
/usr/local/share/dotnet/packs/Microsoft.iOS.Sdk/16.4.7090/targets/Xamarin.Shared.Sdk.targets(1045,3): error : Failed to AOT compile colonexample.dll, the AOT compiler exited with code 134 [/Users/rolf/test/dotnet/colonexample/colonexample.csproj]
[...]
Expected behavior
No crash.
Actual behavior
Crash.
Binlog:
msbuild.binlog.zip
Regression?
No, but importance has increased due to unrelated changes making the scenario more frequent.
Known Workarounds
No response
Configuration
$ $ dotnet --info
.NET SDK:
Version: 7.0.306
Commit: f500069cb7
Runtime Environment:
OS Name: Mac OS X
OS Version: 13.5
OS Platform: Darwin
RID: osx.13-arm64
Base Path: /usr/local/share/dotnet/sdk/7.0.306/
Host:
Version: 7.0.9
Architecture: arm64
Commit: 8e9a17b221
.NET SDKs installed:
7.0.306 [/usr/local/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 7.0.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 7.0.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Other information
No response