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

ikvmc macOS: Core library not found. #626

Open
Lancelotbronner opened this issue Nov 27, 2024 · 5 comments
Open

ikvmc macOS: Core library not found. #626

Lancelotbronner opened this issue Nov 27, 2024 · 5 comments

Comments

@Lancelotbronner
Copy link

I'm trying to convert a jar to an assembly and, so far, I'm finding the process very difficult.

I'm doing this because the dynamic IkvmReference no longer work as of IKVM 8 on macOS because it uses dynamic code generation which isn't supported.

I haven't found any other docs than the ones at https://ikvm.org/ikvm which don't help with the troubleshooting.

I downloaded the latest tools from Github releases.

Here's my command:

ikvmc ../javaparser-core-3.26.2.jar -nostdlib -target:library -r:"IKVM-8/System.Runtime.dll"

And the resulting error:

IKVM.Tools.Importer (8.10.3+Branch.tags-8.10.3.Sha.d45bebd4fecc49548317667fe412663850b58910)
Copyright © 2024 Jeroen Frijters, Windward Studios, Jerome Haltom, Shad Storhaug

Core library not found. Make sure the appropriate reference assemblies for the target environment are included.

*** COMPILER ERROR ***

IKVM.Tools.Importer, Version=8.10.3.0, Culture=neutral, PublicKeyToken=13235d27fcbfff58
IKVM-8/
8.0.10 64-bit

System.Exception: Exception of type 'System.Exception' was thrown.
   at IKVM.Tools.Importer.StaticCompiler.Init(Boolean nonDeterministicOutput, DebugMode debug, IList`1 libpaths) in /_/src/IKVM.Tools.Importer/StaticCompiler.cs:line 72
   at IKVM.Tools.Importer.IkvmImporterInternal.Compile(String[] args) in /_/src/IKVM.Tools.Importer/IkvmImporterInternal.cs:line 179
   at IKVM.Tools.Importer.IkvmImporterInternal.Execute(String[] args) in /_/src/IKVM.Tools.Importer/IkvmImporterInternal.cs:line 113
@wasabii
Copy link
Contributor

wasabii commented Nov 27, 2024

I'm not sure in your reasoning here. Tons of people use IkvmReference on the newest Macs. I have unit tests. And a Mac.

The dynamic code restrictions are in Catalyst and iOS. Neither of which you build from.

@Lancelotbronner
Copy link
Author

My reasoning was I updated to net8 and the latest IKVM version and now the project always fails at runtime with a message about dynamic code generation being unavailable for the platform.

This is when compiling for macOS arm64 and running in a .NET 8 console app.

My reference was just the Include, nothing else. Is there something I should add? Are there known incompatibilities of IKVM with certain dotnet configurations?

I looked through the docs and couldn't find any counter-indications. Is there up-to-date documentation anywhere?

@wasabii
Copy link
Contributor

wasabii commented Nov 29, 2024

IKVM uses dynamic code generation at runtime. Nothing to do with whether you statically compile your specific assembly or not. So it does not support AOT.

But it will run as a normal .NET app on OSX just fine.

@Lancelotbronner
Copy link
Author

Ah, it was AOT, thank you very much!

Could that be mentioned in the official docs? I suggest also mentioning whether support is planned or not so people like me won't have to bother you with the question or issues with it!

@wasabii
Copy link
Contributor

wasabii commented Dec 2, 2024

Lots of things could be mentioned in the docs....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants