-
Notifications
You must be signed in to change notification settings - Fork 189
State of project on Linux #37
Comments
Right now, xcbuild runs and passes its tests on Linux, but it's only a small piece of what you'd actually need to build. A more complete list is below, but even that hasn't been tested in full. Linux support is definitely still a work-in-progress, but is a part of xcbuild we'll continue to develop on.
You'd need to arrange all of those into a Developer directory, roughly structured to match what xcbuild expects. Then, set the |
Thanks for your detailed answer. As far as I see, the weakest point is the .xctoolchain (2). By a quick googling I've found this: https://github.com/tpoechtrager/osxcross Maybe it'd be helpful for others to indicate the state of project on Linux in README (e.g. a link pointing your comment). :) |
FWIW, I've managed to set up a partially functional xcodebuild environment on linux. What I do is basically this:
Instead of vanilla clang, one could also try building e.g. https://opensource.apple.com/tarballs/clang/clang-703.0.31.tar.gz, but this fails building for me. Large sections of the Xcode app bundle can be stripped out to save disk space. You basically need As for the toolchain binaries, I've made When using vanilla clang instead of the apple patched one, I've used a wrapper script like this:
The Apple haven't opensourced the version of I've got all of this wrapped up in a reusable dockerfile at https://github.com/mstorsjo/xcode-cross. It requires you to pack up a real Xcode installation and it only works with Xcode 9.2 or older though. Edit: Updated the clang wrapper script a little. Edit2: Mentioned that the tbd library format is possible to use these days, and pointed to a prepackaged version of all of this. |
Checking again, now that we are in 2019. The readme says that xcbuild runs on linux (and it does) but Xcode projects are not being build because of the following reasons:
The first and second points (the first one can be fixed, but the second I do not see how) make impossible to build a Xcode project on linux. @grp What do you think? Do you know anybody that managed to build a Xcode project on linux? |
Yes, I have. However it only works for certain projects that fit within the limitations (no interface builder/storyboards or assets) you mentioned. Works fine for certain CI tasks, but probably not very useful for a full modern app. An app that e.g. does everything the "manual" way of creating GUI via code might work. My setup just symlinks I updated my post about a linux setup though, with a reference to https://github.com/mstorsjo/xcode-cross, which has got an as-full-as-possible full version (without Xcode itself) of what I'm using, which should be possible to reproduce pretty easily. |
@mstorsjo awesome! Thanks for the fast response and the super useful insight |
@mstorsjo do your approach work with Xcode 10 and the new build system? I could not build and run xcbuild successfully in Mac Mohave, getting the issue asdescribed in #293 when building.
|
There's actually three orthogonal issues involved here:
|
@mstorsjo I wanted to know with your container version can you use xcbuild to do a "test". IE build a particular xcode project and then preform the build then test which installs and runs the app on the real iOS device? Thank you I thought I would ask prior to going through the setup. |
I haven't tried that, and I doubt that it works. Even outside of xcbuild, I haven't dug much into how well it is possible to install code on iOS devices from linux, and even if there is some solution for that, I don't think it's hooked up into xcbuild at the moment. |
@mstorsjo Thank you for your update and quick response. |
Looks like newer tapi versions have been posted to opensource.apple.com hopefully that can help alleviate that particular problem: https://opensource.apple.com/tarballs/tapi/ someone made a github mirror as well https://github.com/tpoechtrager/apple-libtapi |
Yes - I've taken that into use in my packaged linux setup of it all at https://github.com/mstorsjo/xcode-cross. It currently works well for both Xcode 9.3 and Xcode 10. Xcode 11 however seems to require quite a bit of fixes to xcbuild (which I unfortunately haven't gotten round to posting issues for). |
awesome 👍 glad to hear it. EDIT: i updated my setup locally with the new tapi libraries and everything works properly noe as well with newer tbd files. still need to get xcbuild paths setup next though. |
It's not entirely clean for me how it can be used on Linux.
Should I copy the necessary Apple SDKs to somewhere on the Linux machine? If not, where Cocoa symbols come from?
Thanks!
The text was updated successfully, but these errors were encountered: