Can not build sdlnatives
Opened this issue · 3 comments
Deleted user commented
[nix-shell:~/proj/Arc]$ gradle clean sdlnatives
> Task :arc-core:clean
> Task :backends:clean UP-TO-DATE
> Task :extensions:clean UP-TO-DATE
> Task :natives:clean UP-TO-DATE
> Task :backends:backend-android:clean UP-TO-DATE
> Task :backends:backend-headless:clean UP-TO-DATE
> Task :backends:backend-robovm:clean UP-TO-DATE
> Task :backends:backend-sdl:deleteJniFolder
> Task :backends:backend-sdl:clean
> Task :extensions:arcnet:clean UP-TO-DATE
> Task :extensions:box2d:deleteJniFolder UP-TO-DATE
> Task :extensions:box2d:clean UP-TO-DATE
> Task :extensions:freetype:deleteJniFolder UP-TO-DATE
> Task :extensions:freetype:clean UP-TO-DATE
> Task :extensions:fx:clean UP-TO-DATE
> Task :extensions:g3d:clean UP-TO-DATE
> Task :extensions:packer:clean UP-TO-DATE
> Task :extensions:recorder:clean UP-TO-DATE
> Task :natives:natives-android:clean UP-TO-DATE
> Task :natives:natives-box2d-android:clean UP-TO-DATE
> Task :natives:natives-box2d-desktop:clean UP-TO-DATE
> Task :natives:natives-box2d-ios:clean UP-TO-DATE
> Task :natives:natives-desktop:clean UP-TO-DATE
> Task :natives:natives-freetype-android:clean UP-TO-DATE
> Task :natives:natives-freetype-desktop:clean UP-TO-DATE
> Task :natives:natives-freetype-ios:clean UP-TO-DATE
> Task :natives:natives-ios:clean UP-TO-DATE
> Task :arc-core:compileJava
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
> Task :arc-core:processResources NO-SOURCE
> Task :arc-core:classes
> Task :arc-core:jar
> Task :backends:backend-sdl:compileJava
> Task :backends:backend-sdl:processResources
> Task :backends:backend-sdl:classes
> Task :backends:backend-sdl:compileTestJava
> Task :backends:backend-sdl:processTestResources NO-SOURCE
> Task :backends:backend-sdl:testClasses
> Task :backends:backend-sdl:sdlnatives FAILED
SDL version found: 2.0.12
Generating C/C++ for 'src/main/java/arc/backend/sdl/jni/SDL.java'...
Command: javac -classpath build/classes/java/main -d /tmp/gdx-jnigen2758102315610532263 -h jni src/main/java/arc/backend/sdl/jni/SDL.java
src/main/java/arc/backend/sdl/jni/SDL.java:3: error: package arc.util does not exist
import arc.util.*;
^
src/main/java/arc/backend/sdl/jni/SDL.java:24: error: cannot find symbol
if(OS.isWindows){
^
symbol: variable OS
location: class SDL
src/main/java/arc/backend/sdl/jni/SDL.java:24: error: illegal parenthesized expression
if(OS.isWindows){
^
src/main/java/arc/backend/sdl/jni/SDL.java:25: error: cannot find symbol
new SharedLibraryLoader(){
^
symbol: class SharedLibraryLoader
location: class SDL
src/main/java/arc/backend/sdl/jni/SDL.java:26: error: method does not override or implement a method from a supertype
@Override
^
src/main/java/arc/backend/sdl/jni/SDL.java:31: error: method does not override or implement a method from a supertype
@Override
^
src/main/java/arc/backend/sdl/jni/SDL.java:33: error: non-static variable super cannot be referenced from a static context
return super.readFile(OS.is64Bit ? "OpenAL.dll" : "OpenAL32.dll");
^
src/main/java/arc/backend/sdl/jni/SDL.java:33: error: cannot find symbol
return super.readFile(OS.is64Bit ? "OpenAL.dll" : "OpenAL32.dll");
^
symbol: method readFile(OS.is64Bit[...].dll")
src/main/java/arc/backend/sdl/jni/SDL.java:33: error: cannot find symbol
return super.readFile(OS.is64Bit ? "OpenAL.dll" : "OpenAL32.dll");
^
symbol: variable OS
src/main/java/arc/backend/sdl/jni/SDL.java:36: error: cannot find symbol
}else if(OS.isLinux){
^
symbol: variable OS
location: class SDL
src/main/java/arc/backend/sdl/jni/SDL.java:36: error: illegal parenthesized expression
}else if(OS.isLinux){
^
src/main/java/arc/backend/sdl/jni/SDL.java:37: error: cannot find symbol
new SharedLibraryLoader(){
^
symbol: class SharedLibraryLoader
location: class SDL
src/main/java/arc/backend/sdl/jni/SDL.java:38: error: method does not override or implement a method from a supertype
@Override public String mapLibraryName(String libraryName){ return "lib" +libraryName + ".so"; }
^
src/main/java/arc/backend/sdl/jni/SDL.java:41: error: cannot find symbol
new SharedLibraryLoader(){
^
symbol: class SharedLibraryLoader
location: class SDL
src/main/java/arc/backend/sdl/jni/SDL.java:42: error: method does not override or implement a method from a supertype
@Override
^
src/main/java/arc/backend/sdl/jni/SDL.java:44: error: cannot find symbol
if(OS.isWindows){
^
symbol: variable OS
src/main/java/arc/backend/sdl/jni/SDL.java:44: error: illegal parenthesized expression
if(OS.isWindows){
^
src/main/java/arc/backend/sdl/jni/SDL.java:46: error: cannot find symbol
extractFile(OS.is64Bit ? "OpenAL.dll" : "OpenAL32.dll", sourceCrc,
^
symbol: method extractFile(OS.is64Bit[...].dll",String,File)
src/main/java/arc/backend/sdl/jni/SDL.java:46: error: cannot find symbol
extractFile(OS.is64Bit ? "OpenAL.dll" : "OpenAL32.dll", sourceCrc,
^
symbol: variable OS
src/main/java/arc/backend/sdl/jni/SDL.java:51: error: non-static variable super cannot be referenced from a static context
return super.loadFile(sourcePath, sourceCrc, extractedFile);
^
src/main/java/arc/backend/sdl/jni/SDL.java:51: error: cannot find symbol
return super.loadFile(sourcePath, sourceCrc, extractedFile);
^
symbol: method loadFile(String,String,File)
21 errors
Exception in thread "main" java.lang.RuntimeException: Couldn't find C method for Java method 'SDL#SDL_Init'
at com.badlogic.gdx.jnigen.NativeCodeGenerator.generateCppFile(NativeCodeGenerator.java:340)
at com.badlogic.gdx.jnigen.NativeCodeGenerator.processDirectory(NativeCodeGenerator.java:276)
at com.badlogic.gdx.jnigen.NativeCodeGenerator.processDirectory(NativeCodeGenerator.java:248)
at com.badlogic.gdx.jnigen.NativeCodeGenerator.processDirectory(NativeCodeGenerator.java:248)
at com.badlogic.gdx.jnigen.NativeCodeGenerator.processDirectory(NativeCodeGenerator.java:248)
at com.badlogic.gdx.jnigen.NativeCodeGenerator.processDirectory(NativeCodeGenerator.java:248)
at com.badlogic.gdx.jnigen.NativeCodeGenerator.generate(NativeCodeGenerator.java:239)
at com.badlogic.gdx.jnigen.NativeCodeGenerator.generate(NativeCodeGenerator.java:207)
at NativesBuild.buildScripts(NativesBuild.java:76)
at NativesBuild.main(NativesBuild.java:72)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':backends:backend-sdl:sdlnatives'.
> Process 'command '/nix/store/c7sck4p44a1vmpfslms9shwpxkkl2781-openjdk-8u272-b10/lib/openjdk/bin/java'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 12s
33 actionable tasks: 9 executed, 24 up-to-date
[nix-shell:~/proj/Arc]$
Deleted user commented
According to a git bisect
, this started failing with 822c3d7
My test setup:
File: test.sh
#!/usr/bin/env nix-shell
#!nix-shell -i bash --pure -p gradle_6 jdk8 SDL2 ant openal glew freeglut pkg-config git
rm -f backends/backend-sdl/libs/linux64/libsdl-arc64.so
gradle clean sdlnatives -Pdynamic
ls backends/backend-sdl/libs/linux64/libsdl-arc64.so
res=$?
git stash
exit $res
Commands:
$ chmod +x test.sh
$ git bisect start
$ git bisect good 3a72937157113d8a5cd44bcc0b296c50e316c941
$ git bisect bad master
$ git bisect run ./test.sh
Result:
822c3d7b8d257027e9d81392670388c4629ec21e is the first bad commit
commit 822c3d7b8d257027e9d81392670388c4629ec21e
Author: Anuken <arnukren@gmail.com>
Date: Thu Oct 29 10:10:10 2020 -0400
Updated jnigen version
arc-core/build.gradle | 28 ++++++++++------------------
backends/backend-sdl/build.gradle | 2 +-
build.gradle | 7 +++++++
extensions/box2d/build.gradle | 2 +-
extensions/freetype/build.gradle | 2 +-
5 files changed, 20 insertions(+), 21 deletions(-)
bisect run success
Anuken commented
This particular error should be fixed in b2f3d21, but I still don't expect the SDL builds to work properly. The build files are very messy, likely incompatible with the latest jnigen version and should really be moved to the jnigen gradle plugin eventually.
Deleted user commented
Thanks, it works now!