Skip to content

Running driver on not officially supported platforms #605

@DNikolaevAtRocket

Description

@DNikolaevAtRocket

Description

It's not possible to run the driver on platforms that are not officially supported.

  • Regardless of which version of duckdb_jdbc_* is used, it calls cpuArch and osName unconditionally before it tries to load plain duckdb_java.
    Each of them throws IllegalStateException if being run not on one of the hardcoded OS's / architectures.
  • There's OVERRIDE_JDBC_OS_ARCH to enforce the correct arch for the native part, but there's no such option for OS_NAME.

I'd be happy to provide a PR for this.
Any ideas on how to address it?
From my side, I can see the below options.

Suggestions

For the native part

Introduce OVERRIDE_JDBC_OS_NAME.

Option 1 for the Java part (more generic)

Package a properties file that'd contain all the mappings between os.name / os.arch <-> OS / arch used by DuckDBNative, and load it in runtime.
It could contain all the officially supported platforms + extra platforms defined in build time / edited in pre-built jars.

E.g.

<...>
duckdb.os.arch.arm64 = aarch64,arm64
duckdb.os.name.linux = linux
<...>

It'd allow using the official build in the most flexible way.

Option 2 for the Java part (more conservative)

Catch IllegalStateException("Unsupported <...>"), try to load plain duckdb_java. If the latter fails, throw the original error.
Or something like this.

It'd allow using duckdb_jdbc-*-nolib.jar on such platforms.

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions