ikvmnet / ikvm

A Java Virtual Machine and Bytecode-to-IL Converter for .NET
Other
1.15k stars 109 forks source link

Internal compiler error when compiling Tika 2.9.2 #514

Closed SimonCahill closed 2 months ago

SimonCahill commented 2 months ago

In my project, I use Apache Tika (specifically a modified branch of tikaondotnet), and after recently having upgraded to version 2.9.2 (after Apache killed the link), I've received the following compiler error:

/home/simon/.nuget/packages/ikvm/8.7.6/buildTransitive/IKVM.Tasks.targets(31,9): warning :  [/home/simon/source/Hermod/submodules/tikaondotnet/src/TikaOnDotNet.Core/TikaOnDotnet.Core.csproj]
/home/simon/.nuget/packages/ikvm/8.7.6/buildTransitive/IKVM.Tasks.targets(31,9): warning : *** INTERNAL COMPILER ERROR *** [/home/simon/source/Hermod/submodules/tikaondotnet/src/TikaOnDotNet.Core/TikaOnDotnet.Core.csproj]
/home/simon/.nuget/packages/ikvm/8.7.6/buildTransitive/IKVM.Tasks.targets(31,9): warning :  [/home/simon/source/Hermod/submodules/tikaondotnet/src/TikaOnDotNet.Core/TikaOnDotnet.Core.csproj]
/home/simon/.nuget/packages/ikvm/8.7.6/buildTransitive/IKVM.Tasks.targets(31,9): warning : PLEASE FILE A BUG REPORT FOR IKVM.NET WHEN YOU SEE THIS MESSAGE [/home/simon/source/Hermod/submodules/tikaondotnet/src/TikaOnDotNet.Core/TikaOnDotnet.Core.csproj]
/home/simon/.nuget/packages/ikvm/8.7.6/buildTransitive/IKVM.Tasks.targets(31,9): warning :  [/home/simon/source/Hermod/submodules/tikaondotnet/src/TikaOnDotNet.Core/TikaOnDotnet.Core.csproj]
/home/simon/.nuget/packages/ikvm/8.7.6/buildTransitive/IKVM.Tasks.targets(31,9): warning : IKVM.Tools.Importer, Version=8.7.6.0, Culture=neutral, PublicKeyToken=13235d27fcbfff58 [/home/simon/source/Hermod/submodules/tikaondotnet/src/TikaOnDotNet.Core/TikaOnDotnet.Core.csproj]
/home/simon/.nuget/packages/ikvm/8.7.6/buildTransitive/IKVM.Tasks.targets(31,9): warning : /home/simon/.nuget/packages/ikvm.msbuild.tools.runtime.linux-x64/8.7.6/ikvmc/net6.0/linux-x64/ [/home/simon/source/Hermod/submodules/tikaondotnet/src/TikaOnDotNet.Core/TikaOnDotnet.Core.csproj]
/home/simon/.nuget/packages/ikvm/8.7.6/buildTransitive/IKVM.Tasks.targets(31,9): warning : 6.0.28 64-bit [/home/simon/source/Hermod/submodules/tikaondotnet/src/TikaOnDotNet.Core/TikaOnDotnet.Core.csproj]
/home/simon/.nuget/packages/ikvm/8.7.6/buildTransitive/IKVM.Tasks.targets(31,9): warning :  [/home/simon/source/Hermod/submodules/tikaondotnet/src/TikaOnDotNet.Core/TikaOnDotnet.Core.csproj]
/home/simon/.nuget/packages/ikvm/8.7.6/buildTransitive/IKVM.Tasks.targets(31,9): warning : IKVM.ByteCode.UnsupportedClassVersionException: Unsupported class version 65.0. [/home/simon/source/Hermod/submodules/tikaondotnet/src/TikaOnDotNet.Core/TikaOnDotnet.Core.csproj]
/home/simon/.nuget/packages/ikvm/8.7.6/buildTransitive/IKVM.Tasks.targets(31,9): warning :    at IKVM.ByteCode.Parsing.ClassRecord.TryRead(ClassFormatReader& reader, ClassRecord& clazz) in /_/src/IKVM.ByteCode/Parsing/ClassRecord.cs:line 30 [/home/simon/source/Hermod/submodules/tikaondotnet/src/TikaOnDotNet.Core/TikaOnDotnet.Core.csproj]
/home/simon/.nuget/packages/ikvm/8.7.6/buildTransitive/IKVM.Tasks.targets(31,9): warning :    at IKVM.ByteCode.Reading.ClassReader.TryRead(ClassFormatReader& reader, ClassReader& clazz) in /_/src/IKVM.ByteCode/Reading/ClassReader.cs:line 78 [/home/simon/source/Hermod/submodules/tikaondotnet/src/TikaOnDotNet.Core/TikaOnDotnet.Core.csproj]
/home/simon/.nuget/packages/ikvm/8.7.6/buildTransitive/IKVM.Tasks.targets(31,9): warning :    at IKVM.ByteCode.Reading.ClassReader.TryRead(ReadOnlySequence`1& buffer, ClassReader& clazz) in /_/src/IKVM.ByteCode/Reading/ClassReader.cs:line 51 [/home/simon/source/Hermod/submodules/tikaondotnet/src/TikaOnDotNet.Core/TikaOnDotnet.Core.csproj]
/home/simon/.nuget/packages/ikvm/8.7.6/buildTransitive/IKVM.Tasks.targets(31,9): warning :    at IKVM.ByteCode.Reading.ClassReader.Read(ReadOnlyMemory`1 buffer) in /_/src/IKVM.ByteCode/Reading/ClassReader.cs:line 40 [/home/simon/source/Hermod/submodules/tikaondotnet/src/TikaOnDotNet.Core/TikaOnDotnet.Core.csproj]
/home/simon/.nuget/packages/ikvm/8.7.6/buildTransitive/IKVM.Tasks.targets(31,9): warning :    at IKVM.Tools.Importer.IkvmImporterInternal.IsExcludedOrStubLegacy(RuntimeContext context, StaticCompiler compiler, CompilerOptions options, ZipArchiveEntry ze, Byte[] data) in /_/src/IKVM.Tools.Importer/IkvmImporterInternal.cs:line 1220 [/home/simon/source/Hermod/submodules/tikaondotnet/src/TikaOnDotNet.Core/TikaOnDotnet.Core.csproj]
/home/simon/.nuget/packages/ikvm/8.7.6/buildTransitive/IKVM.Tasks.targets(31,9): warning :    at IKVM.Tools.Importer.IkvmImporterInternal.ProcessZipFile(RuntimeContext context, StaticCompiler compiler, CompilerOptions options, String file, Predicate`1 filter) in /_/src/IKVM.Tools.Importer/IkvmImporterInternal.cs:line 1279 [/home/simon/source/Hermod/submodules/tikaondotnet/src/TikaOnDotNet.Core/TikaOnDotnet.Core.csproj]
/home/simon/.nuget/packages/ikvm/8.7.6/buildTransitive/IKVM.Tasks.targets(31,9): warning :    at IKVM.Tools.Importer.IkvmImporterInternal.ProcessFile(RuntimeContext context, StaticCompiler compiler, CompilerOptions options, DirectoryInfo baseDir, String file) in /_/src/IKVM.Tools.Importer/IkvmImporterInternal.cs:line 1312 [/home/simon/source/Hermod/submodules/tikaondotnet/src/TikaOnDotNet.Core/TikaOnDotnet.Core.csproj]
/home/simon/.nuget/packages/ikvm/8.7.6/buildTransitive/IKVM.Tasks.targets(31,9): warning :    at IKVM.Tools.Importer.IkvmImporterInternal.ReadFiles(RuntimeContext context, StaticCompiler compiler, CompilerOptions options, List`1 fileNames) in /_/src/IKVM.Tools.Importer/IkvmImporterInternal.cs:line 1009 [/home/simon/source/Hermod/submodules/tikaondotnet/src/TikaOnDotNet.Core/TikaOnDotnet.Core.csproj]
/home/simon/.nuget/packages/ikvm/8.7.6/buildTransitive/IKVM.Tasks.targets(31,9): warning :    at IKVM.Tools.Importer.IkvmImporterInternal.ContinueParseCommandLine(RuntimeContext context, StaticCompiler compiler, IEnumerator`1 arglist, List`1 targets, CompilerOptions options) in /_/src/IKVM.Tools.Importer/IkvmImporterInternal.cs:line 905 [/home/simon/source/Hermod/submodules/tikaondotnet/src/TikaOnDotNet.Core/TikaOnDotnet.Core.csproj]
/home/simon/.nuget/packages/ikvm/8.7.6/buildTransitive/IKVM.Tasks.targets(31,9): warning :    at IKVM.Tools.Importer.IkvmImporterInternal.Compile(String[] args) in /_/src/IKVM.Tools.Importer/IkvmImporterInternal.cs:line 175 [/home/simon/source/Hermod/submodules/tikaondotnet/src/TikaOnDotNet.Core/TikaOnDotnet.Core.csproj]
/home/simon/.nuget/packages/ikvm/8.7.6/buildTransitive/IKVM.Tasks.targets(31,9): warning :    at IKVM.Tools.Importer.IkvmImporterInternal.Execute(String[] args) in /_/src/IKVM.Tools.Importer/IkvmImporterInternal.cs:line 111 [/home/simon/source/Hermod/submodules/tikaondotnet/src/TikaOnDotNet.Core/TikaOnDotnet.Core.csproj]
/home/simon/.nuget/packages/ikvm/8.7.6/buildTransitive/IKVM.Tasks.targets(31,9): error MSB4181: The "IkvmCompiler" task returned false but did not log an error. [/home/simon/source/Hermod/submodules/tikaondotnet/src/TikaOnDotNet.Core/TikaOnDotnet.Core.csproj]
    21 Warning(s)
    1 Error(s)

What springs out is of course:

IKVM.ByteCode.UnsupportedClassVersionException: Unsupported class version 65.0.
at IKVM.ByteCode.Parsing.ClassRecord.TryRead(ClassFormatReader& reader, ClassRecord& clazz) in /_/src/IKVM.ByteCode/Parsing/ClassRecord.cs:line 30
at IKVM.ByteCode.Reading.ClassReader.TryRead(ClassFormatReader& reader, ClassReader& clazz) in /_/src/IKVM.ByteCode/Reading/ClassReader.cs:line 78
at IKVM.ByteCode.Reading.ClassReader.Read(ReadOnlyMemory`1 buffer) in /_/src/IKVM.ByteCode/Reading/ClassReader.cs:line 40
at IKVM.Tools.Importer.IkvmImporterInternal.IsExcludedOrStubLegacy(RuntimeContext context, StaticCompiler compiler, CompilerOptions options, ZipArchiveEntry ze, Byte[] data) in /_/src/IKVM.Tools.Importer/IkvmImporterInternal.cs:line 1220
at IKVM.Tools.Importer.IkvmImporterInternal.ProcessZipFile(RuntimeContext context, StaticCompiler compiler, CompilerOptions options, String file, Predicate`1 filter) in /_/src/IKVM.Tools.Importer/IkvmImporterInternal.cs:line 1279
at IKVM.Tools.Importer.IkvmImporterInternal.ProcessFile(RuntimeContext context, StaticCompiler compiler, CompilerOptions options, DirectoryInfo baseDir, String file) in /_/src/IKVM.Tools.Importer/IkvmImporterInternal.cs:line 1312
at IKVM.Tools.Importer.IkvmImporterInternal.ReadFiles(RuntimeContext context, StaticCompiler compiler, CompilerOptions options, List`1 fileNames) in /_/src/IKVM.Tools.Importer/IkvmImporterInternal.cs:line 1009
at IKVM.Tools.Importer.IkvmImporterInternal.ContinueParseCommandLine(RuntimeContext context, StaticCompiler compiler, IEnumerator`1 arglist, List`1 targets, CompilerOptions options) in /_/src/IKVM.Tools.Importer/IkvmImporterInternal.cs:line 905
at IKVM.Tools.Importer.IkvmImporterInternal.Compile(String[] args) in /_/src/IKVM.Tools.Importer/IkvmImporterInternal.cs:line 175
at IKVM.Tools.Importer.IkvmImporterInternal.Execute(String[] args) in /_/src/IKVM.Tools.Importer/IkvmImporterInternal.cs:line 111

And the fact that IKVM fails without logging an error, instead outputting a warning.

Of course my issue is (most likely) fixable, by finding an archive link to a previous version of Tika, so there's not much to do there. I do, however feel that this issue should be addressed and IKVM should output the error as an error, and not as a warning.

For clarity: This issue occurs with both IKVM versions 8.7.5 and 8.7.6.

Thanks.

wasabii commented 2 months ago

Well, whatever version of Tika you're trying to use has class files generated for a JVM that exceed those supported by our class file parser. We only support up to Java 8 presently, and thus any class files targeting higher versions than Java 8 will end up with this warning.

wasabii commented 2 months ago

As to the warning: this is a warning because it isn't atypical to come across jar files that are composed of .class files with different versions. ikvmc tries to skip those that it cannot handle.

SimonCahill commented 2 months ago

The main issue here isn't Tika, it's the fact that IKVM outputs this as a series of warnings and not errors.

I gathered as much that IKVM doesn't support the Java version (hence the output message).

And the fact that IKVM fails without logging an error, instead outputting a warning. I do, however feel that this issue should be addressed and IKVM should output the error as an error, and not as a warning.