You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Insert description here.
`src/java-interop` support for building against MonoVM was broken
at some point, and is arguably still *wrong* because even now it's
using the legacy Mono header files, *not* the current MonoVM headers.
TODO: figure out how to fix that.
*For now*, fix `_CreateMonoInfoProps` so that
`bin/Build$(Configuration)/MonoInfo.props` is created, which in turn
allows `src/java-interop` ***on macOS and Linux*** to use the
mono headers and link against libmonosgen-2.0.dylib/etc.:
% nm src/java-interop/obj/Debug-net8.0/libjava-interop.dylib | grep _mono
…
U _mono_class_from_mono_type
Currently unknown: how do we *use* `libjava-interop.dylib`?
The 'obvious' way is to build a project with `-p:UseMonoRuntime=true`.
That fails under .NET 9:
error NU1102: Unable to find package Microsoft.NETCore.App.Runtime.Mono.osx-x64 with version (= 9.0.2)
Try to re-add support for building with .NET 8, by overriding
`$(DotNetTargetFramework)`, which *does* build with `-p:UseMonoRuntime=true`:
```
dotnet build -c Release -t:Prepare -p:DotNetTargetFramework=net8.0 *.sln
dotnet build -c Release -p:DotNetTargetFramework=net8.0 *.sln
dotnet publish --self-contained -p:UseMonoRuntime=true -p:DotNetTargetFramework=net8.0 -p:UseAppHost=true -p:ErrorOnDuplicatePublishOutputFiles=false -r osx-x64 samples/Hello-Java.Base/Hello-Java.Base.csproj
cp samples/Hello-Java.Base/bin/Release/Hello-Java.Base.jar samples/Hello-Java.Base/bin/Release/osx-x64/publish
samples/Hello-Java.Base/bin/Release/osx-x64/publish/Hello-Java.Base
```
Update `JreRuntime.cs` to check for the existence of `Mono.RuntimeStructs`,
as `Mono.Runtime` no longer exists.
I don't yet know if this uses the GC bridge, though.
0 commit comments