Odd result with IKVM 8.7 preview: code builds (on Windows for AnyCPU) but partly fails to run on Windows #429
Replies: 15 comments 9 replies
-
So the error is this: IKVM.Runtime.InternalException: Could not load libjvm. The program output has the appropriate ikvm/ subdirectory with bin/ and the jvm native library? |
Beta Was this translation helpful? Give feedback.
-
For the Query project, the Release bin has
the debug build has
Are these directories the ones you are asking about? |
Beta Was this translation helpful? Give feedback.
-
Later this evening I will try on another Windows machine whether I can reproduce it, if yes, I will push it to a public repository on Github, perhaps also later this evening or during the weekend, at least. |
Beta Was this translation helpful? Give feedback.
-
I have now tried to reproduce the problem on another Windows PC but somehow here I can't even build the Java IKVM.NET.Sdk project, it fails with
At least that is something I have encountered before, pulling a project that builds on one system fails to build on another, where it seems some part of IKVM is not (yet?) installed. I will wait this evening to see whether some improvement happens although I have given it a least an hour to pull all stuff. I will check tomorrow on the other PC where the solution builds and some projects run and fail whether I can find out more. |
Beta Was this translation helpful? Give feedback.
-
It did restore it, sorry, I didn't post that part of the messages:
|
Beta Was this translation helpful? Give feedback.
-
I have added the license files to the repo and made it public, the IKVM 8.7 preview exposing the problem that debug and release building works but that release builds on running crash on Windows is in https://github.com/martin-honnen/SaxonHE10Net/tree/IKVM87. On the second machine where I finally managed to reproduce the original problem (i.e. managed to build the projects without running into
Running the Query.dll, the Transform.dll works fine with dotnet for both Debug and Release with Ubuntu Linux 22 WSL. I hope you can figure what is wrong or tell what I have done wrong. |
Beta Was this translation helpful? Give feedback.
-
To add to my confusion, I have now managed to build (using dotnet command line and only for .NET 6) the whole project in Debug and Release configuration on a third Windows 11 system but here all three exes (Transform.exe, Query.exe, Gizmo.exe) run (now?) fine both from the Debug and the Release builds. I don't know why I get working builds on one machine and failing (Release) builds on another. |
Beta Was this translation helpful? Give feedback.
-
So I think I figured out the pattern at least. Package restore simply does not work from inside Visual Studio. It works fine from the command line. But not from inside VS. You can do it from the command line. And then if you open the same project in VS, it zeros it out. Still working on figuring out why though. |
Beta Was this translation helpful? Give feedback.
-
Stick this in your project file:
|
Beta Was this translation helpful? Give feedback.
-
In which project file do you want me to stick |
Beta Was this translation helpful? Give feedback.
-
I have added that in https://github.com/martin-honnen/SaxonHE10Net/blob/IKVM87/SaxonHE10Java/SaxonHE10Java.msbuildproj but I still get the same failure/behaviour of Debug and Build configuration working to build the projects but running on Debug works while running on Release fails:
|
Beta Was this translation helpful? Give feedback.
-
So, I can't reproduce your error with being unable to run the executables. In each case, Debug and Release, they execute most of the way. But, since I don't have whatever stylesheet you're using, it's not like I can watch them all the way through. Can you ensure each project is cleaned and rebuilt? |
Beta Was this translation helpful? Give feedback.
-
It doesn't seem to depend on feeding a stylesheet or query, if the crash occurs it is the same whether you just use no arguments or use Interesting that you can't reproduce the error, but as the various message of me show I have kind of different results on different machines, it started on one machine where Transform.exe fails with both Debug and Release builds while Query.exe works with Debug but not Release; then on a second machine I got all Debug exe to work (Query, Transform, Gizmo) but all Release exes fail, and yesterday on yet another machine I managed to get all three exes to work in Debug and Release configuration. All Windows 11 systems and I always do a clean before building. On the machine were yesterday both Debug and Release builds worked under Windows I had restricted the target framework to .NET 6.0 instead of using a list of target frameworks but trying the same today here on the other machines doesn't change anything. I will see whether I can find the differences that cause the different behaviour on different machines. Or use the one machine where all Release builds work to build the NuGet packages and hope they work for others as well... |
Beta Was this translation helpful? Give feedback.
-
It seems doing a |
Beta Was this translation helpful? Give feedback.
-
Thanks, @plykkegaard, for letting me know that you had the same problem. Sometimes IT seems to give us weird experiences. |
Beta Was this translation helpful? Give feedback.
-
I have tried to use IKVM.NET.Sdk/8.7.0-pre.1 and IKVM to compile the existing Saxon HE .NET 10.9 code base (consisting of mostly Java code plus some .NET specific APIs) for .NET 6.0, building on Windows with target Any CPU.
On trying to run the code I get some odd results, my WSL Ubuntu Linux runs both the debug and release dlls of Transform and Query without any problems; on Windows the debug and release build of Transform gives an exception, for Query even more oddly it now appears as if the debug build runs fine but the release build gives a similar exception to the one I get for Transform.
Here are some stack traces:
Query debug runs fine:
Query release crashes:
Transform debug crashes:
Transform release crashes:
The
IKVM.Runtime.Accessors.Java.Lang.SystemAccessor.InvokeInitializeSystemClass()
makes me wonder whether someSystem.out/err/in
problem is behind that but it is just confusing that the Query debug release build runs fine while the Transform debug and release builds crash the same as the Query release build.Any ideas on what could be wrong?
Beta Was this translation helpful? Give feedback.
All reactions