Plain ./gradlew build on a Linux host: gate Apple cargo builds and commonizeCInterop off-mac #129

Closed
opened 2026-08-26 14:26:47 +02:00 by thecrealm · 2 comments
Owner

Decided with thecrealm (D79): plain ./gradlew build must work on a non-mac host without CI's -x :katrix-apple:build -Pkotlin.mpp.enableCInteropCommonization=false. Mechanism of the failure: Gradle executes a disabled task's dependencies, so KMP's off-mac disabling of the Apple cinterop/compile tasks still let Gobley's cargoBuildIos*/Macos* producers run — and fail (no Apple SDK; host cc is not clang). Fix: (1) katrix.kmp-library-ffi disables cargo build/check task variants whose Rust target is not in GobleyHost.current.platform.supportedTargets, and host-gates RustUpTargetAdd; (2) root build disables commonizeCInterop off-mac (CI #330's demand). Both are no-ops on a mac by construction. Verified green on linux/x86_64 (plain build, zero flags). Remaining before close: one verification build on the dev Mac (Apple targets + XCFramework must be unaffected), then CI can drop its -x flags in a follow-up.

Decided with thecrealm (D79): plain `./gradlew build` must work on a non-mac host without CI's `-x :katrix-apple:build -Pkotlin.mpp.enableCInteropCommonization=false`. Mechanism of the failure: Gradle executes a disabled task's dependencies, so KMP's off-mac disabling of the Apple cinterop/compile tasks still let Gobley's cargoBuildIos*/Macos* producers run — and fail (no Apple SDK; host cc is not clang). Fix: (1) katrix.kmp-library-ffi disables cargo build/check task variants whose Rust target is not in GobleyHost.current.platform.supportedTargets, and host-gates RustUpTargetAdd; (2) root build disables commonizeCInterop off-mac (CI #330's demand). Both are no-ops on a mac by construction. Verified green on linux/x86_64 (plain build, zero flags). Remaining before close: one verification build on the dev Mac (Apple targets + XCFramework must be unaffected), then CI can drop its -x flags in a follow-up.
Author
Owner

Dev-Mac verification done (2026-08-26, this machine): with D79's host-gating in the tree, ':katrix-apple:build', ':katrix-crypto-vodozemac:build' (all cargo variants incl. Apple targets) and ':katrix-apple:assembleKatrixXCFramework' are green — Katrix.xcframework assembles at katrix-apple/build/XCFrameworks/release/Katrix.xcframework. The gating is a no-op on the mac as designed. Remaining follow-up (CI dropping its -x flags) deserves its own issue if not already tracked.

Dev-Mac verification done (2026-08-26, this machine): with D79's host-gating in the tree, ':katrix-apple:build', ':katrix-crypto-vodozemac:build' (all cargo variants incl. Apple targets) and ':katrix-apple:assembleKatrixXCFramework' are green — Katrix.xcframework assembles at katrix-apple/build/XCFrameworks/release/Katrix.xcframework. The gating is a no-op on the mac as designed. Remaining follow-up (CI dropping its -x flags) deserves its own issue if not already tracked.
Author
Owner

Both legs verified: linux/x86_64 plain build (the D79 change-set) and the dev-Mac Apple/XCFramework build (comment above). CI -x-flag drop is the follow-up.

Both legs verified: linux/x86_64 plain build (the D79 change-set) and the dev-Mac Apple/XCFramework build (comment above). CI -x-flag drop is the follow-up.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
thecrealm/katrix#129
No description provided.