-
Notifications
You must be signed in to change notification settings - Fork 146
Port to Android #5
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
Conversation
@@ -26,7 +26,7 @@ class PreviewServerTests: XCTestCase { | |||
]) | |||
try tempFolder.write(to: URL(fileURLWithPath: NSTemporaryDirectory().appending(UUID().uuidString))) | |||
|
|||
let socketURL = URL(fileURLWithPath: "/var/tmp").appendingPathComponent(UUID().uuidString).appendingPathExtension("sock") | |||
let socketURL = URL(fileURLWithPath: FileManager.default.temporaryDirectory.path).appendingPathComponent(UUID().uuidString).appendingPathExtension("sock") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No /var/tmp
on Android.
Hi @buttaface- thank you so much for opening this! It looks great overall and I’m excited to land support here.
DocC’s Just so you’re aware, we’re currently working on landing Swift-DocC in the nightly toolchain builds produced by Swift.org (swiftlang/swift#39723), so I think we’ll likely want to hold off on merging this (and the other PR you opened) until we finalize that work. But would love to land this PR immediately afterwards. Thank you again! |
@swift-ci please test |
Yes, I was surprised to see that. 😄 I have only built this repo with the Termux Swift toolchain as detailed above, not with your Python script. I will try it with your script later and submit a separate pull for that.
I simply modified No problem on waiting till this gets into the trunk toolchain, looks like the linux CI is broken right now. |
The Linux CI is broken tracked by the SR https://bugs.swift.org/browse/SR-15362 and is now fixed into main branch of Swift. Will be fix on Linux CI once the next snapshot is released. (Usually a few days to a week time) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @buttaface! This looks great.
As, @Kyle-Ye mentioned, the Linux builds are currently failing because of https://bugs.swift.org/browse/SR-15362. Once that has landed in a toolchain I will rerun the tests.
I’ll then merge this PR once CI has passed and we’ve merged the integration of Swift-DocC in the Toolchain with swiftlang/swift#39723.
The new Toolchain is landed. Please solve the conflict and we can test again. @buttaface |
Rebased and ready for CI. |
@swift-ci please test |
@swift-ci please test |
Thank you again @buttaface! I think we are good to merge. |
Summary
This pull gets this repo to build natively on Android and pass all its tests.
Dependencies
None
Testing
Install the Termux app on an Android phone or tablet, install the Swift 5.5 and git packages with
pkg install git swift
, clone this repo, and runswift test -j 9
as you would elsewhere.Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/test
script and it succeededSince this pull mostly consists of adding conditional compilation checks for Android where needed, let me point out where I didn't add them:
In addition, I ran all the tests on Android first and only disabled the tests that failed, so three tests that are disabled for Linux in
ConvertServiceTests.swift
and eight tests inNavigatorIndexTests.swift
are enabled for Android. There's a strange issue where if I run the tests in parallel, twoLogHandle
tests fail only because they're grabbing extra lines fromstdout
, which may be an XCTest bug.When I run the tests serially, it reports all 976 tests passing.