quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.58k stars 2.63k forks source link

Some classes loaders are not ARM compatible #43415

Open rcjverhoef opened 2 hours ago

rcjverhoef commented 2 hours ago

Describe the bug

I run on apple silicon with a kotlin code base. I get an exception that comes down to fat file, but missing compatible architecture (have 'i386,x86_64', need 'arm64e' or 'arm64').

The JVM I run is ARM based. The freaky thing: I call a library A that calls another library B, where this breaks with above error. However, if I do the identical call to library B from my code it does not break.

Expected behavior

When on apple silicon, everything should work the same in different class loaders

Actual behavior

it does not

How to Reproduce?

This might be a bit cumbersome.

The problem is with apache-ranger. This for some reason calls library kstruct to get a hostname.

I have below test-case. This breaks on call RangerAdminRESTClient(), which does the same call as my code does one line before. If I remove @QuarkusTest, everything works. This looks like the same behavior I see when running my app.

import com.kstruct.gethostname4j.Hostname
import io.quarkus.test.junit.QuarkusTest
import org.apache.ranger.admin.client.RangerAdminRESTClient
import org.junit.jupiter.api.Test

@QuarkusTest
class TestKsctruc {
    @Test
    fun test() {
        val x = Hostname.getHostname()
        println(x)
        val client = RangerAdminRESTClient()
    }
}

Output of uname -a or ver

23.6.0 Darwin Kernel Version 23.6.0: Mon Jul 29 21:14:30 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6030 arm64

Output of java -version

openjdk version "23" 2024-09-17 OpenJDK Runtime Environment Homebrew (build 23) OpenJDK 64-Bit Server VM Homebrew (build 23, mixed mode, sharing)

Quarkus version or git rev

3.10.2

Build tool (ie. output of mvnw --version or gradlew --version)

------------------------------------------------------------ Gradle 8.7 ------------------------------------------------------------ Build time: 2024-03-22 15:52:46 UTC Revision: 650af14d7653aa949fce5e886e685efc9cf97c10 Kotlin: 1.9.22 Groovy: 3.0.17 Ant: Apache Ant(TM) version 1.10.13 compiled on January 4 2023 JVM: 23 (Homebrew 23) OS: Mac OS X 14.6.1 aarch64

Additional information

No response

quarkus-bot[bot] commented 2 hours ago

/cc @geoand (kotlin)

geoand commented 1 hour ago

Any chance you can attach a sample project that exhibits the problem?

Thanks