Files
werkregie/dashboard/spikes/matrix-sdk/build.gradle.kts
miandmhoennig 3a14978aae dashboard: spike shows Trixnity runs on the JVM with vodozemac (#5)
Werkbaum `#dash.matrix.sdk`: **Trixnity runs on the dashboard's JVM, with vodozemac rather than libolm.**

A spike in `dashboard/spikes/matrix-sdk`, a Gradle build of its own — nothing reaches the dashboard's classpath or bundle. It signs in nowhere and sends nothing:

- Olm: two accounts, pre-key message and answer decrypted.
- Megolm: three room messages through a group session decrypted.
- The client's vodozemac crypto driver module loads.
- With a server name as argument: `.well-known` discovery and `/versions` of its homeserver.

Run from `dashboard/`: `../gradlew -p spikes/matrix-sdk run --args="matrix.org"` (also `classpathSize`, `moduleDeps`).

Findings, recorded in the Werkbaum description:
- Trixnity 5.9.2 compiles with the dashboard's Kotlin 2.2.21 on Temurin 21 and pulls kotlin-stdlib 2.3.21.
- vodozemac via JNI; the native library (Linux x86-64/aarch64) is unpacked into the temp directory, which must allow execution; needs glibc 2.34 — mih09 has 2.36.
- Discovery and versions work against matrix.org and the user's homeserver (not named in the repository).
- For the bundle: 49 jars, 24 MB more; jlink additionally needs `java.logging`, `java.management`, `java.instrument`, `jdk.unsupported`.
- Next: the client's store, `trixnity-client-repository-exposed` on the sqlite-jdbc the dashboard already has.

Dashboard tests still green; the Werkbaum parser reports no warnings.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: mhoennig <michael@hoennig.de>
Reviewed-on: #5
2026-10-10 20:16:35 +02:00

67 lines
2.3 KiB
Kotlin

import org.jetbrains.kotlin.gradle.dsl.JvmTarget
// Werkbaum #dash.matrix.sdk: does Trixnity run on the dashboard's JVM, with vodozemac rather than libolm?
// Run from dashboard/: ../gradlew -p spikes/matrix-sdk run --args="[SERVER_NAME]"
plugins {
// the dashboard's Kotlin version: Trixnity is built with a newer one
kotlin("jvm") version "2.2.21"
application
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
vendor = JvmVendorSpec.ADOPTIUM
}
}
kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_21
}
}
repositories {
mavenCentral()
}
val trixnityVersion = "5.9.2"
dependencies {
implementation("de.connect2x.trixnity:trixnity-client:$trixnityVersion")
implementation("de.connect2x.trixnity:trixnity-client-cryptodriver-vodozemac:$trixnityVersion")
// the bindings themselves, for the round trips; a client would only need the driver
implementation("de.connect2x.trixnity:trixnity-vodozemac:$trixnityVersion")
// Trixnity's Ktor version; the Java engine uses the JDK's HttpClient, as the dashboard does
implementation("io.ktor:ktor-client-java:3.5.2")
}
application {
mainClass = "SpikeKt"
// vodozemac is loaded through JNI
applicationDefaultJvmArgs = listOf("--enable-native-access=ALL-UNNAMED")
}
// the jars a client would add to the dashboard's bundle
tasks.register("classpathSize") {
val jars = configurations.runtimeClasspath
doLast {
val files = jars.get().files
println("runtime classpath: ${files.size} jars, ${files.sumOf { it.length() } / 1024 / 1024} MB")
files.sortedByDescending { it.length() }.take(8).forEach { println(" ${it.length() / 1024} KB ${it.name}") }
}
}
// the JDK modules those jars need, for the bundle's jlink --add-modules
tasks.register<Exec>("moduleDeps") {
dependsOn(tasks.jar)
val launcher = javaToolchains.launcherFor(java.toolchain)
val jars = configurations.runtimeClasspath
val own = tasks.jar.flatMap { it.archiveFile }
doFirst {
val jdeps = launcher.get().metadata.installationPath.file("bin/jdeps").asFile
val classpath = jars.get().files.joinToString(":")
commandLine(jdeps, "--ignore-missing-deps", "--multi-release", "21", "--print-module-deps", "--class-path", classpath, own.get().asFile, *jars.get().files.toTypedArray())
}
}