Skip to content

Compile on Linux - #10

Open
piercifani wants to merge 2 commits into
skiptools:mainfrom
theleftbit:linux-host-compile
Open

Compile on Linux#10
piercifani wants to merge 2 commits into
skiptools:mainfrom
theleftbit:linux-host-compile

Conversation

@piercifani

@piercifani piercifani commented Jul 17, 2026

Copy link
Copy Markdown

The Linux host pass of skip export compiles this package natively, where the non-SKIP branch's import Security fails (Security is Darwin-only).

Guard the Darwin implementation behind canImport(Security) with a throwing stub fallback, nested inside the existing !SKIP branches so the transpiled Kotlin output is unchanged.

Skip Pull Request Checklist:

  • REQUIRED: I have signed the Contributor Agreement
  • REQUIRED: I have tested my change locally with swift test
  • OPTIONAL: I have tested my change on an iOS simulator or device
  • OPTIONAL: I have tested my change on an Android emulator or device

  • AI was used to generate or assist with generating this PR

It helped me understand where the issue was coming from and how to best attack it.


The Linux host pass of `skip export` compiles this package natively, where
the non-SKIP branch's `import Security` fails (Security is Darwin-only).
Guard the Darwin implementation behind canImport(Security) with a throwing
stub fallback, nested inside the existing !SKIP branches so the transpiled
Kotlin output is unchanged (verified byte-identical vs 0.3.2).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cla-bot cla-bot Bot added the cla-signed label Jul 17, 2026

@marcprux marcprux left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great contribution!

Could you also turn on the Linux CI build in .github/workflows/ci.yml‎ so we can get ongoing validation that it builds and tests on Linux (e.g., see https://github.com/skiptools/skip-android-bridge/pull/31/changes#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fR18)?

Adds ubuntu-24.04 alongside the default macos-15-intel runner, matching
skip-android-bridge, so the Linux host build is validated on every push.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@marcprux

Copy link
Copy Markdown
Member

Thanks for adding the Linux CI. I think it is failing because you need to also add a #if canImport(OSLog) to guard against OSLog import attempts on Linux:

/home/runner/work/skip-keychain/skip-keychain/Tests/SkipKeychainTests/SkipKeychainTests.swift:4:8: error: no such module 'OSLog'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants