-
Notifications
You must be signed in to change notification settings - Fork 27
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
[For discussion] Automated Travis CI (OS X) and Docker (Linux) builds #14
Conversation
Finding 1: The clang/llvm binary is OS-specific so it can't be assumed in the shell script that we will always use the Mac binary. Therefore I chose to extract LLVM installation from the shell script, and to run this platform-specific step in the Travis and Docker config files. |
Finding 2: There is a bizarre illegal instruction failure on OS X in the make install_packages routine deep in the compilation of both the device and simulator binaries of ghc-ios. The error is as follows:
If you try to use the (incomplete) built version of ghc-ios after this, you get this error:
Full trace available at https://travis-ci.org/themasterchef/ghc-ios-scripts/builds/54758122 |
Cool, good job ! |
A little digging via here suggests that "Illegal instruction: 4 usually indicates that there is a platform / compiler mismatch. [library] must be compiled with clang++ and not g++ on OS X." Sure enough, looking down the log of this failed build, as soon as it starts building ghc for iOS devices we see that GCC/G++ is being used somewhere...
...although curiously GNU ld is not being used:
If I have understood what the make process is doing correctly, ghc-ios-scripts might need some more overrides to force the use of clang in the Travis CI environment? |
This reverts commit a436212.
After more hackage, I have specifically removed the It is the same error as in this issue so could be related. |
More build system information... The Travis CI environment (where ghc-ios fails) gives us:
My own Mac Mini (where ghc-ios works) gives us:
Perhaps either the ghc cross compiler, or the bottom level ghc being used to compile it, are compiling using the OS X 10.10 Xcode SDK available on travis, and then trying to execute on 10.9 - which will fail. In which case a |
This reverts commit 995520f.
Good news:
Bad news:
|
@marciok how's your work on enabling a travis build getting along? I'm pretty much out of ideas on why this stubborn illegal instruction failure keeps popping its head up, as I don't know the ins and outs of GHC's build system particularly well. |
@themasterchef I haven't made any progress so far 😞 |
Good news - it looks like the Travis team may be introducing OS X Yosemite on its Mac build system very soon (maybe even next week - see http://blog.travis-ci.com/2015-04-09-this-week-in-travis-ci/ for information), which will allow us to identify whether this is a Mavericks specific issue. (If indeed the illegal instruction comes from 10.10 targeted code executing on 10.9, as opposed to say ARM targeted code on x86_64.) |
Conflicts: installGHCiOS.sh
@marciok I've had another go at this today, electing this time to build from the vanilla GHC source as the customised iOS GHC source is now far out of date. I then inject certain required things like build.mk from the installghcios.sh script after downloading the source. By the looks of travis, it gets much further through compiling the cross-compiler now, though there are some weird bugs:
Would be useful to know if I am just independently rediscovering the raft of errors you guys have already discovered when compiling vanilla GHC for iOS, or if I have found new and more interesting (promising?) errors. |
Closing due to inactivity |
I'm looking at starting an iOS app which makes heavy use of a Haskell library. To ensure some degree of sanity in the build process (i.e. avoiding having a temperamental process that only works on my dev box), and to take some of the work out of keeping up with the Haskell library as it gets updated over time, I want to automate at least part of the process of cross-compiling it for iOS. I expect others who are thinking of doing Haskell + iOS projects are thinking along the same lines.
Basically it would be nice (if possible) to have all the Haskell side of it hosted on a build server such that I can periodically grab an ARM/iOS build of the Haskell library off GitHub Releases, and stuff it in my Xcode project. (There are obviously prettier ways of doing this with dependency managers, but this would be a solid first step that would remove a lot of manual work.)
With this in mind there are 2 major target environments for ghc-ios automated builds:
The first step is to get ghc-ios compiling and running in either or both of these environments, such that it can compile a 'hello world' Haskell program. Which is what this PR contains.
I would appreciate comments, ideas, fixes etc on how exactly to proceed with this.
You can check out the current state of the automated builds at:
Note: a Travis CI build would be beneficial for you guys, as you could automatically validate submissions to this repository to see if they work, without applying the diff to a copy of ghc-ios on your own dev boxes manually.