Closed HackPoint closed 8 months ago
Use IKVM.Maven.SDK.
Otherwise, you will need to include, in IkvmReference.References, the full reference hierarchy, so that IKVM can build them in the proper order, depending on each other.
@wasabii I do use it, please check the CalciteIKVM.zip
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="IKVM.Maven.Sdk" Version="1.6.0" />
</ItemGroup>
<ItemGroup>
<MavenReference Include="org.apache.calcite:calcite-core" Version="1.34.0" />
</ItemGroup>`
Wait.....
So everythign EXCEPT that one line works?
You got the wrong package name, dude.
RelTraitDef lives under org.apache.calcite.plan
@wasabii the calcite.plan is part of the Calcite Core jar.
The issue we are seeing is RelTraitSet
is not compiled into a class. places where RelTraitSet
is taken as a parameter have been replaced with object
. We see this with a couple of other classes as well, but RelTraitSet
is the easiest one to show in an example.
Are there any knobs or logging levels that can be enabled to track down why this class is not being generated when we try to pull it into .NET?
I added a using statement to your sample project, referencing the right namespace, and it worked.
That's interesting, for me defining the namespace or using the fully qualified class name (org.apache.calcite.plan.RelTraitSet
) doesn't compile.
I'm usingIKVM.Maven.Sdk
1.6.0
on an Apple Silicon based Mac. Could that be the issue? Which version were you able to compile with out of curiosity?
This is wha I see in my local project for reference.
Wait a sec. The file I received from you had RelTraitRef used in Class1. And that was in the plan namespace.
Changed it to Set, and it now fails. I see what's going on.
During compilation, a number of errors are emitted:
ERROR: warning IKVMC0101: Unable to compile class "org.apache.calcite.plan.RelTraitSet"
ERROR: (class format error "Unspecified class file format error")
This is an error parsing the RelTraitSet.class file. And I've traced it down to an actual bug. I'm pretty sure this bug isn't new to 8.7.0. Where it should have read a single byte, it was reading two bytes. As defined by the spec: https://docs.oracle.com/javase/specs/jvms/se8/html/jvms-4.html#jvms-4.7.20; the size of type_argument_index is 1 byte. However, the IKVM.ByteCode parsing code was attempting to read two bytes (a short).
This will require a hotfix. Which I'll get out in a couple hours.
Apologizes for the confusion! Thank you so much for looking into this and for the quick response!!
@wasabii which version in nuget should be with the hotfix?
@HackPoint
https://github.com/ikvmnet/ikvm/pkgs/nuget/IKVM/142804693
In GitHub nuget repo. I haven't run it through any manual tests yet.
Confirmed, it does solve the issue with RelTraitSet.
Thank you so much you are awesome!
Just bring to your knowledge: After you full release this package I believe it would be fixed.
0>Microsoft.NET.RuntimeIdentifierInference.targets(314,5): Message NETSDK1057 : You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy 0>CalciteIKVM.csproj: Warning NU1603 : CalciteIKVM depends on IKVM (>= 8.7.1-pre.3) but IKVM 8.7.1-pre.3 was not found. An approximate best match of IKVM 8.7.1 was resolved. CalciteIKVM -> CalciteIKVM/bin/Debug/net6.0/CalciteIKVM.dll
@wasabii I'm sorry I am disturbing you
After adding this:
<ItemGroup>
<PackageReference Include="IKVM" Version="8.7.1-pre.3" />
<PackageReference Include="IKVM.Maven.Sdk" Version="1.6.1" />
</ItemGroup>
<ItemGroup>
<MavenReference Include="org.apache.calcite:calcite-core" Version="1.34.0" />
<MavenReference Include="org.apache.calcite.avatica:avatica-server" Version="1.23.0" />
<MavenReference Include="org.apache.calcite:calcite-csv" Version="1.34.0" /> <--- this is the refence that breaks
</ItemGroup>
Error:
0>IKVM.Maven.Sdk.targets(96,9): Error : DependencyResolutionException: Could not find artifact javax.jms:jms:jar:1.1 in central (https://repo1.maven.org/maven2/), try downloading from http://java.sun.com/products/jms/docs.html at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(RepositorySystemSession session, DependencyRequest request) at IKVM.Maven.Sdk.Tasks.MavenReferenceItemResolve.ResolveCompileDependencyGraph(IkvmMavenEnvironment maven, RepositorySystemSession session, IList
1 repositories, IList1 items) in C:\w\ikvm-maven\src\IKVM.Maven.Sdk.Tasks\MavenReferenceItemResolve.cs:line 254 at IKVM.Maven.Sdk.Tasks.MavenReferenceItemResolve.ResolveReferences(IList
1 repositories, IList1 items) in C:\w\ikvm-maven\src\IKVM.Maven.Sdk.Tasks\MavenReferenceItemResolve.cs:line 193 at IKVM.Maven.Sdk.Tasks.MavenReferenceItemResolve.Execute() in C:\w\ikvm-maven\src\IKVM.Maven.Sdk.Tasks\MavenReferenceItemResolve.cs:line 151 ArtifactResolutionException: Could not find artifact javax.jms:jms:jar:1.1 in central (https://repo1.maven.org/maven2/), try downloading from http://java.sun.com/products/jms/docs.html at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(RepositorySystemSession session, Collection requests) at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(RepositorySystemSession session, DependencyRequest request) ArtifactNotFoundException: Could not find artifact javax.jms:jms:jar:1.1 in central (https://repo1.maven.org/maven2/), try downloading from http://java.sun.com/products/jms/docs.html
As a result all dependencies are being deleted ( aka not created )
Definately a new issue. Moving to ikvm-maven.
When I compile the code with apache.calcite.core.jar
Attaching two example project one is with java that is allowing to use calcite.core objects and .net which doesn't
CalciteIKVM.zip CalciteTest.zip
Another way that I've tryed to use the library:
`
This way if I compare to two assemblies![image](https://github.com/ikvmnet/ikvm/assets/6758579/ad2e2777-08d3-452a-b07e-660ffa17be4a)
Old:
New:
![image](https://github.com/ikvmnet/ikvm/assets/6758579/d98887ee-911d-4658-87db-bd1d113c335b)
The only difference is old and new IKVM.net
For some reason the resources are compiled different too: Old:
New:
![image](https://github.com/ikvmnet/ikvm/assets/6758579/4a69a857-de7b-44cc-b61b-ac3a0fe6ffbc)
Can you please check if it's possible that I made a mistake in configuration? Can you please assist?