"Real" xcodebuild allows using `xcodebuild -version -sdk` without
an sdk version argument, which will dump sdk info for all the
installed sdks.
Bazel"s "xcode cc toolchain setup on mac" process uses this
to determine which SDK version is actually installed. This
change allows using a nix-supplied pinned compiler and build
system under bazel.
Whenever we create scripts that are installed to $out, we must use runtimeShell
in order to get the shell that can be executed on the machine we create the
package for. This is relevant for cross-compiling. The only use case for
stdenv.shell are scripts that are executed as part of the build system.
Usages in checkPhase are borderline however to decrease the likelyhood
of people copying the wrong examples, I decided to use runtimeShell as well.
sometimes we want the "SDK" version from xcbuild so we do something
like:
$ xcbuild -version -sdk MacOSX10.10
SDKSettings.plist - MacOSX10.10 (MacOSX10.10)
SDKVersion: 10.10
Path: /nix/store/6k7crm1n4drf09ga0dwvbmb59x4zl2i2-SDKs/MacOSX10.10.sdk
PlatformPath: /nix/store/vhfwb1znfy65s2xs27j8xribk6mp6lbw-Platforms/MacOSX.platform
ProductName: Mac OS X
ProductVersion: 10.10
This was previously overriden by the current xcode version so you
would get:
Xcode 9.4.1
Build version 17E189
This should fix the other usage of -version in nodejs 6.x.
This reworks some of xcbuild logic to make it more compatible with
Apple’s SDK.
- Add a fake version of xcrun & xcode-select
- Cleanup platform generation. Clang does not like having 20 char
hashes in sysroot so it is much easier to just build the parent
directory for each runCommand. This is a little awkward but I have
renamed everything with an added ‘s’ to make the distinction more clear.
- Cleaned up wrapper.nix in some different ways
- Reuse some versioning logic so that we don’t end up with two
different versions of Xcode or SDK reported.
This is a good way to test that plist works.
Sorry for the large diff. There are a bunch of cleanups in here that
needed to be done. Should make it possible to use in cross
compilation.
This is in preparation for the LLVM 4 upgrade (which gets more strict
about e.g., return false in xcbuild itself) and also for using xcbuild
more extensively in the Darwin stdenv bootstrap process, which is why I
killed the unnecessary gcc dependency in the toolchain. llvm-cov pretends
to be gcov anyway, so we're fine.
Also updates xcbuild version.
This changes the raw string expressions into nix expressions that are
then converted into json by builtins.toJSON. Then, converted to Plist
XML by Apple's plutil. Sadly, xcbuild does not support using raw JSON
but Apple's plutil does so we just convert the file from JSON to XML
using Apple's plutil. The result is not ideal but it looks like all OS X
systems have working plutil's.
- set mac version to 10.10
- add setup hook.