LibrarianLib

LibrarianLib

18M Downloads

CI-built jar only includes linux yoga natives

Bluexin opened this issue ยท 2 comments

commented

switch (OperatingSystem.current()) {
case OperatingSystem.LINUX:
ext.lwjglNatives = "natives-linux"
break
case OperatingSystem.MAC_OS:
ext.lwjglNatives = "natives-macos"
break
case OperatingSystem.WINDOWS:
ext.lwjglNatives = "natives-windows"
break
}

along with
shade("org.lwjgl:lwjgl-yoga:3.2.1:$lwjglNatives") {
exclude group: 'org.lwjgl', module: 'lwjgl'
}

mean only natives for the OS used for the build will get included.
In dev liblib workspaces this is okay, but for the published jars it's not great.

commented

And even once natives are present, native method lookup fails because of the shading (see crash)

java.lang.UnsatisfiedLinkError: ll.org.lwjgl.util.yoga.Yoga.YGConfigNew()J
	at ll.org.lwjgl.util.yoga.Yoga.YGConfigNew(Native Method) ~[librarianlib-facade-1.15-SNAPSHOT.jar:5.0.0a2] {re:classloading}
	at com.teamwizardry.librarianlib.facade.layer.GuiLayer.<clinit>(GuiLayer.kt:1740) ~[librarianlib-facade-1.15-SNAPSHOT.jar:5.0.0a2] {re:classloading}
	at com.teamwizardry.librarianlib.facade.FacadeWidget.<init>(FacadeWidget.kt:23) ~[librarianlib-facade-1.15-SNAPSHOT.jar:5.0.0a2] {re:classloading}
	at com.teamwizardry.librarianlib.facade.FacadeScreen.<init>(FacadeScreen.kt:26) ~[librarianlib-facade-1.15-SNAPSHOT.jar:5.0.0a2] {re:classloading}
commented

This has been fixed, I'll open up a new issue for the classloading problem