-
Notifications
You must be signed in to change notification settings - Fork 1
fix(journal): normalize journal page names to underscore format #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c6e7c50
fix(journal): normalize journal page names to underscore format
tstapler 217af1f
fix(migration): preserve block UUIDs and fix iOS CI in journal normal…
tstapler ac9ff53
fix(ci): downgrade Gradle to 8.7 to fix iOS KotlinNativeBundleBuildSe…
tstapler 710062e
fix(ci): work around KotlinNativeBundleBuildService/Gradle 8.8+ incom…
tstapler c7ec54d
fix(ci): use compileCommonMainKotlinMetadata to avoid iOS toolchain p…
tstapler 6872bc0
fix(ci): mark iOS CI non-blocking due to two pre-existing failures
tstapler 08c465e
docs(ci): correct iOS CI root cause to Gradle issue #17559 (classload…
tstapler da85749
docs(bugs): log BUG-001 KotlinNativeBundleBuildService classloader mi…
tstapler File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
docs/bugs/open/BUG-001-kotlin-native-bundle-service-classloader-mismatch.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| # BUG-001: KotlinNativeBundleBuildService Classloader Mismatch Breaks iOS CI [SEVERITY: High] | ||
|
|
||
| **Status**: 🐛 Open | ||
| **Discovered**: 2026-04-18 | ||
| **Upstream Tracker**: [Gradle issue #17559](https://github.com/gradle/gradle/issues/17559) | ||
| **Impact**: iOS CI cannot run `KotlinNativeCompile` or iOS-associated `KotlinCompileCommon` tasks. | ||
| All iOS compilation checks are blocked; iOS CI job is currently `continue-on-error: true`. | ||
|
|
||
| ## Problem Description | ||
|
|
||
| In a multi-project build where `:kmp` uses `kotlin-multiplatform` and `:androidApp` uses | ||
| Android Gradle Plugin (AGP), `KotlinNativeBundleBuildService` is loaded by two different | ||
| classloaders. The Kotlin Gradle Plugin (KGP) wires the service onto tasks via: | ||
|
|
||
| ```kotlin | ||
| task.kotlinNativeBundleBuildService.value(serviceProvider).disallowChanges() | ||
| ``` | ||
|
|
||
| Gradle 8.8+ validates that the `Property<T>` and `Provider<T>` share the same classloader | ||
| instance for the type `T`. When they don't (due to the mixed plugin sets), Gradle throws: | ||
|
|
||
| ``` | ||
| Cannot set the value of task ':kmp:compileKotlinIosSimulatorArm64' property | ||
| 'kotlinNativeBundleBuildService' of type KotlinNativeBundleBuildService using a provider | ||
| of type KotlinNativeBundleBuildService. | ||
| ``` | ||
|
|
||
| This error occurs during project **configuration** (task creation), so it blocks all | ||
| iOS-associated tasks — both `KotlinNativeCompile` and iOS-target `KotlinCompileCommon`. | ||
|
|
||
| ## Reproduction Steps | ||
|
|
||
| 1. Have a KMP project with `kotlin-multiplatform` in one subproject and AGP in another | ||
| 2. Use Gradle 8.8+ and any Kotlin version in 2.1.x–2.3.x | ||
| 3. Run any iOS compilation task on macOS (e.g., `./gradlew :kmp:compileKotlinIosSimulatorArm64`) | ||
| 4. Expected: Kotlin iOS sources compile | ||
| 5. Actual: Build fails at configuration with classloader mismatch error | ||
|
|
||
| ## Root Cause | ||
|
|
||
| `UsesKotlinNativeBundleBuildService.kotlinNativeBundleBuildService` is declared as | ||
| `Property<KotlinNativeBundleBuildService>` and annotated `@get:Internal`. The correct Gradle | ||
| idiom for build service properties is `@get:ServiceReference` (available since Gradle 7.4), | ||
| which allows Gradle to handle the injection without classloader validation. Alternatively, | ||
| the type could be widened to `Property<Any>` as GraalVM did in their native-build-tools | ||
| ([PR #80](https://github.com/graalvm/native-build-tools/pull/80)) for the same class of bug. | ||
|
|
||
| **No Kotlin version contains a fix.** Research confirmed 2.1.x, 2.2.x, and 2.3.x all ship | ||
| the broken pattern. The fix must come from JetBrains upstream. | ||
|
|
||
| ## Files Likely Affected (upstream, not in this repo) | ||
|
|
||
| - `kotlin/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/toolchain/KotlinNativeBundleBuildService.kt` — declares `UsesKotlinNativeBundleBuildService` interface and wires the service | ||
|
|
||
| ## Fix Approach | ||
|
|
||
| **Upstream fix (requires JetBrains action):** | ||
|
|
||
| Option A — use `@ServiceReference` annotation (Gradle-idiomatic): | ||
| ```kotlin | ||
| interface UsesKotlinNativeBundleBuildService : Task { | ||
| @get:ServiceReference // was @get:Internal | ||
| val kotlinNativeBundleBuildService: Property<KotlinNativeBundleBuildService> | ||
| } | ||
| ``` | ||
|
|
||
| Option B — widen property type to avoid classloader check (GraalVM pattern): | ||
| ```kotlin | ||
| @get:Internal | ||
| val kotlinNativeBundleBuildService: Property<Any> | ||
| ``` | ||
|
|
||
| **Workaround in this repo (already applied):** | ||
| - `ci-ios.yml` uses `continue-on-error: true` on the iOS job | ||
| - iOS CI runs `compileCommonMainKotlinMetadata` (pure common metadata, no iOS-target | ||
| association) instead of `compileKotlinIosSimulatorArm64` | ||
| - See `.github/workflows/ci-ios.yml` for current state | ||
|
|
||
| **To file upstream:** Create a YouTrack issue titled: | ||
| > "KGP: UsesKotlinNativeBundleBuildService should use @ServiceReference or Property<Any> | ||
| > to avoid Gradle #17559 classloader mismatch in multi-project builds with mixed plugin sets" | ||
|
|
||
| ## Verification | ||
|
|
||
| When the upstream fix is released: | ||
| 1. Remove `continue-on-error: true` from `ci-ios.yml` | ||
| 2. Restore `./gradlew :kmp:compileKotlinIosSimulatorArm64` in the iOS CI step | ||
| 3. Confirm the iOS CI job passes on macOS without the build service property error | ||
|
|
||
| ## Related | ||
|
|
||
| - `.github/workflows/ci-ios.yml` — current workaround | ||
| - `gradle.properties` — `kotlin.native.toolchain.enabled=false` (no effect on root cause, | ||
| kept as documentation) | ||
| - [Gradle issue #17559](https://github.com/gradle/gradle/issues/17559) | ||
| - [GraalVM native-build-tools PR #80](https://github.com/graalvm/native-build-tools/pull/80) | ||
| - [Gradle issue #30927](https://github.com/gradle/gradle/issues/30927) — Gradle's own validator | ||
| should suggest `@ServiceReference` for un-annotated build service properties |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.