feat(shared-core): add macOS Kotlin/Native targets - #1402
Open
bmc08gt wants to merge 24 commits into
Open
Conversation
androidDeviceTest needs getByName("androidDeviceTest") rather than a direct block accessor, matching the existing androidHostTest pattern in :libs:encryption:utils.
Verifies BIP39 seed -> SLIP-0010 ed25519 derivation against slip10.json on the JVM host, mirroring the ed25519/base58 commonTest gates from #718. The androidHostTest JVM run needs the same JNI-backed Ed25519Kmp Android actual as :libs:encryption:ed25519's own host test, which loads libnative-lib.dylib/libed25519.dylib from a src/androidHostTest/jniLibs directory. mnemonic didn't have one, so createKeyPair() failed with UnsatisfiedLinkError; copying the same two prebuilt libraries in fixes it.
Mirrors Ed25519.swift/Hashes.swift: wraps the Kotlin Derive/MnemonicCode objects exported through the SharedCore XCFramework, plus the [Int64] -> KotlinLongArray bridge derivedKey(seed:hardenedIndexes:) needs. Existing facade files import Foundation alongside SharedCore for Data; the plan's Derivation.swift sample omitted it, added here to match convention.
Verified via xcodebuild against a simulator destination, not the plan's swift test: the XCFramework has no macOS slice, so plain swift test fails with 'no library for this platform was found' (same issue the shared-core-tests.yml CI lane already works around). 1 test passed, 0 failed.
SharedCore.xcframework had no macOS slice, so FlipcashCoreVectors, a macOS SPM package and Task 22's designated regression gate, couldn't build against it. Add macosArm64/macosX64 to the 7 exported modules plus the transitively-needed :libs:encryption:utils, and add macOS(.v14) to kmp/shared-core's kmmbridge SPM config and spm/Package.swift's platform list. ed25519 needed its expect/actual pair moved from src/iosMain to src/appleMain: Kotlin's default target hierarchy only promotes a source set named appleMain to cover both iOS and macOS targets, not one named iosMain. The vendored orlp/ed25519 C source needed no changes, it compiles clean under macOS clang for both arm64 and x86_64.
2 tasks
bmc08gt
force-pushed
the
feat/shared-core-mnemonic-derivation
branch
from
September 3, 2026 21:32
fd3480e to
4f34b7a
Compare
Porting MnemonicCode to commonMain as an object made its backing wordList field private again (only getWordList() is exposed), breaking SeedInputViewModel's direct field access.
Picks up #1397 (UserFlags), #1401 (restores KikCode+Badge/KikCode+Figure/ SVGPath/KikCodeFigureTests), and #1400 (FocusPin/MessageRow/ MessageReadReporter/ReceiptRules) via the true fork point as the merge base, correcting an earlier rewrite that had reparented this branch onto code/cash's graph without actually merging its content.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
SharedCore.xcframework had no macOS slice, so
FlipcashCoreVectors— a macOS SPM package and the shared-derivation work's regression gate on iOS — couldn't build against it. AddsmacosArm64/macosX64targets to the 7 SharedCore-exported modules plus the transitively-needed:libs:encryption:utils.ed25519needed its expect/actual pair moved fromsrc/iosMaintosrc/appleMain: Kotlin's default target hierarchy only promotes a source set namedappleMainto cover both iOS and macOS targets, not one namediosMain. The vendored orlp/ed25519 C source needed no changes — it compiles clean under macOS clang for both arm64 and x86_64.Also adds
macOS(.v14)tokmp/shared-core's kmmbridge SPM config andspm/Package.swift's platform list, so a futureflipcash-shared-core-spmrelease publishes a macOS slice.Test plan
./gradlew :kmp:shared-core:assembleSharedCoreReleaseXCFramework— confirmed the assembled XCFramework'sInfo.plistlists amacos-arm64_x86_64slice alongside the existing iOS slicesFlipcashCoreVectors' full test suite passes against this XCFramework viaFLIPCASH_SHARED_CORE_LOCAL