Skip to content

Mo/feat/v10/add shared kmp and jvm module#1795

Merged
typfel merged 13 commits intomainfrom
mo/feat/v10/add-shared-kmp-and-jvm-module
Feb 25, 2026
Merged

Mo/feat/v10/add shared kmp and jvm module#1795
typfel merged 13 commits intomainfrom
mo/feat/v10/add-shared-kmp-and-jvm-module

Conversation

@typfel
Copy link
Member

@typfel typfel commented Jan 28, 2026

What's new in this PR


PR Submission Checklist for internal contributors
  • The PR Title
    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

@typfel typfel requested a review from a team January 28, 2026 12:38
@typfel typfel force-pushed the mo/feat/v10/add-shared-kmp-and-jvm-module branch from 8c69730 to e40745b Compare January 28, 2026 12:49
@github-actions
Copy link

github-actions bot commented Jan 28, 2026

🐰 Bencher Report

Branchmo/feat/v10/add-shared-kmp-and-jvm-module
Testbedubuntu-latest

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymicroseconds (µs)
Commit add f(group size)/cs1/mem/1002📈 view plot
⚠️ NO THRESHOLD
15,846.00 µs
Commit add f(group size)/cs1/mem/2📈 view plot
⚠️ NO THRESHOLD
663.47 µs
Commit add f(group size)/cs1/mem/202📈 view plot
⚠️ NO THRESHOLD
4,201.30 µs
Commit add f(group size)/cs1/mem/402📈 view plot
⚠️ NO THRESHOLD
6,959.80 µs
Commit add f(group size)/cs1/mem/602📈 view plot
⚠️ NO THRESHOLD
10,676.00 µs
Commit add f(group size)/cs1/mem/802📈 view plot
⚠️ NO THRESHOLD
13,416.00 µs
Commit add f(number clients)/cs1/mem/1002📈 view plot
⚠️ NO THRESHOLD
984,110.00 µs
Commit add f(number clients)/cs1/mem/2📈 view plot
⚠️ NO THRESHOLD
661.87 µs
Commit add f(number clients)/cs1/mem/202📈 view plot
⚠️ NO THRESHOLD
80,219.00 µs
Commit add f(number clients)/cs1/mem/402📈 view plot
⚠️ NO THRESHOLD
215,460.00 µs
Commit add f(number clients)/cs1/mem/602📈 view plot
⚠️ NO THRESHOLD
424,530.00 µs
Commit add f(number clients)/cs1/mem/802📈 view plot
⚠️ NO THRESHOLD
671,360.00 µs
Commit pending proposals f(group size)/cs1/mem/1002📈 view plot
⚠️ NO THRESHOLD
115,020.00 µs
Commit pending proposals f(group size)/cs1/mem/2📈 view plot
⚠️ NO THRESHOLD
22,749.00 µs
Commit pending proposals f(group size)/cs1/mem/202📈 view plot
⚠️ NO THRESHOLD
40,939.00 µs
Commit pending proposals f(group size)/cs1/mem/402📈 view plot
⚠️ NO THRESHOLD
56,516.00 µs
Commit pending proposals f(group size)/cs1/mem/602📈 view plot
⚠️ NO THRESHOLD
76,417.00 µs
Commit pending proposals f(group size)/cs1/mem/802📈 view plot
⚠️ NO THRESHOLD
91,744.00 µs
Commit pending proposals f(pending size)/cs1/mem/1📈 view plot
⚠️ NO THRESHOLD
15,503.00 µs
Commit pending proposals f(pending size)/cs1/mem/101📈 view plot
⚠️ NO THRESHOLD
113,560.00 µs
Commit pending proposals f(pending size)/cs1/mem/21📈 view plot
⚠️ NO THRESHOLD
32,601.00 µs
Commit pending proposals f(pending size)/cs1/mem/41📈 view plot
⚠️ NO THRESHOLD
54,046.00 µs
Commit pending proposals f(pending size)/cs1/mem/61📈 view plot
⚠️ NO THRESHOLD
72,952.00 µs
Commit pending proposals f(pending size)/cs1/mem/81📈 view plot
⚠️ NO THRESHOLD
93,525.00 µs
Commit remove f(group size)/cs1/mem/1002📈 view plot
⚠️ NO THRESHOLD
10,192.00 µs
Commit remove f(group size)/cs1/mem/2📈 view plot
⚠️ NO THRESHOLD
497.10 µs
Commit remove f(group size)/cs1/mem/202📈 view plot
⚠️ NO THRESHOLD
1,933.90 µs
Commit remove f(group size)/cs1/mem/402📈 view plot
⚠️ NO THRESHOLD
3,832.50 µs
Commit remove f(group size)/cs1/mem/602📈 view plot
⚠️ NO THRESHOLD
5,446.10 µs
Commit remove f(group size)/cs1/mem/802📈 view plot
⚠️ NO THRESHOLD
7,204.60 µs
Commit remove f(number clients)/cs1/mem/1002📈 view plot
⚠️ NO THRESHOLD
12,726.00 µs
Commit remove f(number clients)/cs1/mem/2📈 view plot
⚠️ NO THRESHOLD
133,000.00 µs
Commit remove f(number clients)/cs1/mem/202📈 view plot
⚠️ NO THRESHOLD
108,930.00 µs
Commit remove f(number clients)/cs1/mem/402📈 view plot
⚠️ NO THRESHOLD
85,193.00 µs
Commit remove f(number clients)/cs1/mem/602📈 view plot
⚠️ NO THRESHOLD
60,669.00 µs
Commit remove f(number clients)/cs1/mem/802📈 view plot
⚠️ NO THRESHOLD
36,739.00 µs
Commit update f(group size)/cs1/mem/1002📈 view plot
⚠️ NO THRESHOLD
132,590.00 µs
Commit update f(group size)/cs1/mem/2📈 view plot
⚠️ NO THRESHOLD
666.34 µs
Commit update f(group size)/cs1/mem/202📈 view plot
⚠️ NO THRESHOLD
27,422.00 µs
Commit update f(group size)/cs1/mem/402📈 view plot
⚠️ NO THRESHOLD
53,788.00 µs
Commit update f(group size)/cs1/mem/602📈 view plot
⚠️ NO THRESHOLD
81,148.00 µs
Commit update f(group size)/cs1/mem/802📈 view plot
⚠️ NO THRESHOLD
106,850.00 µs
🐰 View full continuous benchmarking report in Bencher

@typfel typfel force-pushed the mo/feat/v10/add-shared-kmp-and-jvm-module branch 2 times, most recently from 3a3b05f to 646e1d6 Compare February 4, 2026 12:51
@MohamadJaara MohamadJaara force-pushed the mo/feat/v10/add-shared-kmp-and-jvm-module branch from b7767b8 to 8d6886a Compare February 5, 2026 13:24
@typfel typfel force-pushed the mo/feat/v10/add-shared-kmp-and-jvm-module branch 3 times, most recently from c168e0d to e72fb55 Compare February 11, 2026 07:59
@typfel typfel force-pushed the mo/feat/v10/add-shared-kmp-and-jvm-module branch 5 times, most recently from eecd970 to 0996e82 Compare February 24, 2026 09:57
MohamadJaara and others added 6 commits February 24, 2026 11:03
…e 8.14.3

interop was using gradle 9.x which caused incomaptibllity issues for
kotlin multiplatform. Upgrading gradle is not an option until we are
ready to also upgrade kotlin multiplatform to 2.3.0 or above.
@typfel typfel force-pushed the mo/feat/v10/add-shared-kmp-and-jvm-module branch from 0996e82 to 6fc4c7f Compare February 24, 2026 10:03
@istankovic
Copy link
Member

Why is commit 12fb0ac necessary?
The message mentions ANDROID_HOME but the changes check for ANDROID_NDK_HOME.

@typfel
Copy link
Member Author

typfel commented Feb 24, 2026

Why is commit 12fb0ac necessary? The message mentions ANDROID_HOME but the changes check for ANDROID_NDK_HOME.

Right commits message is misleading I'll update it, it was necessary to expose ANDROID_NDK_ROOT since that's used by the Gobley gradle plugin.

@istankovic
Copy link
Member

What is the purpose of buildScriptOutputDirectories files?

kmp/cinterop/
├── cargoBuildAndroidArm64
│   ├── buildScriptOutputDirectories
│   └── nativeStaticLibsDef
├── cargoBuildAndroidArmV7
│   ├── buildScriptOutputDirectories
│   └── nativeStaticLibsDef
├── cargoBuildAndroidX86
│   ├── buildScriptOutputDirectories
│   └── nativeStaticLibsDef
├── cargoBuildIosArm64
│   ├── buildScriptOutputDirectories
│   └── nativeStaticLibsDef
├── cargoBuildIosSimulatorArm64
│   ├── buildScriptOutputDirectories
│   └── nativeStaticLibsDef
├── cargoBuildLinuxX64
│   ├── buildScriptOutputDirectories
│   └── nativeStaticLibsDef
└── cargoBuildMacOSArm64
    ├── buildScriptOutputDirectories
    └── nativeStaticLibsDef

@istankovic
Copy link
Member

Running ktlint found these:

crypto-ffi/bindings/kmp/build.gradle.kts:1:1: Imports must be ordered in lexicographic order without any empty lines in-between with "java", "javax", "kotlin" and aliases in the end (standard:import-ordering)
crypto-ffi/bindings/kmp/build.gradle.kts:3:1: Wildcard import (standard:no-wildcard-imports)
crypto-ffi/bindings/kmp/build.gradle.kts:177:23: Line is exceeding max line length. Break line between assignment and expression (standard:binary-expression-wrapping)
crypto-ffi/bindings/kmp/build.gradle.kts:177:68: Argument should be on a separate line (unless all arguments can fit a single line) (standard:argument-list-wrapping)
crypto-ffi/bindings/kmp/build.gradle.kts:177:87: Argument should be on a separate line (unless all arguments can fit a single line) (standard:argument-list-wrapping)
crypto-ffi/bindings/kmp/build.gradle.kts:177:111: Missing newline before ")" (standard:argument-list-wrapping)
crypto-ffi/bindings/kmp/build.gradle.kts:177:113: Line is exceeding max line length. Break line before '?:' (standard:binary-expression-wrapping)
crypto-ffi/bindings/kmp/build.gradle.kts:177:138: Argument should be on a separate line (unless all arguments can fit a single line) (standard:argument-list-wrapping)
crypto-ffi/bindings/kmp/build.gradle.kts:177:141: Exceeded max line length (140) (standard:max-line-length)
crypto-ffi/bindings/kmp/build.gradle.kts:177:180: Missing newline before ")" (standard:argument-list-wrapping)
crypto-ffi/bindings/kmp/build.gradle.kts:178:51: Redundant curly braces (standard:string-template)
crypto-ffi/bindings/kmp/build.gradle.kts:204:61: Missing spacing after "," (standard:comma-spacing)
crypto-ffi/bindings/kmp/build.gradle.kts:205:56: Unnecessary long whitespace (standard:no-multi-spaces)

Seems like our CI does not catch this due to the way kotlin-check Makefile rule works.

@typfel
Copy link
Member Author

typfel commented Feb 24, 2026

What is the purpose of buildScriptOutputDirectories files?

kmp/cinterop/
├── cargoBuildAndroidArm64
│   ├── buildScriptOutputDirectories
│   └── nativeStaticLibsDef
├── cargoBuildAndroidArmV7
│   ├── buildScriptOutputDirectories
│   └── nativeStaticLibsDef
├── cargoBuildAndroidX86
│   ├── buildScriptOutputDirectories
│   └── nativeStaticLibsDef
├── cargoBuildIosArm64
│   ├── buildScriptOutputDirectories
│   └── nativeStaticLibsDef
├── cargoBuildIosSimulatorArm64
│   ├── buildScriptOutputDirectories
│   └── nativeStaticLibsDef
├── cargoBuildLinuxX64
│   ├── buildScriptOutputDirectories
│   └── nativeStaticLibsDef
└── cargoBuildMacOSArm64
    ├── buildScriptOutputDirectories
    └── nativeStaticLibsDef

If you let the Gobley cargo plugin handle the cargo build it will contain paths to rust build output which it scans for dynamically linked libraries. We've disabled this part of the cargo plugin and use our externally build ffi libraries instead, but we still need provide it since the cinterop tasks in the plugin expects it to be there.

@typfel typfel force-pushed the mo/feat/v10/add-shared-kmp-and-jvm-module branch from d82cef2 to 464609f Compare February 24, 2026 11:51
@typfel
Copy link
Member Author

typfel commented Feb 24, 2026

Running ktlint found these:

crypto-ffi/bindings/kmp/build.gradle.kts:1:1: Imports must be ordered in lexicographic order without any empty lines in-between with "java", "javax", "kotlin" and aliases in the end (standard:import-ordering)
crypto-ffi/bindings/kmp/build.gradle.kts:3:1: Wildcard import (standard:no-wildcard-imports)
crypto-ffi/bindings/kmp/build.gradle.kts:177:23: Line is exceeding max line length. Break line between assignment and expression (standard:binary-expression-wrapping)
crypto-ffi/bindings/kmp/build.gradle.kts:177:68: Argument should be on a separate line (unless all arguments can fit a single line) (standard:argument-list-wrapping)
crypto-ffi/bindings/kmp/build.gradle.kts:177:87: Argument should be on a separate line (unless all arguments can fit a single line) (standard:argument-list-wrapping)
crypto-ffi/bindings/kmp/build.gradle.kts:177:111: Missing newline before ")" (standard:argument-list-wrapping)
crypto-ffi/bindings/kmp/build.gradle.kts:177:113: Line is exceeding max line length. Break line before '?:' (standard:binary-expression-wrapping)
crypto-ffi/bindings/kmp/build.gradle.kts:177:138: Argument should be on a separate line (unless all arguments can fit a single line) (standard:argument-list-wrapping)
crypto-ffi/bindings/kmp/build.gradle.kts:177:141: Exceeded max line length (140) (standard:max-line-length)
crypto-ffi/bindings/kmp/build.gradle.kts:177:180: Missing newline before ")" (standard:argument-list-wrapping)
crypto-ffi/bindings/kmp/build.gradle.kts:178:51: Redundant curly braces (standard:string-template)
crypto-ffi/bindings/kmp/build.gradle.kts:204:61: Missing spacing after "," (standard:comma-spacing)
crypto-ffi/bindings/kmp/build.gradle.kts:205:56: Unnecessary long whitespace (standard:no-multi-spaces)

Seems like our CI does not catch this due to the way kotlin-check Makefile rule works.

But was the linter every applied to any gradle files? Looking at the Makefile it only includes the source files.

@istankovic
Copy link
Member

Running ktlint found these:

crypto-ffi/bindings/kmp/build.gradle.kts:1:1: Imports must be ordered in lexicographic order without any empty lines in-between with "java", "javax", "kotlin" and aliases in the end (standard:import-ordering)
crypto-ffi/bindings/kmp/build.gradle.kts:3:1: Wildcard import (standard:no-wildcard-imports)
crypto-ffi/bindings/kmp/build.gradle.kts:177:23: Line is exceeding max line length. Break line between assignment and expression (standard:binary-expression-wrapping)
crypto-ffi/bindings/kmp/build.gradle.kts:177:68: Argument should be on a separate line (unless all arguments can fit a single line) (standard:argument-list-wrapping)
crypto-ffi/bindings/kmp/build.gradle.kts:177:87: Argument should be on a separate line (unless all arguments can fit a single line) (standard:argument-list-wrapping)
crypto-ffi/bindings/kmp/build.gradle.kts:177:111: Missing newline before ")" (standard:argument-list-wrapping)
crypto-ffi/bindings/kmp/build.gradle.kts:177:113: Line is exceeding max line length. Break line before '?:' (standard:binary-expression-wrapping)
crypto-ffi/bindings/kmp/build.gradle.kts:177:138: Argument should be on a separate line (unless all arguments can fit a single line) (standard:argument-list-wrapping)
crypto-ffi/bindings/kmp/build.gradle.kts:177:141: Exceeded max line length (140) (standard:max-line-length)
crypto-ffi/bindings/kmp/build.gradle.kts:177:180: Missing newline before ")" (standard:argument-list-wrapping)
crypto-ffi/bindings/kmp/build.gradle.kts:178:51: Redundant curly braces (standard:string-template)
crypto-ffi/bindings/kmp/build.gradle.kts:204:61: Missing spacing after "," (standard:comma-spacing)
crypto-ffi/bindings/kmp/build.gradle.kts:205:56: Unnecessary long whitespace (standard:no-multi-spaces)

Seems like our CI does not catch this due to the way kotlin-check Makefile rule works.

But was the linter every applied to any gradle files? Looking at the Makefile it only includes the source files.

Currently it does not include the gradle files, but Makefile has been through many changes so it could be that we dropped it at some point.

Running ktlint inside bindings only complains about the new kmp file, not the other ones, so my guess is we had that linting before.

@istankovic
Copy link
Member

If you let the Gobley cargo plugin handle the cargo build it will contain paths to rust build output which it scans for dynamically linked libraries. We've disabled this part of the cargo plugin and use our externally build ffi libraries instead, but we still need provide it since the cinterop tasks in the plugin expects it to be there.

Right, but note that buildScriptOutputDirectories are all empty and I am wondering what purpose that serves.

@istankovic
Copy link
Member

Why is commit 12fb0ac necessary? The message mentions ANDROID_HOME but the changes check for ANDROID_NDK_HOME.

Right commits message is misleading I'll update it, it was necessary to expose ANDROID_NDK_ROOT since that's used by the Gobley gradle plugin.

In that case, I would just copy the android env setup from .github/workflows/build-android.yml:

      - name: setup android sdk
        uses: android-actions/setup-android@v3
        with:
          # Don't download unnecessary packages.
          # We only need sdkmanager for the next step.
          packages: ''

      - name: install ndk and set up environment
        run: |
          ndk_version=$(cat crypto-ffi/bindings/android/ndk.version)
          echo "y" | sdkmanager --install "ndk;$ndk_version"
          echo ANDROID_NDK_HOME=$ANDROID_HOME/ndk/$ndk_version >> $GITHUB_ENV

and adjust it accordingly. This would make it more consistent with other workflows and also avoid downloading unnecessary packages.

@typfel
Copy link
Member Author

typfel commented Feb 24, 2026

If you let the Gobley cargo plugin handle the cargo build it will contain paths to rust build output which it scans for dynamically linked libraries. We've disabled this part of the cargo plugin and use our externally build ffi libraries instead, but we still need provide it since the cinterop tasks in the plugin expects it to be there.

Right, but note that buildScriptOutputDirectories are all empty and I am wondering what purpose that serves.

They need to be there even if they are empty otherwise the gobley cargo plugin will throw an error.

@typfel typfel requested a review from istankovic February 24, 2026 13:24
@istankovic
Copy link
Member

Right, but note that buildScriptOutputDirectories are all empty and I am wondering what purpose that serves.

They need to be there even if they are empty otherwise the gobley cargo plugin will throw an error.

Oh well. 🥴

typfel and others added 4 commits February 25, 2026 09:14
…e 2.0.21

downgrade kotlinx-serialization-json to 1.8.0 for kotlin 2.0.21 compatibility
…go plugin.

also improve NDK setup by validating ANDROID_HOME and adding installation step
@typfel
Copy link
Member Author

typfel commented Feb 25, 2026

Right, but note that buildScriptOutputDirectories are all empty and I am wondering what purpose that serves.

They need to be there even if they are empty otherwise the gobley cargo plugin will throw an error.

Oh well. 🥴

Took another pass on this changed it so that we generate these empty files on the fly. Also removed the folders so that only thing remaining in the source tree is the actual def files.

@typfel typfel requested a review from istankovic February 25, 2026 08:44
@typfel typfel force-pushed the mo/feat/v10/add-shared-kmp-and-jvm-module branch from d6c3eda to b98140a Compare February 25, 2026 08:51
Copy link
Member

@istankovic istankovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@typfel typfel force-pushed the mo/feat/v10/add-shared-kmp-and-jvm-module branch from b98140a to fdbcab1 Compare February 25, 2026 09:09
@typfel typfel merged commit fdbcab1 into main Feb 25, 2026
50 checks passed
@typfel typfel deleted the mo/feat/v10/add-shared-kmp-and-jvm-module branch February 25, 2026 09:27
@typfel typfel mentioned this pull request Feb 25, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants