Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upPort to Android #1442
Conversation
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
1ace
Feb 25, 2016
First off, thank you for this awesome work!
I haven't read much of it yet, but I just wanted to mention one thing: I think you should try to separate changes in multiple commits as much as possible to make it more digestible. That will help reviewers by letting them focus on related changes before moving on to the next commit.
My personal rule is: if you make sense to be between those two changes (ie. have one but not the other), put them in separate commits. You should obviously order those commits in a way that ensures you don't use features before adding them. For instance, the last commit should be the one adding the new target to utils/build-script once everything else is ready.
1ace
commented
Feb 25, 2016
|
First off, thank you for this awesome work! My personal rule is: if you make sense to be between those two changes (ie. have one but not the other), put them in separate commits. You should obviously order those commits in a way that ensures you don't use features before adding them. For instance, the last commit should be the one adding the new target to |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
modocache
Feb 25, 2016
Collaborator
Thanks for the feedback, @1ace! I agree: this work depends on #1396, #1410, #1426, #1395, #1334, which I've issued separately to make them easier to review. Unfortunately, GitHub falls apart with a dependent stack of commits, such as this pull request would end up being. I think you'll find other ports, such as Cygwin #1108, end up being similarly large.
The problem is that all of these changes are directly related to Android. Take the os(Android) definition, for example: I don't think it would make sense for the Swift maintainers to merge a pull request that added #if os(Android) ... #endif before Swift can even be built for Android. Phabricator would allow users to specify that the commit adding os(Android) is dependent upon the commit that adds Android options to CMakeLists.txt, and so forth. GitHub has no such system of specifying dependencies, and encourages large pull requests like this one.
Of course, if the review unearths more pieces I can split out into separate pull requests, I'll definitely do so!
|
Thanks for the feedback, @1ace! I agree: this work depends on #1396, #1410, #1426, #1395, #1334, which I've issued separately to make them easier to review. Unfortunately, GitHub falls apart with a dependent stack of commits, such as this pull request would end up being. I think you'll find other ports, such as Cygwin #1108, end up being similarly large. The problem is that all of these changes are directly related to Android. Take the Of course, if the review unearths more pieces I can split out into separate pull requests, I'll definitely do so! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
avaidyam
Feb 25, 2016
@modocache @zhuowei @ephemer Awesome job! I've been watching this since possibly day one.
avaidyam
commented
Feb 25, 2016
|
@modocache @zhuowei @ephemer Awesome job! I've been watching this since possibly day one. |
gribozavr
reviewed
Feb 25, 2016
| @@ -105,6 +106,8 @@ std::pair<bool, bool> LangOptions::setTarget(llvm::Triple triple) { | ||
| addPlatformConditionValue("os", "watchOS"); | ||
| else if (triple.isiOS()) | ||
| addPlatformConditionValue("os", "iOS"); | ||
| else if (triple.isAndroid()) | ||
| addPlatformConditionValue("os", "Android"); |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
gribozavr
Feb 25, 2016
Collaborator
This change needs a test like test/Parse/ConditionalCompilation/x64FreeBSDTarget.swift for each supported triple.
gribozavr
Feb 25, 2016
Collaborator
This change needs a test like test/Parse/ConditionalCompilation/x64FreeBSDTarget.swift for each supported triple.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
modocache
Mar 14, 2016
Collaborator
Done! I added test/Parse/ConditionalCompilation/armAndroidTarget.swift.
modocache
Mar 14, 2016
Collaborator
Done! I added test/Parse/ConditionalCompilation/armAndroidTarget.swift.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
@swift-ci Please smoke test |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
gribozavr
Feb 25, 2016
Collaborator
@modocache There seem to be build issues on Linux x86_64, please take a look when you have a moment.
|
@modocache There seem to be build issues on Linux x86_64, please take a look when you have a moment. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jckarter
Feb 25, 2016
Member
Looks like <mutex> is missing from the target C++ standard library:
In file included from /home/buildnode/jenkins/workspace/swift-PR-Linux/swift/stdlib/public/runtime/HeapObject.cpp:17:
/home/buildnode/jenkins/workspace/swift-PR-Linux/swift/include/swift/Basic/Lazy.h:19:10: fatal error: 'mutex' file not found
#include <mutex>
^
|
Looks like
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
DCRichards
Feb 25, 2016
this is really cool, I've never seen a 52 file change commit though, good lord!
DCRichards
commented
Feb 25, 2016
|
this is really cool, I've never seen a 52 file change commit though, good lord! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
modocache
Feb 25, 2016
Collaborator
I'm working on addressing the feedback--thanks so much for the review, @gribozavr!
In the meantime, if anyone out there wants to help with this pull request, here's the output from the test suite: https://gist.github.com/modocache/48babfa768d495806116. Six tests are failing.
Some of those failures, like IRGen/objc_simd.sil, could be addressed outside of this pull request (for that test specifically, check out some of my notes in SwiftAndroid#16).
|
I'm working on addressing the feedback--thanks so much for the review, @gribozavr! In the meantime, if anyone out there wants to help with this pull request, here's the output from the test suite: https://gist.github.com/modocache/48babfa768d495806116. Six tests are failing. Some of those failures, like |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
lattner
Feb 25, 2016
Collaborator
@modocache This is really awesome to see, thank you for working on it. Per the previous comment, if you can split this up into smaller PR's, that will make it easier to review and merge piecemeal.
|
@modocache This is really awesome to see, thank you for working on it. Per the previous comment, if you can split this up into smaller PR's, that will make it easier to review and merge piecemeal. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
practicalswift
Feb 25, 2016
Collaborator
@modocache Excellent stuff! Keep those great contributions coming
|
@modocache Excellent stuff! Keep those great contributions coming |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
unsign3d
commented
Feb 25, 2016
|
Excellent work, I'm looking forword to use it o.o |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
b3ll
commented
Feb 26, 2016
|
Keep up the great work @modocache! :D |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
pbassut
commented
Feb 26, 2016
|
Great work! @modocache |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
domdomegg
commented
Feb 27, 2016
|
Good work @modocache |
modocache
referenced this pull request
Feb 28, 2016
Merged
Refactor code duplication in inspecting dylibs #1466
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
modocache
Mar 1, 2016
Collaborator
For those following this pull request:
- I'm busy with other stuff this week, but will address feedback (like splitting this up) next week.
- In the meantime, I'll rebase this work onto apple/swift master each morning (US time), and confirm it all still works for me.
- If you'd like to help me address feedback, send pull requests to SwiftAndroid/swift's
masterbranch. - I don't mind +1 comments, but not everyone likes them. Let's hold off on those!
😅
|
For those following this pull request:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
JesseScott
Mar 3, 2016
Enough congratulations people! I'm as excited about this as anyone, but either offer to help or stop spamming this issue with
JesseScott
commented
Mar 3, 2016
|
Enough congratulations people! I'm as excited about this as anyone, but either offer to help or stop spamming this issue with |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
gribozavr
Mar 10, 2016
Collaborator
Here I've decided to:
- Remove the #define uselocale(a), since that function is available on API 21 (which this work is now based upon).
- Convert tabs to spaces.
- Preserve the definitions of strtod_l and friends here, since they're unavailable on Android.
Does that sound reasonable? Of course we can always improve upon this in the future.
SGTM! Thanks, @modocache!
SGTM! Thanks, @modocache! |
added a commit
to modocache/swift
that referenced
this pull request
Mar 14, 2016
modocache
referenced this pull request
Mar 14, 2016
Merged
[Glibc] Configure modulemap for target, not host #1679
added a commit
to modocache/swift
that referenced
this pull request
Mar 14, 2016
added a commit
to SwiftAndroid/swift
that referenced
this pull request
Mar 14, 2016
added a commit
to SwiftAndroid/swift
that referenced
this pull request
Mar 14, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
phasuksmit
commented
Apr 13, 2016
|
just 'wow' |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
jblorenzo
commented
Apr 13, 2016
|
very promising |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
GreyEcologist
commented
Apr 13, 2016
|
congrats! This is exciting stuff! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ephemer
Apr 13, 2016
@modocache @zhuowei @jrose-apple @gribozavr thank you all for your awesome work, looking forward to continuing with this
ephemer
commented
Apr 13, 2016
|
@modocache @zhuowei @jrose-apple @gribozavr thank you all for your awesome work, looking forward to continuing with this |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rileytestut
commented
Apr 13, 2016
|
Amazing!! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
zakrid
commented
Apr 13, 2016
|
Absolutely terrific work from everyone involved! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
freak4pc
Apr 13, 2016
Incredible effort from all! Beautiful work! Looking forward to seeing this move further.
freak4pc
commented
Apr 13, 2016
|
Incredible effort from all! Beautiful work! Looking forward to seeing this move further. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
kleinlieu
commented
Apr 13, 2016
|
Wow, we just witnessed history in the making. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
zakrid
Apr 13, 2016
@kleinlieu true! Watch the media/news pick this up in a few days and milk it for weeks
zakrid
commented
Apr 13, 2016
|
@kleinlieu true! Watch the media/news pick this up in a few days and milk it for weeks |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
wxyyxc1992
commented
Apr 14, 2016
|
Anticipated |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
lovemo
commented
Apr 14, 2016
|
great |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
kiban18
commented
Apr 14, 2016
|
Amazing!! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
vapor99
commented
Apr 14, 2016
|
Whoah! Very nice! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Ir1d
commented
Apr 14, 2016
|
Congrats! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
wangxuguo
commented
Apr 14, 2016
|
I'm out? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
kewang
Apr 14, 2016
Today's Big Thing !!!
- Kobe last game
- Warriors 73 wins
- Swift accepted "Port to Android" PR
kewang
commented
Apr 14, 2016
|
Today's Big Thing !!!
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
cHaLkdusT
commented
Apr 14, 2016
|
This is exciting! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
meeDamian
Apr 14, 2016
Unsubscribbling, because spam. Can someone close, to pipe comments into, comfortably silent, reaction emojis? Also, fantastic work!
meeDamian
commented
Apr 14, 2016
|
Unsubscribbling, because spam. Can someone close, to pipe comments into, comfortably silent, reaction emojis? Also, fantastic work! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
JingweiWang
commented
Apr 14, 2016
|
OMG, I think I must to learn Swift. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
yichengchen
commented
Apr 14, 2016
|
Exciting! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
nolim1t
commented
Apr 14, 2016
|
Good work @modocache |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
consbulaquena
commented
Apr 14, 2016
|
Congratulations! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
nishantpractoios
commented
Apr 14, 2016
|
Exciting ! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
AlwaysTyping
commented
Apr 14, 2016
|
66666666666 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rafaelwkerr
commented
Apr 14, 2016
|
Awesome |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
conqueror
commented
Apr 14, 2016
|
Great news |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
shige0501
commented
Apr 15, 2016
|
Good job! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
swiftc-org
commented
Apr 15, 2016
|
Nice work! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Geno1024
commented
Apr 15, 2016
|
Excellent! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
dodola
commented
Apr 15, 2016
|
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
AniOSDeveloper
commented
Apr 16, 2016
|
Good job! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ray26
commented
Apr 16, 2016
|
6666 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
andrekandore
commented
Apr 16, 2016
|
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
justinoboyle
commented
Apr 17, 2016
|
Great work. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
otymartin
commented
Apr 17, 2016
•
|
I just want to put my mark on this |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
istx25
Apr 18, 2016
Wow! Fantastic news. I'm excited to play around with this. Congrats to everyone involved. Your work is appreciated. 👏🏼👏🏼
istx25
commented
Apr 18, 2016
|
Wow! Fantastic news. I'm excited to play around with this. Congrats to everyone involved. Your work is appreciated. 👏🏼👏🏼 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
chenp-fjnu
Apr 19, 2016
It's one very good new for developers, for many companies, they have IOS and Android version for every application, it will reduce the effort. Xamarin is another option, but Linux based system should support swift well. I love Swift. Wish it will become usable for real case soon.
chenp-fjnu
commented
Apr 19, 2016
•
|
It's one very good new for developers, for many companies, they have IOS and Android version for every application, it will reduce the effort. Xamarin is another option, but Linux based system should support swift well. I love Swift. Wish it will become usable for real case soon. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
refinedKing
commented
Apr 19, 2016
|
Good Job !!! |
modocache commentedFeb 25, 2016
What's in this pull request?
This adds an Android target for the stdlib. It is also the first example of cross-compiling outside of Darwin: a Linux host machine builds for an Android target.
Relevant mailing list discussions:
The Android variant of Swift may be built and tested using the following
build-scriptinvocation:Android builds have the following dependencies, as can be seen in the build script invocation:
build.shscript in that repository.What's worth discussing about this pull request?
Continuous integration: I'd be thrilled to have this merged into the main Swift repository, but I don't want to dump a bunch of code that no one can maintain. I think CI is a very important part of maintaining a healthy build, but:
Do either of those sound like something CI servers could be configured with? Or can someone help me think of alternatives--perhaps building libicu as part of the Swift build, as we do with
ninja? #1398 includes some pkg-config logic that may be useful here.FIXMEs: There are quite a few spots labeled "FIXME" that I could use some help with. Feedback welcome!
Thanks a ton to @zhuowei, who deserves the vast majority of the credit. I just tweaked a few things.😊