Skip to content
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

xcbuild refactor #43256

Merged
merged 3 commits into from Jul 9, 2018
Merged

xcbuild refactor #43256

merged 3 commits into from Jul 9, 2018

Conversation

matthewbauer
Copy link
Member

@matthewbauer matthewbauer commented Jul 9, 2018

Refactors xcbuild to better emulate the real Xcodebuild. Hoping to use this to get rid of some of the "no-xcode" patches that exist in Nixpkgs.

I have a branch with some fixes for bazel as well but want to get these infrastructure things included first.

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: xcbuild

Partial log (click to expand)

building path(s) ‘/nix/store/hnay13k4djxn30lyaccfm7yqqw5zmadc-xcode-select’
building path(s) ‘/nix/store/fqf6lvx1n2xfvjjwcrsfn5jqnsw11bdh-Platforms’
building path(s) ‘/nix/store/iivsi2ak9wi6p0i3awrf011rc7kxvwk2-xcrun’
building path(s) ‘/nix/store/i5kls4ym31b6qrgf1c9ars5d0f117ylg-xcodebuild-0.1.2-pre’
shrinking RPATHs of ELF executables and libraries in /nix/store/i5kls4ym31b6qrgf1c9ars5d0f117ylg-xcodebuild-0.1.2-pre
patching script interpreter paths in /nix/store/i5kls4ym31b6qrgf1c9ars5d0f117ylg-xcodebuild-0.1.2-pre
/nix/store/i5kls4ym31b6qrgf1c9ars5d0f117ylg-xcodebuild-0.1.2-pre/bin/xcrun: interpreter directive changed from "/usr/bin/env sh" to "/nix/store/8zkg9ac4s4alzyf4a8kfrig1j73z66dw-bash-4.4-p23/bin/sh"
/nix/store/i5kls4ym31b6qrgf1c9ars5d0f117ylg-xcodebuild-0.1.2-pre/bin/xcode-select: interpreter directive changed from "/usr/bin/env sh" to "/nix/store/8zkg9ac4s4alzyf4a8kfrig1j73z66dw-bash-4.4-p23/bin/sh"
checking for references to /tmp/nix-build-xcodebuild-0.1.2-pre.drv-0 in /nix/store/i5kls4ym31b6qrgf1c9ars5d0f117ylg-xcodebuild-0.1.2-pre...
/nix/store/i5kls4ym31b6qrgf1c9ars5d0f117ylg-xcodebuild-0.1.2-pre

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: xcbuild

Partial log (click to expand)

building '/nix/store/cvxgvr63rna4zsbqkbzhwmdf12ys539j-SDKs.drv'...
building '/nix/store/q9678dx338xzn9k151zv2czcz9xmjl97-Platforms.drv'...
building '/nix/store/9bjjnxga50khbg3k476aviwrixlir7ac-xcrun.drv'...
building '/nix/store/917s1d885pyn5jk883q4pfvblxwyr290-xcodebuild-0.1.2-pre.drv'...
shrinking RPATHs of ELF executables and libraries in /nix/store/rh4f9c9nnq7qc2c7b0923d49p8vimici-xcodebuild-0.1.2-pre
patching script interpreter paths in /nix/store/rh4f9c9nnq7qc2c7b0923d49p8vimici-xcodebuild-0.1.2-pre
/nix/store/rh4f9c9nnq7qc2c7b0923d49p8vimici-xcodebuild-0.1.2-pre/bin/xcrun: interpreter directive changed from "/usr/bin/env sh" to "/nix/store/p0vy17dp9jk2mvqsxsqnb14s3797lay7-bash-4.4-p23/bin/sh"
/nix/store/rh4f9c9nnq7qc2c7b0923d49p8vimici-xcodebuild-0.1.2-pre/bin/xcode-select: interpreter directive changed from "/usr/bin/env sh" to "/nix/store/p0vy17dp9jk2mvqsxsqnb14s3797lay7-bash-4.4-p23/bin/sh"
checking for references to /build in /nix/store/rh4f9c9nnq7qc2c7b0923d49p8vimici-xcodebuild-0.1.2-pre...
/nix/store/rh4f9c9nnq7qc2c7b0923d49p8vimici-xcodebuild-0.1.2-pre

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: xcbuild

Partial log (click to expand)

building '/nix/store/2mkpn4b2xlv8ka5irfy7z2yizqvjhb11-SDKs.drv'...
building '/nix/store/s597d30001q8plycprlgzzdwqqdwhws0-version.plist.drv'...
building '/nix/store/kaxz24y97c65mi8r8nnqysyp7gjg00q7-xcode-select.drv'...
building '/nix/store/yls4jpsx0ijwpc3cac10j54vxdc8inil-Platforms.drv'...
building '/nix/store/lx15lna7s90ak2zj237ll14g6fs4vxrq-xcrun.drv'...
building '/nix/store/cya0kqsx1b96xh4jh18mms4r36bws26w-xcodebuild-0.1.2-pre.drv'...
patching script interpreter paths in /nix/store/7qq00xrh2ncj0aix75p39akdvi8fdvnc-xcodebuild-0.1.2-pre
/nix/store/7qq00xrh2ncj0aix75p39akdvi8fdvnc-xcodebuild-0.1.2-pre/bin/xcode-select: interpreter directive changed from "/usr/bin/env sh" to "/nix/store/q2wqq1k20v8kc3vckapqf5nws30brnni-bash-4.4-p23/bin/sh"
/nix/store/7qq00xrh2ncj0aix75p39akdvi8fdvnc-xcodebuild-0.1.2-pre/bin/xcrun: interpreter directive changed from "/usr/bin/env sh" to "/nix/store/q2wqq1k20v8kc3vckapqf5nws30brnni-bash-4.4-p23/bin/sh"
/nix/store/7qq00xrh2ncj0aix75p39akdvi8fdvnc-xcodebuild-0.1.2-pre

@matthewbauer
Copy link
Member Author

matthewbauer commented Jul 9, 2018

@GrahamcOfBorg build darwin.adv_cmds unixtools

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: unixtools

The following builds were skipped because they don't evaluate on aarch64-linux: darwin.adv_cmds

Partial log (click to expand)

/nix/store/i1y673pinr5s11cncq32rxm9w7sqwlmi-quota-1003.1-2008
/nix/store/vw8201wl0w2agdj0z3y6byvspvn3c1av-route-1003.1-2008
/nix/store/h47937jhmw2p2w2xfw2s8lmssg046svn-script-1003.1-2008
/nix/store/x59ljw2cff9a6578bxd9519g4r0rhnqq-sysctl-1003.1-2008
/nix/store/b3chahpsm400n4c2jva25zak30mnpz2i-top-1003.1-2008
/nix/store/qxj271ljcpynhmkqb3rrvbdlpmnvlc9g-umount-1003.1-2008
/nix/store/v4ll1czym454xx10lp0r8rkrrffr7wy6-utillinux-compat-1003.1-2008
/nix/store/44rppvribxw5z3syrhava7z8rcsqhh6j-wall-1003.1-2008
/nix/store/m7lq0j1pcrf2i5h69js2626h7kygyl71-whereis-1003.1-2008
/nix/store/iwsmrih0b45pw3qjkgz9hmblkfn283fc-write-1003.1-2008

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: unixtools

The following builds were skipped because they don't evaluate on x86_64-linux: darwin.adv_cmds

Partial log (click to expand)

/nix/store/ym1il7bp772p4brdqid09aal14j864kd-quota-1003.1-2008
/nix/store/fx1jls0ww261lbifg74qqq4a0i8jhh8s-route-1003.1-2008
/nix/store/zs61iaqbb7gamnmj5plyjpbh2sn8dk3v-script-1003.1-2008
/nix/store/6qs9xp2fj1l8z9xf48slr0lz67lynbvg-sysctl-1003.1-2008
/nix/store/i3h8wlbxxfjpsm6a333i0gjkyg6yi0rf-top-1003.1-2008
/nix/store/hm07rg2l45sdpyxcg3x88qnzv3ah2r5j-umount-1003.1-2008
/nix/store/gp6d5daxi5rlrklpwg91c4f9ykym9v1b-utillinux-compat-1003.1-2008
/nix/store/4j2462ka0h370r7p7hnxjy6ir2gqb3l8-wall-1003.1-2008
/nix/store/jzzfak5cy9crbkvybmmxzhm03dwirzm4-whereis-1003.1-2008
/nix/store/8jkmsijazvznv22kk9nz2991qaldk46w-write-1003.1-2008

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: darwin.adv_cmds

The following builds were skipped because they don't evaluate on x86_64-darwin: unixtools

Partial log (click to expand)

    export PATH=/nix/store/g09k9js3anfbcg43zqs4yq8zvcdcw7y4-Platforms/MacOSX.platform/Developer/usr/bin:/nix/store/g09k9js3anfbcg43zqs4yq8zvcdcw7y4-Platforms/MacOSX.platform/usr/local/bin:/nix/store/g09k9js3anfbcg43zqs4yq8zvcdcw7y4-Platforms/MacOSX.platform/usr/bin:/nix/store/g09k9js3anfbcg43zqs4yq8zvcdcw7y4-Platforms/MacOSX.platform/usr/local/bin:/nix/store/k20kg2m6b1qnrm95b87fis5767cmaziy-Toolchains/XcodeDefault.xctoolchain/usr/bin:/nix/store/k20kg2m6b1qnrm95b87fis5767cmaziy-Toolchains/XcodeDefault.xctoolchain/usr/libexec:/nix/store/7qq00xrh2ncj0aix75p39akdvi8fdvnc-xcodebuild-0.1.2-pre/usr/bin:/nix/store/7qq00xrh2ncj0aix75p39akdvi8fdvnc-xcodebuild-0.1.2-pre/usr/local/bin:/nix/store/7qq00xrh2ncj0aix75p39akdvi8fdvnc-xcodebuild-0.1.2-pre/Tools:/nix/store/7qq00xrh2ncj0aix75p39akdvi8fdvnc-xcodebuild-0.1.2-pre/bin:/nix/store/k20kg2m6b1qnrm95b87fis5767cmaziy-Toolchains/XcodeDefault.xctoolchain/usr/bin:/nix/store/ckq71kkymh1ji2b44xn80wmr7fmi6wr5-clang-wrapper-5.0.2/bin:/nix/store/bcl9zj60h52p47dy85s326mdrqx52417-clang-5.0.2/bin:/nix/store/5q51r2d0xzs4hi8rb661drpf83mhm4b4-coreutils-8.29/bin:/nix/store/qk4fdnzkr8r0gihgyps7x07cpyffvkmy-cctools-binutils-darwin-wrapper/bin:/nix/store/7ddbq63v97nk8gkbf7gcsfmby37h6gbl-cctools-binutils-darwin/bin:/nix/store/qr7cj3ip4anzjqx4xgs228jb22zjvc7g-ncurses-6.1-dev/bin:/nix/store/3mrldk4v82yjzh2ycnx8wnycpqmahar8-ncurses-6.1/bin:/nix/store/58xlgxhyzypr382m9fln821adlz4v2kr-findutils-4.6.0/bin:/nix/store/7v2pjilrdvy68a6xrvw72yifqx395x42-diffutils-3.6/bin:/nix/store/kbgg9i4gd3f0n2418yww8s4grqx37gak-gnused-4.5/bin:/nix/store/g9b1s04vm9fwb67hr5zfva3lq52wjdrc-gnugrep-3.1/bin:/nix/store/9plisrv0jva3wq0m5fj2b4nfr42p1858-gawk-4.2.1/bin:/nix/store/cj0pwxwmzfsq4mwjfsiw1aqgq7458v1q-gnutar-1.30/bin:/nix/store/dglgzx6kc2r0ifmxcsrkcr9xy1rnihgj-gzip-1.9/bin:/nix/store/d7nz5zrga643vj72vwnqf4zkig8wlxm9-bzip2-1.0.6.0.1-bin/bin:/nix/store/bgx7fdb9rjwwq4dcyw08a300w43mw5hh-gnumake-4.2.1/bin:/nix/store/q2wqq1k20v8kc3vckapqf5nws30brnni-bash-4.4-p23/bin:/nix/store/va635mxp5cxn3ad1a4dpbp574p49m0mg-patch-2.7.6/bin:/nix/store/0l4wbb28gzc42gsd1xvsmmwc0770aqkc-xz-5.2.4-bin/bin
    /nix/store/k20kg2m6b1qnrm95b87fis5767cmaziy-Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil /private/tmp/nix-build-adv_cmds-osx-10.11.6.drv-0/adv_cmds-163/Products/Release/whois -o /private/tmp/nix-build-adv_cmds-osx-10.11.6.drv-0/adv_cmds-163/Products/Release/whois.dSYM

** BUILD SUCCEEDED **
installing
post-installation fixup
gzipping man pages under /nix/store/xlj670qap1y8ypj2yncizknwpzm34iq9-adv_cmds-osx-10.11.6/share/man/
strip is /nix/store/k20kg2m6b1qnrm95b87fis5767cmaziy-Toolchains/XcodeDefault.xctoolchain/usr/bin/strip
stripping (with command strip and flags -S) in /nix/store/xlj670qap1y8ypj2yncizknwpzm34iq9-adv_cmds-osx-10.11.6/bin
patching script interpreter paths in /nix/store/xlj670qap1y8ypj2yncizknwpzm34iq9-adv_cmds-osx-10.11.6

@matthewbauer
Copy link
Member Author

@GrahamcOfBorg build unixtools.procps unixtools.utillinux unixtools.nettools

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: unixtools.procps, unixtools.utillinux, unixtools.nettools

Partial log (click to expand)

building path(s) ‘/nix/store/4jj9kkch64ldxvgrn279sxigfgf34wsq-hexdump-1003.1-2008’
building path(s) ‘/nix/store/zs61iaqbb7gamnmj5plyjpbh2sn8dk3v-script-1003.1-2008’
building path(s) ‘/nix/store/hm07rg2l45sdpyxcg3x88qnzv3ah2r5j-umount-1003.1-2008’
building path(s) ‘/nix/store/jzzfak5cy9crbkvybmmxzhm03dwirzm4-whereis-1003.1-2008’
building path(s) ‘/nix/store/8jkmsijazvznv22kk9nz2991qaldk46w-write-1003.1-2008’
building path(s) ‘/nix/store/gp6d5daxi5rlrklpwg91c4f9ykym9v1b-utillinux-compat-1003.1-2008’
created 10 symlinks in user environment
/nix/store/yfkf5cx23pij9m4qpcirf5ib4ra1mfk7-procps-compat-1003.1-2008
/nix/store/gp6d5daxi5rlrklpwg91c4f9ykym9v1b-utillinux-compat-1003.1-2008
/nix/store/6ivc5apsky13dbg143m02kvdh68w07cf-nettools-compat-1003.1-2008

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: unixtools.procps, unixtools.utillinux, unixtools.nettools

Partial log (click to expand)

/nix/store/jdpf2nfv2pz5c11dgdq1s2mhw64595ln-procps-compat-1003.1-2008
/nix/store/v4ll1czym454xx10lp0r8rkrrffr7wy6-utillinux-compat-1003.1-2008
/nix/store/4sb9bp1a4qxskbmk56dp6860cd1rns9k-nettools-compat-1003.1-2008

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: unixtools.procps, unixtools.utillinux, unixtools.nettools

Partial log (click to expand)

building '/nix/store/8i3x32qhqdg8xwm6a799kpdykh212mba-top-1003.1-2008.drv'...
building '/nix/store/c6rinwmknnq9n5f045qq5ywzc9zc4pd0-whereis-1003.1-2008.drv'...
building '/nix/store/rsykld71gfqjyxs4mmpp62w9k55b07xm-procps-compat-1003.1-2008.drv'...
created 3 symlinks in user environment
building '/nix/store/ndxdmvymrr2xx0x61ycs22bfvhks2dh9-write-1003.1-2008.drv'...
building '/nix/store/32z95wpigr62145zs4smcj70n2ibkjfm-utillinux-compat-1003.1-2008.drv'...
created 10 symlinks in user environment
/nix/store/m7zkn6k0prq358w8npi18ac9q14zaq49-procps-compat-1003.1-2008
/nix/store/wynnis9wq308qxmq8i2mmpskv40y7y0v-utillinux-compat-1003.1-2008
/nix/store/8rymfs7j9rv2194n2djxjjl20alrhif8-nettools-compat-1003.1-2008

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.
Not every package that needs xcbuild will want to use its build phase.
I have moved the xcbuild setup hook to the new attribute xcbuildHook.
This means that dontUseXcbuild is no longer needed. If you just need
to call xcbuild on its own you can just refer to xcbuild.
You can now refer to it as xcodebuild. This is meant to be more
discoverable for not familiar with xcbuild. xcodebuild should work in
the same way as the xcodebuild that comes with Xcode.app, but it is
built entirely with free software.
@matthewbauer matthewbauer merged commit 81f78e6 into NixOS:master Jul 9, 2018
@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: xcbuild

Partial log (click to expand)

/nix/store/rh4f9c9nnq7qc2c7b0923d49p8vimici-xcodebuild-0.1.2-pre

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: xcbuild

Partial log (click to expand)

building '/nix/store/kbcmr54pn9divdpags6lwwcl3jp3anpb-Toolchains.drv'...
building '/nix/store/syrd7q813vxnwrzw3mdg37wqjr6dl9al-Platforms.drv'...
building '/nix/store/iamrgdx9l7ldabhw952jld2ca4zlxcn8-xcrun.drv'...
building '/nix/store/qk7k31qa07rj5kng5c5dd8pb214zbxn2-xcodebuild-0.1.2-pre.drv'...
shrinking RPATHs of ELF executables and libraries in /nix/store/i5kls4ym31b6qrgf1c9ars5d0f117ylg-xcodebuild-0.1.2-pre
patching script interpreter paths in /nix/store/i5kls4ym31b6qrgf1c9ars5d0f117ylg-xcodebuild-0.1.2-pre
/nix/store/i5kls4ym31b6qrgf1c9ars5d0f117ylg-xcodebuild-0.1.2-pre/bin/xcode-select: interpreter directive changed from "/usr/bin/env sh" to "/nix/store/8zkg9ac4s4alzyf4a8kfrig1j73z66dw-bash-4.4-p23/bin/sh"
/nix/store/i5kls4ym31b6qrgf1c9ars5d0f117ylg-xcodebuild-0.1.2-pre/bin/xcrun: interpreter directive changed from "/usr/bin/env sh" to "/nix/store/8zkg9ac4s4alzyf4a8kfrig1j73z66dw-bash-4.4-p23/bin/sh"
checking for references to /build in /nix/store/i5kls4ym31b6qrgf1c9ars5d0f117ylg-xcodebuild-0.1.2-pre...
/nix/store/i5kls4ym31b6qrgf1c9ars5d0f117ylg-xcodebuild-0.1.2-pre

@copumpkin
Copy link
Member

@matthewbauer ❤️

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: xcbuild

Partial log (click to expand)

/nix/store/7qq00xrh2ncj0aix75p39akdvi8fdvnc-xcodebuild-0.1.2-pre

@matthewbauer matthewbauer deleted the xcbuild-refactor branch February 22, 2019 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants