Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Building Darwin stdenv with SDK 10.13

Getting stubs to work

After running generate-all in a local clone of NixOS/darwin-stubs and pointing the darwin stdenv at the generated stubs, I get a failure to create a symlink because it exists:

toonn@terra ~/s/nixpkgs> nix-build -A stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.darwin.Libsystem
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
these derivations will be built:
  /nix/store/5360mb77a3sck8n3034j20ynqqrh79jd-bootstrap-stage0-Libsystem.drv
building '/nix/store/5360mb77a3sck8n3034j20ynqqrh79jd-bootstrap-stage0-Libsystem.drv'...
ln: failed to create symbolic link '/nix/store/fp4sa206w5his9a9c2hzxi30irdh7bd4-bootstrap-stage0-Libsystem/lib/libSystem.tbd': File exists
builder for '/nix/store/5360mb77a3sck8n3034j20ynqqrh79jd-bootstrap-stage0-Libsystem.drv' failed with exit code 1
error: build of '/nix/store/5360mb77a3sck8n3034j20ynqqrh79jd-bootstrap-stage0-Libsystem.drv' failed

If I remove stubs/10.13/usr/lib/libSystem.tbd I just get a failure creating another symlink:

toonn@terra ~/s/nixpkgs> nix-build -A stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.darwin.Libsystem
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
these derivations will be built:
  /nix/store/pgakyc2l6429p0vcgca6g63b29vpvsiv-darwin-stubs-10.13.drv
  /nix/store/y6rsmz0alw23qfw158xd2psz86092wp4-bootstrap-stage0-Libsystem.drv
building '/nix/store/pgakyc2l6429p0vcgca6g63b29vpvsiv-darwin-stubs-10.13.drv'...
unpacking sources
unpacking source archive /nix/store/lf9ww474h7270d8p3ya2g29w20ngawzj-10.13
source root is 10.13
patching sources
configuring
no configure script, doing nothing
installing
post-installation fixup
building '/nix/store/y6rsmz0alw23qfw158xd2psz86092wp4-bootstrap-stage0-Libsystem.drv'...
ln: failed to create symbolic link '/nix/store/9mm82dlxwym6vlm026a1qg2gbz1y7spg-bootstrap-stage0-Libsystem/lib/libc.tbd': File exists
builder for '/nix/store/y6rsmz0alw23qfw158xd2psz86092wp4-bootstrap-stage0-Libsystem.drv' failed with exit code 1
error: build of '/nix/store/y6rsmz0alw23qfw158xd2psz86092wp4-bootstrap-stage0-Libsystem.drv' failed

This cat and mouse game simply continues, which makes me think maybe when generating the stubs I should not allow running of add-aliases.sh?

Looks like stdenv in nixpkgs does not expect the links to already be in place:

diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix
index c9aaad1b9d0..f24ae1dc03e 100644
--- a/pkgs/stdenv/darwin/default.nix
+++ b/pkgs/stdenv/darwin/default.nix
@@ -189,12 +189,6 @@ in rec {
             chmod -R +w $out/lib
             substituteInPlace $out/lib/libSystem.B.tbd --replace /usr/lib/system $out/lib/system
 
-            ln -s libSystem.B.tbd $out/lib/libSystem.tbd
-
-            for name in c dbm dl info m mx poll proc pthread rpcsvc util gcc_s.10.4 gcc_s.10.5; do
-              ln -s libSystem.tbd $out/lib/lib$name.tbd
-            done
-
             ln -s ${bootstrapTools}/lib/*.o $out/lib
 
             ln -s ${bootstrapTools}/lib/libresolv.9.dylib $out/lib

🐟 Stage 0 clang cannot create executables

I'd removed the libSystem.tbd (and libc.tbd) symlink from the local stubs directory I'm using while figuring out the previous issue.

Turns out this was a red herring.

Building stdenv:

toonn@terra ~/s/nixpkgs> nix-build -A stdenv
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
these derivations will be built:
  /nix/store/78v3cgff3mgnmfga87p47iqi01yd1r6s-pcre-8.44.drv
  /nix/store/dpdv5778rc5j017579ky39ywwy92kgaq-libiconv-50.drv
  /nix/store/yj4ri7hfb4mvv8gkasjvknwf21zs2m60-perl-5.32.1.drv
  /nix/store/bn81rqyzlznwa1yh9a68bs29c4wysffm-gnugrep-3.6.drv
  /nix/store/3iiszz8cv3ckf7vrpg6q3hq2kqix22kz-gnum4-1.4.18.drv
  /nix/store/b96f009bp9h065r2lp2xfiz6h212gz3k-gmp-6.2.1.drv
  /nix/store/yj24wymzr0h3a1ikbk8nxsj4sxvjz4f7-xz-5.2.5.drv
  /nix/store/xkkk96lj3z2mp4hm41m172rs2q8xngbv-coreutils-8.32.drv
  /nix/store/2vdn0vfs9l5h85jiwy3nzvkvkm27vqvv-darwin-stubs-10.13.drv
  /nix/store/4zqb85417bsbdjfhpf6ja472p8cxddhi-libffi-3.3.drv
  /nix/store/1cmc23pjk22kb9j0s1na29wcfdakkh2s-autoconf-2.70.drv
  /nix/store/kfxkm944hham0z4162cnbczqh1rz8yw6-automake-1.16.3.drv
  /nix/store/xx3a409fymwfwrzkl5d8n7xxrzwzi775-gettext-0.21.drv
  /nix/store/3yzbida566n6vs3apj9qnm4qv2p1p7v0-perl5.32.1-gettext-1.07.drv
  /nix/store/hlcf5zvqri6hblmxc6jy1jjsr2aq0r3a-help2man-1.47.17.drv
  /nix/store/kvaknrxsmxh4wh2mc1ckafadcwsbmg43-libtool-2.4.6.drv
  /nix/store/sgcshn0632kz9kz71wk95xh71ymjm4pc-hook.drv
  /nix/store/biv17h4rpx7cixq2dxh07wb4zz75zyd5-bzip2-1.0.6.0.1.drv
  /nix/store/6080qa1jnqqw56rsf05vgl4pjhy14pg4-bison-3.7.5.drv
  /nix/store/qrx4kx40v5zm1rcfwzhds6awkwh3nal7-texinfo-6.7.drv
  /nix/store/s8rwhjva4h3zyrivbr0fkphv4ql2f1z6-zlib-1.2.11.drv
  /nix/store/q36ppxvzrdqk8z2vi0cgaq4vzskm6mmh-binutils-2.35.1.drv
  /nix/store/yrgqywfajc47pcgilslx8pafyq535q3q-expand-response-params.drv
  /nix/store/jpjl7a4gsrv461h2pvgh98q37z5vacq1-binutils-wrapper-2.35.1.drv
  /nix/store/c4nnx3mr1a4znhv3gnkb90y5ylp7jpan-bash-4.4-p23.drv
  /nix/store/d43vxg63crvci2ysnp1yk877671sh84g-expat-2.2.10.drv
  /nix/store/rc76ysywjp1q5pdwq6378rah671q2zli-python-setup-hook.sh.drv
  /nix/store/sdyzx7bw1gb4s3ark1m44b8yhd5ar9hz-nuke-references.drv
  /nix/store/3rp2191pwy9f1asxnjdd826jh4ds900p-python3-minimal-3.8.8.drv
  /nix/store/jdl4vspf39i06xyskkfgl8ws5gx90841-unifdef-2.12.drv
  /nix/store/ppa3lfjb23jhry0m2qmrb4zw7mnrrmwz-flex-2.6.4.drv
  /nix/store/jx669m547w0ik6j70fy8dmg94zwhsbj3-bootstrap_cmds-121.drv
  /nix/store/awy0fvzbzys6v8cbp9cygqb03brin9gn-xnu-3789.70.16.drv
  /nix/store/8q0g1j1shyhc1vi631nkrz3lg4qhdlg8-IOKit-.drv
  /nix/store/kjrk6043l93ky64yfl2gf8m6asb1qj51-ppp-838.50.1.drv
  /nix/store/lg50sdddxx4rs6fril4677hpd2mqa5yb-Security-55471.14.18.drv
  /nix/store/3glhqpj2gd025p6d1dg5mq1z5fjw0r76-configd-453.19.drv
  /nix/store/s804xrl32hm83qnvr2v57bgmq9x5dzql-mDNSResponder-765.50.9.drv
  /nix/store/0bmh4bi8wyd6m03j2a7ah9wn6sw7xxbz-libresolv-64.drv
  /nix/store/r66r84467niq6d2bwi3vhcfxszqjl6kn-lzip-1.22.drv
  /nix/store/4gqbjx00svzbjdv0in091lvkm7869jc5-ed-1.17.drv
  /nix/store/2ss0nasv9yx4wybsdcc45g3db8dnhxpv-Libc-825.40.1.drv
  /nix/store/0ix4nz0pq92j6vbrf8w7dy2cjn8z7xr8-Libc-1158.50.2.drv
  /nix/store/96nqw0mh452xqxdrxvi9whhmvqzcmfgh-removefile-45.drv
  /nix/store/d1r94rz7rxpm8a1x6d9nw0dszxqar9zi-pkg-config-0.29.2.drv
  /nix/store/88wjfakhjj0gsqvlrd86drlpq1cqvhav-pkg-config-wrapper-0.29.2.drv
  /nix/store/aixcwy5ljl08k4nddnp05rh1ab36iyql-ncurses-6.2.drv
  /nix/store/g48vwdj992iqpmw84v9q453ndwv7l661-libpthread-218.60.3.drv
  /nix/store/g4cjgk32y6mlsnxs9jl056hc4zssfd24-hook.drv
  /nix/store/zh5p9fk22bfqkl5xxj5ygs21cjlz1raa-bsdmake-24.drv
  /nix/store/lh1d6naadivy9xzwxxjgp2xr3w6dby99-adv_cmds-119.drv
  /nix/store/gyvz5wwllybs11973rdyzgi3agrprjia-ps-1003.1-2008.drv
  /nix/store/78fs4bljyb9zg4qbz5cngwg6gpj5p089-cmake-boot-3.19.4.drv
  /nix/store/jcf7ajiiv484kgnprlpic9ad252i5228-libtapi-1100.0.11.drv
  /nix/store/r8z9f2m8h2c57rghvdqm12g1crcfz9j6-objc4-709.1.drv
  /nix/store/myvar5ynnh4f76136s1v0j07w23avdq0-cctools-port-949.0.1.drv
  /nix/store/n77cmzfj3g2f84nkp1yilwls7gy1qr4z-libutil-47.30.1.drv
  /nix/store/wz2q5w809rp6mly9a9qbqbwjd8j190fv-cpio-2.13.drv
  /nix/store/zil9aq5z5srw8ns055f6fq2ria4l9hsj-Libsystem-1238.60.2.drv
  /nix/store/h278mp48n17k2k04krqaimbvb6vdyk52-bootstrap-stage0-binutils-wrapper-.drv
  /nix/store/4a2f175l2mb6xskpcf69iwiaivzlkcl1-bootstrap-stage0-clang-wrapper-7.1.0.drv
  /nix/store/dyrh48sas4cvf209ri5nkp9cf9q3xw4c-openssl-1.1.1j.drv
  /nix/store/9m8b5cvxriiinkv9wqvjjbizj4fsix8j-libkrb5-1.18.drv
  /nix/store/2lqy23j0dxdrblkc72q7dswdl7f7crah-c-ares-1.17.1.drv
  /nix/store/h8gvlvad1a8a9gyw2anmw00ixnz1nb6k-libev-4.33.drv
  /nix/store/afjdcpy4qsygi8990cdpyaia4085d9za-nghttp2-1.41.0.drv
  /nix/store/dh6m9ai5dl9dgj1yxdxnivhhv3h271z4-libxml2-2.9.10.drv
  /nix/store/mamlzrlaz7pnkk6yd16sd0zj9yhbfn79-re2c-1.3.drv
  /nix/store/jlz07xf4vp79574zy6bp5893jcaln63k-ninja-1.10.2.drv
  /nix/store/lsph0lixayp9x67kigr5132kiz4pg35k-ICU-66108.drv
  /nix/store/n28hmqp9nynr5lglr91gklaf2iwh3hv2-libssh2-1.9.0.drv
  /nix/store/qilca8kpk2yjc6dnl3ibmxilcc4a30ww-curl-7.74.0.drv
  /nix/store/imp06rrhbrbg28v62hnz613gpb23shnm-swift-corefoundation.drv
  /nix/store/fdfp39im6b15sb7mqayibpfpix0zpv05-bootstrap-stage2-stdenv-darwin.drv
  /nix/store/47439bmqjg6lh7krk30scmjbjxhmz51n-bootstrap-stage2-stdenv-darwin.drv
  /nix/store/8y8hivwxbqcxrjbglbgzckyal9756nn1-expand-response-params.drv
  /nix/store/birlc16f1293mdggf4alq4290c70dkxn-pcre-8.44.drv
  /nix/store/kj5xvg758cv9my6x9d1g4qlprpf8dpkj-libiconv-50.drv
  /nix/store/rpw90vqw5mf0fqx00cxmlhia28j0cbnk-gnugrep-3.6.drv
  /nix/store/k1nf7r2b91za4qfvhalqbim0w9nqfp8l-texinfo-6.7.drv
  /nix/store/y6dfcamgb0j55bpdlr6jahy3y9ihkff7-binutils-2.35.1.drv
  /nix/store/qlfwffqcjvf86ps96ivxlfvcxb618ivm-binutils-wrapper-2.35.1.drv
  /nix/store/sx6k3z7is7liwkcphbj4vkmsk9lpbcha-bash-4.4-p23.drv
  /nix/store/axpka4j09bwz35cq2dq6my4i4n7zydib-bootstrap-stage0-clang-wrapper-7.1.0.drv
  /nix/store/s86qdzcrqjqh5r8lb118zqk2a17w3wwg-bootstrap-stage2-stdenv-darwin.drv
  /nix/store/m0qx88fvi3mv90g9dwrdy0i9ckpzi0dd-libc++abi-7.1.0.drv
  /nix/store/h79xsbai0jzfaacvxg9928hhgv9rxlf6-hook.drv
  /nix/store/bpw9bqy17nsj1h47shgrb5bq96nsv2sl-hook.drv
  /nix/store/ga701snjn7dwhys0v2l0109h6gafjf5m-bsdmake-24.drv
  /nix/store/psfb9gyz305yl8si389rfy0lpg3qdbs8-adv_cmds-119.drv
  /nix/store/wbb62axwywgyb4fqczrk9sqgakljjl2j-hook.drv
  /nix/store/sizchf2c1j3690r64yvp7w03cyvb196n-libc++-7.1.0.drv
  /nix/store/shyha9rblxjxxk73z665b0z1d78vvaz5-bootstrap-stage0-clang-wrapper-7.1.0.drv
  /nix/store/w0sm93kqmjvyzlvl0qpcggnbssm2mwz0-bootstrap-stage3-stdenv-darwin.drv
  /nix/store/2vj0h9fhrybmnw8ijgfsa639jqf4xgzd-xz-5.2.5.drv
  /nix/store/b6z0qn9f0x4pzs79spvk7a73g6xacr9w-ICU-66108.drv
  /nix/store/irjk1k7zdswlxiqh0y0cql1ckz51wkdk-objc4-709.1.drv
  /nix/store/a1kh3fdzr42q1m0i2vlc879p7pd4r06s-zlib-1.2.11.drv
  /nix/store/2sjjynmhbavda3n1b834m8wbsf8lpy6p-bootstrap-stage3-stdenv-darwin.drv
  /nix/store/y0zy5xrcxx3zn96bb058qfsvwf3wsa61-hook.drv
  /nix/store/y9hvlaj0msmnq60c1v94pdz04l9jlmkh-libxml2-2.9.10.drv
  /nix/store/4lzj83qrkbirfzjjwz513gpm1ph5vk7f-swift-corefoundation.drv
  /nix/store/07aql2ybyywki6qbdi9djv77qxf1qgas-bootstrap-stage4-stdenv-darwin.drv
  /nix/store/1pn29vj13zkxvlv99y8i1mfa8cpi2dn3-expand-response-params.drv
  /nix/store/kfn50i9q10zf8yyfvsz2gwyzvbkz2fsr-ncurses-6.2.drv
  /nix/store/mfmdn5a4vd4dfhkkmzz4s9172qrsl2kg-libffi-3.3.drv
  /nix/store/0i4w4jqpd1vc2xdg8jr7pfjy5bpbc05h-llvm-7.1.0.drv
  /nix/store/2hbcg1syb4fsf2za77nnq0hjxq7glf4z-compiler-rt-7.1.0.drv
  /nix/store/a465a6lln2ik17h4ky0p7gb5kiq7my9v-hook.drv
  /nix/store/ycvs9ly63906i7sx5sag8bmmj48j2db1-lld-7.1.0.drv
  /nix/store/4fj60d84sdczngzr6miq8xvyfhl0lk7h-clang-7.1.0.drv
  /nix/store/19ynkdpagzilcgga5dyvzrrwpiz3mbgc-pcre-8.44.drv
  /nix/store/9lsh215qacva5s1xb4gh2589wkg80p98-gnugrep-3.6.drv
  /nix/store/1g29bvpi1xvdwmpydci5qifz6r2f0m1f-install-shell-files.drv
  /nix/store/s6bvzca67cgamqfdqavdj9mvqys2kf5x-hook.drv
  /nix/store/wm9m924512qcjpvwfdv9z01i6v59k4pd-libtapi-1100.0.11.drv
  /nix/store/70xpjbcllad9wwvcdj63f89cvzlp29d0-cctools-port-949.0.1.drv
  /nix/store/ajpy90plvzbfdwygv6k8p6nbj9wl9kfj-texinfo-6.7.drv
  /nix/store/vcn80kayr9q1wxsbl7lnrvq6g7hx2c07-binutils-2.35.1.drv
  /nix/store/11aw7jb9viy0r62fjj1plawlcj74z84n-cctools-binutils-darwin-949.0.1.drv
  /nix/store/291q7a4qchrh7c1wwh7qz6fbaz06ip0w-gmp-6.2.1.drv
  /nix/store/zzbm0qcb80kylvmjkiciyvsmmj1v9mpp-coreutils-8.32.drv
  /nix/store/f7vf97q2w3k576h9r03dylwblsprzbc9-cctools-binutils-darwin-wrapper-949.0.1.drv
  /nix/store/234fisw7pbjf93avh43m1ljpdxddyc8a-clang-wrapper-7.1.0.drv
  /nix/store/xmmyxhb2328sczyw1jnbp7k53q6xs38s-bootstrap-stage4-stdenv-darwin.drv
  /nix/store/ckby32b11azm6cm5a5m9hmv8pg8bf2fw-perl-5.32.1.drv
  /nix/store/0d1rzf95i1vrs7i2z0ikc2xf7yaxnh68-openssl-1.1.1j.drv
  /nix/store/1c84mgja8qvfw9dhkcpbp5na7gli5jiy-lzip-1.22.drv
  /nix/store/xn09ha5xrz8s8b72pv8c5qg8xvfi6rgm-gnum4-1.4.18.drv
  /nix/store/44cccichgqw2c7hykif0mxri4i5vwj7b-bison-3.7.5.drv
  /nix/store/5p706cij0l02imcxwci2fplhk9qq4g1y-gettext-0.21.drv
  /nix/store/9qdidwhgnjx6kcchkhlgg3r0s4ng6rhw-perl5.32.1-gettext-1.07.drv
  /nix/store/7qvnjs0qlk37jsf4ivv1xd61p7nkwh94-help2man-1.47.17.drv
  /nix/store/3k0m9lyd0pq4lnk87lqj9pyaqvw0566a-libtool-2.4.6.drv
  /nix/store/y7zn3iscpqyi7c55pd3qf7zy3zh5ybd4-autoconf-2.70.drv
  /nix/store/mmzx84yyvfwr90ihv44a53dsqz8f76y8-automake-1.16.3.drv
  /nix/store/ar7qbps71iz39lbc04g4hik5ks507riq-hook.drv
  /nix/store/2dhh9h2rr0wzjsnn08zs1mwa9dcqh3sd-flex-2.6.4.drv
  /nix/store/n8fb8fwlkqkylkmb3kcggqzr6zq9ygs9-expand-response-params.drv
  /nix/store/5fhyi2czspv0204xycnbyv85vzmar59n-libtapi-1100.0.11.drv
  /nix/store/j77p4f6mjhw7k17gvw5ci79ys1l0acc9-objc4-709.1.drv
  /nix/store/rdl5mxw2xxjrq2yhb6zbckyyghrin182-install-shell-files.drv
  /nix/store/br6w5pqaq277kiv5a5nzdq3dxkmha307-cctools-port-949.0.1.drv
  /nix/store/r6vb22byqlcif2d8bacj5bdy7izw7r94-texinfo-6.7.drv
  /nix/store/j9n03qzafgam2s23iqqywm843jisa0h9-binutils-2.35.1.drv
  /nix/store/rvp8s40jhwbbmvafval0kvmp15vyyivl-cctools-binutils-darwin-949.0.1.drv
  /nix/store/mw5wpxw0rbkxhh1xsir81srar5l28lyc-cctools-binutils-darwin-wrapper-949.0.1.drv
  /nix/store/2irgbwl5zphp5shm4ymy7k7czlf1b9k7-clang-wrapper-7.1.0.drv
  /nix/store/3a40852n6y2ixm4wzs09vwx4b5sp8k3i-c-ares-1.17.1.drv
  /nix/store/5bbcy680rz3zfskp7vja275a6j199n6b-bootstrap_cmds-121.drv
  /nix/store/67saaaldrnargvwyrk5axbijqji7pr4x-diffutils-3.7.drv
  /nix/store/6gkmc20dzixi2m41f9vzjn7ng6qyr7q9-gnutar-1.32.drv
  /nix/store/7fy3n6vdj0pwsynd742gz4ljb521kja6-gnused-4.8.drv
  /nix/store/8b3qc9124nq37drfw1nyp826liqwm1qr-gawk-5.1.0.drv
  /nix/store/qk0w9x87b0s8r84wdchpiygj09nikcma-pkg-config-0.29.2.drv
  /nix/store/8b6gmc90hmzcphj2sl4sa800s52lxsww-pkg-config-wrapper-0.29.2.drv
  /nix/store/8kj715nf0yczpq7y7hczfjdp8vq80r52-libkrb5-1.18.drv
  /nix/store/wnflmmmrx3cnc8q9b7f33nq5akcdb3gl-libssh2-1.9.0.drv
  /nix/store/gwq7h6ifg9zdvasj0iaxcxqhs4napqm8-libev-4.33.drv
  /nix/store/xg94q7mgpwbarbz7gvhlfzmam667nnpd-nghttp2-1.41.0.drv
  /nix/store/jxyg9bmj59lllw1hy4hb9w8xlvqmj1dh-curl-7.74.0.drv
  /nix/store/sv2vrdqr20kv591gcy2mmwv2bfa0d8hr-ICU-66108.drv
  /nix/store/8dqnbv9a9yk6q5gy1rvm6f87yjzx0i4w-swift-corefoundation.drv
  /nix/store/9x3f38zhfryya890zarwc8dksd4xgiv1-ed-1.17.drv
  /nix/store/ks4yqc63i6jsxdsaa0zfsrlc9xwqn3hs-findutils-4.7.0.drv
  /nix/store/pml154qc4y1y3xvwxh4aab0d5c1ckpjb-gnumake-4.3.drv
  /nix/store/sfclf35acix280x4qnd5mwc56dimvw0d-patch-2.7.6.drv
  /nix/store/wpnzfdgdn847xikwjjxpjrmlr0c8wsqp-bzip2-1.0.6.0.1.drv
  /nix/store/vm7fb5qi02n14pb1k1m3br7fxq1i235q-setup-hook.drv
  /nix/store/z62xsq6qfy5byflm8lph3m94q0qk82wz-gzip-1.10.drv
  /nix/store/pdh8209hc9m3iqkdb2is9j9pf6dl4yxp-stdenv-darwin.drv
building '/nix/store/wz2q5w809rp6mly9a9qbqbwjd8j190fv-cpio-2.13.drv'...
unpacking sources
unpacking source archive /nix/store/1f3g83maxsjcpa7lgsxv4i52fqszldp7-cpio-2.13.tar.bz2
source root is cpio-2.13
setting SOURCE_DATE_EPOCH to timestamp 1573027160 of file cpio-2.13/ChangeLog
patching sources
configuring
configure flags: --disable-dependency-tracking --prefix=/nix/store/shb3z8pzszb5y0hjca56rcg2ib0ypx5c-cpio-2.13
checking for a BSD-compatible install... /nix/store/c7kq4zyffzdc73yrp9rjn6k8jg6aj2lm-bootstrap-stage0-clang/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /nix/store/c7kq4zyffzdc73yrp9rjn6k8jg6aj2lm-bootstrap-stage0-clang/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '501' is supported by ustar format... yes
checking whether GID '20' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking whether make supports nested variables... (cached) yes
checking for gcc... clang
checking whether the C compiler works... no
configure: error: in `/private/tmp/nix-build-cpio-2.13.drv-0/cpio-2.13':
configure: error: C compiler cannot create executables
See `config.log' for more details
builder for '/nix/store/wz2q5w809rp6mly9a9qbqbwjd8j190fv-cpio-2.13.drv' failed with exit code 77
cannot build derivation '/nix/store/zil9aq5z5srw8ns055f6fq2ria4l9hsj-Libsystem-1238.60.2.drv': 1 dependencies couldn't be built
building '/nix/store/2lqy23j0dxdrblkc72q7dswdl7f7crah-c-ares-1.17.1.drv'...
cannot build derivation '/nix/store/pdh8209hc9m3iqkdb2is9j9pf6dl4yxp-stdenv-darwin.drv': 1 dependencies couldn't be built
error: build of '/nix/store/pdh8209hc9m3iqkdb2is9j9pf6dl4yxp-stdenv-darwin.drv' failed

This is the next error I run into when building stdenv. I believe this is about the clang from bootstrapTools.

toonn@terra ~/s/nixpkgs> nix-build -A stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.cpio
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
these derivations will be built:
  /nix/store/wz2q5w809rp6mly9a9qbqbwjd8j190fv-cpio-2.13.drv
building '/nix/store/wz2q5w809rp6mly9a9qbqbwjd8j190fv-cpio-2.13.drv'...
unpacking sources
unpacking source archive /nix/store/1f3g83maxsjcpa7lgsxv4i52fqszldp7-cpio-2.13.tar.bz2
source root is cpio-2.13
setting SOURCE_DATE_EPOCH to timestamp 1573027160 of file cpio-2.13/ChangeLog
patching sources
configuring
configure flags: --disable-dependency-tracking --prefix=/nix/store/shb3z8pzszb5y0hjca56rcg2ib0ypx5c-cpio-2.13
checking for a BSD-compatible install... /nix/store/c7kq4zyffzdc73yrp9rjn6k8jg6aj2lm-bootstrap-stage0-clang/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /nix/store/c7kq4zyffzdc73yrp9rjn6k8jg6aj2lm-bootstrap-stage0-clang/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '501' is supported by ustar format... yes
checking whether GID '20' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking whether make supports nested variables... (cached) yes
checking for gcc... clang
checking whether the C compiler works... no
configure: error: in `/private/tmp/nix-build-cpio-2.13.drv-0/cpio-2.13':
configure: error: C compiler cannot create executables
See `config.log' for more details
builder for '/nix/store/wz2q5w809rp6mly9a9qbqbwjd8j190fv-cpio-2.13.drv' failed with exit code 77
error: build of '/nix/store/wz2q5w809rp6mly9a9qbqbwjd8j190fv-cpio-2.13.drv' failed

The relevant part of config.log:

configure:4503: checking for C compiler version
configure:4512: clang --version >&5
clang version 7.1.0 (tags/RELEASE_710/final)
Target: x86_64-apple-darwin
Thread model: posix
InstalledDir: /nix/store/c7kq4zyffzdc73yrp9rjn6k8jg6aj2lm-bootstrap-stage0-clang
/bin
configure:4523: $? = 0
configure:4512: clang -v >&5
clang version 7.1.0 (tags/RELEASE_710/final)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /nix/store/c7kq4zyffzdc73yrp9rjn6k8jg6aj2lm-bootstrap-stage0-clang
/bin
configure:4523: $? = 0
configure:4512: clang -V >&5
clang-7: error: unsupported option '-V -target'
clang-7: error: no such file or directory: 'x86_64-apple-darwin'
clang-7: error: no input files
configure:4523: $? = 1
configure:4512: clang -qversion >&5
clang-7: error: unknown argument '-qversion', did you mean '--version'?
clang-7: error: no input files
configure:4523: $? = 1
configure:4543: checking whether the C compiler works
configure:4565: clang    conftest.c  >&5
ld: library not found for -lSystem
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
configure:4569: $? = 1
configure:4607: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU cpio"
| #define PACKAGE_TARNAME "cpio"
| #define PACKAGE_VERSION "2.13"
| #define PACKAGE_STRING "GNU cpio 2.13"
| #define PACKAGE_BUGREPORT "bug-cpio@gnu.org"
| #define PACKAGE_URL "http://www.gnu.org/software/cpio"
| #define PACKAGE "cpio"
| #define VERSION "2.13"
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:4612: error: in `/private/tmp/nix-build-cpio-2.13.drv-0/cpio-2.13':
configure:4614: error: C compiler cannot create executables
See `config.log' for more details

Running this compiler on a copy of conftest.c:

toonn@terra ~/s/nixpkgs> /nix/store/c7kq4zyffzdc73yrp9rjn6k8jg6aj2lm-bootstrap-stage0-clang/bin/clang conftest.c -v
clang version 7.1.0 (tags/RELEASE_710/final)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /nix/store/c7kq4zyffzdc73yrp9rjn6k8jg6aj2lm-bootstrap-stage0-clang/bin
 "/nix/store/6jysbyhc43sjvfiyh1bpvi1n3zbz212r-bootstrap-tools/bin/clang-7" -cc1 -triple x86_64-apple-macosx10.13.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -discard-value-names -main-file-name conftest.c -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu penryn -dwarf-column-info -debugger-tuning=lldb -target-linker-version 274.2 -v -nostdsysteminc -resource-dir /nix/store/6jysbyhc43sjvfiyh1bpvi1n3zbz212r-bootstrap-tools/lib/clang/7.1.0 -fdebug-compilation-dir /Users/toonn/src/nixpkgs -ferror-limit 19 -fmessage-length 80 -stack-protector 1 -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fobjc-runtime=macosx-10.13.0 -fmax-type-align=16 -fdiagnostics-show-option -o /var/folders/xm/n96l21b93xx1bm16cjr16gq40000gn/T/conftest-1445c7.o -x c conftest.c
clang -cc1 version 7.1.0 based upon LLVM 7.1.0 default target x86_64-apple-darwin17.7.0
#include "..." search starts here:
#include <...> search starts here:
 /nix/store/6jysbyhc43sjvfiyh1bpvi1n3zbz212r-bootstrap-tools/lib/clang/7.1.0/include
End of search list.
 "/nix/store/c7kq4zyffzdc73yrp9rjn6k8jg6aj2lm-bootstrap-stage0-clang/bin/ld" -demangle -lto_library /nix/store/6jysbyhc43sjvfiyh1bpvi1n3zbz212r-bootstrap-tools/lib/libLTO.dylib -no_deduplicate -dynamic -arch x86_64 -macosx_version_min 10.13.0 -o a.out /var/folders/xm/n96l21b93xx1bm16cjr16gq40000gn/T/conftest-1445c7.o -lSystem
ld: library not found for -lSystem
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)

Failing to build python3-minimal-3.8.8 due to futimens/utimensat

Building stdenv requires python3-minimal which stumbles over some of the new functions introduced in the 10.13 SDK/stubs.

clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -
O3 -Wall    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missi
ng-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration 
 -I./Include/internal  -I. -I./Include -I/nix/store/qll95hvzih85426mpncc01ygjssx
f2j8-zlib-1.2.11-dev/include -I/nix/store/id2648lgc97li0v8qkipzilxr6wfc34s-bzip2
-1.0.6.0.1-dev/include -I/nix/store/p3wl2ww3gkamzlpb40ylgr00rgqlbp3a-expat-2.2.1
0-dev/include -I/nix/store/29wlzh7pg6ds90lqzx0r2sccxlq9mzz1-xz-5.2.5-dev/include
 -I/nix/store/l26q5wqn1qrpnz2lc77kbjk4fhrqxgad-libffi-3.3-dev/include -I/nix/sto
re/qll95hvzih85426mpncc01ygjssxf2j8-zlib-1.2.11-dev/include -I/nix/store/id2648l
gc97li0v8qkipzilxr6wfc34s-bzip2-1.0.6.0.1-dev/include -I/nix/store/p3wl2ww3gkamz
lpb40ylgr00rgqlbp3a-expat-2.2.10-dev/include -I/nix/store/29wlzh7pg6ds90lqzx0r2sccxlq9mzz1-xz-5.2.5-dev/include -I/nix/store/l26q5wqn1qrpnz2lc77kbjk4fhrqxgad-libffi-3.3-dev/include  -DPy_BUILD_CORE_BUILTIN  -c ./Modules/_codecsmodule.c -o Modules/_codecsmodule.o                                                          
clang-7: warning: argument unused during compilation: '-fno-strict-overflow' [-Wunused-command-line-argument]                                                   
clang-7: warning: argument unused during compilation: '-fno-strict-overflow' [-Wunused-command-line-argument]                                                   
./Modules/posixmodule.c:4696:12: error: implicit declaration of function 'utimensat' is invalid in C99 [-Werror,-Wimplicit-function-declaration]                
    return utimensat(dir_fd, path, time, flags);                                
           ^                                                                    
./Modules/posixmodule.c:4696:12: note: did you mean 'utimes'?                   
/nix/store/kmh0pg4lbr3n09cnb2rnnm3glf2a24jx-bootstrap-stage0-Libsystem/include/sys/time.h:202:5: note: 'utimes' declared here                                   
int     utimes(const char *, const struct timeval *);                           
        ^                                                                       
./Modules/posixmodule.c:4696:12: warning: this function declaration is not a prototype [-Wstrict-prototypes]                                                    
    return utimensat(dir_fd, path, time, flags);                                
           ^                                                                    
./Modules/posixmodule.c:4721:12: error: implicit declaration of function 'futimens' is invalid in C99 [-Werror,-Wimplicit-function-declaration]                 
    return futimens(fd, time);                                                  
           ^                                                                    
./Modules/posixmodule.c:4721:12: note: did you mean 'futimes'?                  
/nix/store/kmh0pg4lbr3n09cnb2rnnm3glf2a24jx-bootstrap-stage0-Libsystem/include/sys/time.h:190:5: note: 'futimes' declared here                                  
int     futimes(int, const struct timeval *);                                   
        ^                                                                       
./Modules/posixmodule.c:4721:12: warning: this function declaration is not a prototype [-Wstrict-prototypes]                                                    
    return futimens(fd, time);                                                  
           ^                                                                    
./Modules/posixmodule.c:4744:12: error: implicit declaration of function 'utimensat' is invalid in C99 [-Werror,-Wimplicit-function-declaration]                
    return utimensat(DEFAULT_DIR_FD, path, time, AT_SYMLINK_NOFOLLOW);          
           ^                                                                    
./Modules/posixmodule.c:4760:12: error: implicit declaration of function 'utimensat' is invalid in C99 [-Werror,-Wimplicit-function-declaration]                
    return utimensat(DEFAULT_DIR_FD, path, time, 0);                            
           ^                                                                    
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration  -I./Include/internal  -I. -I./Include -I/nix/store/qll95hvzih85426mpncc01ygjssxf2j8-zlib-1.2.11-dev/include -I/nix/store/id2648lgc97li0v8qkipzilxr6wfc34s-bzip2-1.0.6.0.1-dev/include -I/nix/store/p3wl2ww3gkamzlpb40ylgr00rgqlbp3a-expat-2.2.10-dev/include -I/nix/store/29wlzh7pg6ds90lqzx0r2sccxlq9mzz1-xz-5.2.5-dev/include -I/nix/store/l26q5wqn1qrpnz2lc77kbjk4fhrqxgad-libffi-3.3-dev/include -I/nix/store/qll95hvzih85426mpncc01ygjssxf2j8-zlib-1.2.11-dev/include -I/nix/store/id2648lgc97li0v8qkipzilxr6wfc34s-bzip2-1.0.6.0.1-dev/include -I/nix/store/p3wl2ww3gkamzlpb40ylgr00rgqlbp3a-expat-2.2.10-dev/include -I/nix/store/29wlzh7pg6ds90lqzx0r2sccxlq9mzz1-xz-5.2.5-dev/include -I/nix/store/l26q5wqn1qrpnz2lc77kbjk4fhrqxgad-libffi-3.3-dev/include  -DPy_BUILD_CORE_BUILTIN  -c ./Modules/_weakref.c -o Modules/_weakref.o                                                                    
2 warnings and 4 errors generated.                                              
make: *** [Makefile:1880: Modules/posixmodule.o] Error 1                        
make: *** Waiting for unfinished jobs....                                       
clang-7: warning: argument unused during compilation: '-fno-strict-overflow' [-Wunused-command-line-argument]                                                   
builder for '/nix/store/nzkg0r1m5469bd4w35lp74mib3w2mkhv-python3-minimal-3.8.8.drv' failed with exit code 2                                                     
cannot build derivation '/nix/store/gfvqzjkrybms4hi8bab314aj6qhiq8h8-ICU-66108.drv': 1 dependencies couldn't be built                                           
cannot build derivation '/nix/store/gvl1sqalh362pgsl88g7klbfl7wpygxk-ICU-66108.drv': 1 dependencies couldn't be built                                           
cannot build derivation '/nix/store/mqjl06vn4flckrfyd5bp27wzrj0q00hj-clang-7.1.0.drv': 1 dependencies couldn't be built                                         
cannot build derivation '/nix/store/rfpazr9krzyjfncjvq3i6mj3wcnzdjny-compiler-rt-7.1.0.drv': 1 dependencies couldn't be built                                   
building '/nix/store/xnm1dqb47pyy17bscj0b65lrwpvz6il2-curl-7.74.0.drv'...       
cannot build derivation '/nix/store/1hp2n40ds4pxj96rldv8f41lspjrr4i4-libtapi-1100.0.11.drv': 1 dependencies couldn't be built                                   
cannot build derivation '/nix/store/9mv4g133b385yfwlvgqcn5p54axk0qlv-libtapi-1100.0.11.drv': 1 dependencies couldn't be built                                   
cannot build derivation '/nix/store/lgw50in7zwaxpany5d9wc282zbv294lk-libtapi-1100.0.11.drv': 1 dependencies couldn't be built                                   
cannot build derivation '/nix/store/7k0jp6308vwfqrznkg9vxwbw9mbgmavs-libxml2-2.9.10.drv': 1 dependencies couldn't be built                                      
cannot build derivation '/nix/store/qczssf78g2lawdb4dxc6chsyj1bi3iy8-llvm-7.1.0.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/ck3hrslxc0a3zkbp1gv1v0cg6jxlqx0l-swift-corefoundation.drv': 1 dependencies couldn't be builtcannot build derivation '/nix/store/hv18xm5hvgyzc08llbg7pf1910821ij3-swift-corefoundation.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/wpp8kqblyssgv3swmrr1g0cqkzy5x9dm-swift-corefoundation.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/7k7zmc6b9yqyjy2ggc8rhjy30pmqa9xl-xnu-3789.70.16.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/rwa43bdbhr8960p3jcbgabcdlhgfwjmi-stdenv-darwin.drv': 1 dependencies couldn't be built
error: build of '/nix/store/rwa43bdbhr8960p3jcbgabcdlhgfwjmi-stdenv-darwin.drv' failed

This is coming from the python3 built in stage2, so stages 0 and 1 build successfully:

toonn@terra ~/s/nixpkgs> nix-build -A stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.python3 -j1                       
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
these derivations will be built:
  /nix/store/nzkg0r1m5469bd4w35lp74mib3w2mkhv-python3-minimal-3.8.8.drv
building '/nix/store/nzkg0r1m5469bd4w35lp74mib3w2mkhv-python3-minimal-3.8.8.drv'
[ELIDED]
checking for futimesat... no
checking for futimens... yes
checking for futimes... yes
[ELIDED]
checking for utimensat... yes
checking for utimes... yes
[ELIDED]
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration  -I./Include/internal  -I. -I./Include -I/nix/store/qll95hvzih85426mpncc01ygjssxf2j8-zlib-1.2.11-dev/include -I/nix/store/id2648lgc97li0v8qkipzilxr6wfc34s-bzip2-1.0.6.0.1-dev/include -I/nix/store/p3wl2ww3gkamzlpb40ylgr00rgqlbp3a-expat-2.2.10-dev/include -I/nix/store/29wlzh7pg6ds90lqzx0r2sccxlq9mzz1-xz-5.2.5-dev/include -I/nix/store/l26q5wqn1qrpnz2lc77kbjk4fhrqxgad-libffi-3.3-dev/include -I/nix/store/qll95hvzih85426mpncc01ygjssxf2j8-zlib-1.2.11-dev/include -I/nix/store/id2648lgc97li0v8qkipzilxr6wfc34s-bzip2-1.0.6.0.1-dev/include -I/nix/store/p3wl2ww3gkamzlpb40ylgr00rgqlbp3a-expat-2.2.10-dev/include -I/nix/store/29wlzh7pg6ds90lqzx0r2sccxlq9mzz1-xz-5.2.5-dev/include -I/nix/store/l26q5wqn1qrpnz2lc77kbjk4fhrqxgad-libffi-3.3-dev/include  -DPy_BUILD_CORE_BUILTIN  -DPy_BUILD_CORE_BUILTIN -I./Include/internal -c ./Modules/posixmodule.c -o Modules/posixmodule.o
clang-7: warning: argument unused during compilation: '-fno-strict-overflow' [-Wunused-command-line-argument]
./Modules/posixmodule.c:4696:12: error: implicit declaration of function 'utimensat' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    return utimensat(dir_fd, path, time, flags);
           ^
./Modules/posixmodule.c:4696:12: note: did you mean 'utimes'?
/nix/store/kmh0pg4lbr3n09cnb2rnnm3glf2a24jx-bootstrap-stage0-Libsystem/include/sys/time.h:202:5: note: 'utimes' declared here
int     utimes(const char *, const struct timeval *);
        ^
./Modules/posixmodule.c:4696:12: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    return utimensat(dir_fd, path, time, flags);
           ^
./Modules/posixmodule.c:4721:12: error: implicit declaration of function 'futimens' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    return futimens(fd, time);
           ^
./Modules/posixmodule.c:4721:12: note: did you mean 'futimes'?
/nix/store/kmh0pg4lbr3n09cnb2rnnm3glf2a24jx-bootstrap-stage0-Libsystem/include/sys/time.h:190:5: note: 'futimes' declared here
int     futimes(int, const struct timeval *);
        ^
./Modules/posixmodule.c:4721:12: warning: this function declaration is not a prototype [-Wstrict-prototypes]
    return futimens(fd, time);
           ^
./Modules/posixmodule.c:4744:12: error: implicit declaration of function 'utimensat' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    return utimensat(DEFAULT_DIR_FD, path, time, AT_SYMLINK_NOFOLLOW);
           ^
./Modules/posixmodule.c:4760:12: error: implicit declaration of function 'utimensat' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    return utimensat(DEFAULT_DIR_FD, path, time, 0);
           ^
2 warnings and 4 errors generated.
make: *** [Makefile:1880: Modules/posixmodule.o] Error 1
builder for '/nix/store/nzkg0r1m5469bd4w35lp74mib3w2mkhv-python3-minimal-3.8.8.drv' failed with exit code 2
error: build of '/nix/store/nzkg0r1m5469bd4w35lp74mib3w2mkhv-python3-minimal-3.8.8.drv' failed

Part of config.log where it finds futimens:

configure:11557: checking for futimens
configure:11557: clang -o conftest  -I/nix/store/qll95hvzih85426mpncc01ygjssxf2j8-zlib-1.2.11-dev/include -I/nix/store/id2648lgc97li0v8qkipzilxr6wfc34s-bzip2-1.0.6.0.1-dev/include -I/nix/store/p3wl2ww3gkamzlpb40ylgr00rgqlbp3a-expat-2.2.10-dev/include -I/nix/store/29wlzh7pg6ds90lqzx0r2sccxlq9mzz1-xz-5.2.5-dev/include -I/nix/store/l26q5wqn1qrpnz2lc77kbjk4fhrqxgad-libffi-3.3-dev/include -L/nix/store/jqfrq0m3slyfj2sva0wiqrk36ps296k9-zlib-1.2.11/lib -L/nix/store/bk1c5qbx96j64d7arw5zgw5b8qqry1kc-bzip2-1.0.6.0.1/lib -L/nix/store/cmfw3gwr4ic5mv3w960zdsmvldhly25l-expat-2.2.10/lib -L/nix/store/irkiciwlfvrqxpnzpk2bcb3abdmklp2z-xz-5.2.5/lib -L/nix/store/rig2h9mk5imq373zmdgw7y6hw0w128h2-libffi-3.3/lib conftest.c -ldl   >&5
configure:11557: $? = 0
configure:11557: result: yes

I believe it's finding futimens via -ldl/libdl.tbd which re-exports libsystem_kernel.tbd which has the symbol _futimens. The clang call for posixmodule.c indeed seems to list all the same include paths as the configure test except for -ldl. Unless that's part of -I./Include/internal -I. -I./Include.

LnL suggested updating xnu from the apple_source_releases, this didn't help. Looking closer xnu is built as a dependency of stdenv-darwin and this python3-minimal is in turn a dependency of xnu.

My guess that the build would still be using the bootstrapTools libraries seems to have been correct. Stage 2 and 3 now build succesfully. Turns out stage 3 did require the new xnu headers. Next up stage 4.

Swift CoreFoundation fails to build because of syslog.h

This seems to have been because of my partial update of apple_source_releases.

The error seems to say the parser expects a function body but since syslog.h is a header I wouldn't expect function bodies, error: expected function body after function declarator. Maybe the clang version is too old to recognise the __DARWIN_ALIAS_STARTING(...) syntax?

@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/q19wpy2aylv4a6z5c6p52ih8pi2kcbpq-source
source root is source
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
patching script interpreter paths in ../configure
../configure: interpreter directive changed from "#!/usr/bin/env python" to "/nix/store/g4xjpfs40cq3595p4cd3ymxpq044rb0z-python3-minimal-3.8.8/bin/python"
substituteStream(): WARNING: pattern '#if defined(__GNU__) ||' doesn't match anything in file 'Base.subproj/CFAsmMacros.h'
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
@nix { "action": "setPhase", "phase": "buildPhase" }
building
[105/180] CompileC: Collections.subproj/CFData.c
Collections.subproj/CFData.c:633:13: warning: enumeration value 'kCFImmutable' not handled in switch [-Wswitch]
    switch (__CFMutableVariety(data)) {
            ^
1 warning generated.
[149/180] CompileC: RunLoop.subproj/CFMessagePort.c
RunLoop.subproj/CFMessagePort.c:585:15: warning: implicit declaration of function 'bootstrap_check_in' is invalid in C99 [-Wimplicit-function-declaration]
        ret = bootstrap_check_in(bs, (char *)utfname, &mp); /* If we're started by launchd or the old mach_init */
              ^
1 warning generated.
[165/180] CompileC: URL.subproj/CFURL.c
FAILED: Build/CoreFoundation/URL.subproj/CFURL.c.o
mkdir -p `dirname Build/CoreFoundation/URL.subproj/CFURL.c.o`; clang -fcolor-diagnostics -fdollars-in-identifiers -fblocks -fobjc-runtime=macosx-10.11 -fintegrated-as -fPIC --target=x86_64-apple-darwin -O2 --sysroot=UNUSED  -I../bootstrap/common/usr/include -I../bootstrap/common/usr/local/include   -I../bootstrap/x86_64-apple-darwin/usr/include -I../bootstrap/x86_64-apple-darwin/usr/local/include -DINCLUDE_OBJC -I/nix/store/5dnwscvsm7x97x4l1kzvd0bpyfs9mrpl-libxml2-2.9.10-dev/include/libxml2 -IBuild/CoreFoundation -IBuild -IBuild/CoreFoundation/usr/include -IBuild/CoreFoundation/usr/include/CoreFoundation -IBuild/CoreFoundation/usr/include/CoreFoundation -IBuild/CoreFoundation/usr/include/CoreFoundation -DDEPLOYMENT_TARGET_MACOSX -I//usr/include -I//usr/local/include -DU_SHOW_DRAFT_API=1 -DCF_BUILDING_CF=1 -DDEPLOYMENT_RUNTIME_C=1 -fconstant-cfstrings -fexceptions -Wno-shorten-64-to-32 -Wno-deprecated-declarations -Wno-unreachable-code -Wno-conditional-uninitialized -Wno-unused-variable -Wno-int-conversion -Wno-unused-function -I./-IUNUSED/usr/include/curl -IUNUSED/usr/include/libxml2  -include Base.subproj/CoreFoundation_Prefix.h  -c URL.subproj/CFURL.c -o Build/CoreFoundation/URL.subproj/CFURL.c.o
In file included from URL.subproj/CFURL.c:29:
In file included from /nix/store/nlfw3y3kjk0cb20bbygnczvimkpn1djh-Libsystem-1238.60.2/include/syslog.h:23:
/nix/store/nlfw3y3kjk0cb20bbygnczvimkpn1djh-Libsystem-1238.60.2/include/sys/syslog.h:227:37: error: expected function body after function declarator
void    syslog(int, const char *, ...) __DARWIN_ALIAS_STARTING(__MAC_10_13, __IPHONE_NA, __DARWIN_EXTSN(syslog)) __printflike(2, 3) __not_tail_called;
                                       ^
/nix/store/nlfw3y3kjk0cb20bbygnczvimkpn1djh-Libsystem-1238.60.2/include/sys/cdefs.h:592:53: note: expanded from macro '__DARWIN_ALIAS_STARTING'
#define __DARWIN_ALIAS_STARTING(_mac, _iphone, x)   __DARWIN_ALIAS_STARTING_MAC_##_mac(x)
                                                    ^
<scratch space>:7:1: note: expanded from here
__DARWIN_ALIAS_STARTING_MAC___MAC_10_13
^
1 error generated.

When running the failing build command in the --keep-failed directory for swift-corefoundation I get a different error:

In file included from URL.subproj/CFURL.c:15:
In file included from Build/CoreFoundation/usr/include/CoreFoundation/CFInternal.h:943:
/nix/store/nlfw3y3kjk0cb20bbygnczvimkpn1djh-Libsystem-1238.60.2/include/dispatch/private.h:68:2: error: 
      "Dispatch header mismatch between /usr/include and /usr/local/include"
#error "Dispatch header mismatch between /usr/include and /usr/local/include"
 ^
223 warnings and 1 error generated.

Maybe this is because I'm not running previous build steps?

By dropping my changes to apple_source_releases I noticed the update of xnu and Libsystem was required to build stage 3. Rebuilding stage 4 with a clean repo does reproduce the error:

[1/2] CompileC: URL.subproj/CFURL.c
FAILED: Build/CoreFoundation/URL.subproj/CFURL.c.o 
mkdir -p `dirname Build/CoreFoundation/URL.subproj/CFURL.c.o`; clang -fcolor-diagnostics -fdollars-in-identifiers -fblocks -fobjc-runtime=macosx-10.11 -fintegrated-as -fPIC --target=x86_64-apple-darwin -O2 --sysroot=UNUSED  -I../bootstrap/common/usr/include -I../bootstrap/common/usr/local/include   -I../bootstrap/x86_64-apple-darwin/usr/include -I../bootstrap/x86_64-apple-darwin/usr/local/include -DINCLUDE_OBJC -I/nix/store/psvaqwx0fn5faa3wm75p84x3avj83497-libxml2-2.9.10-dev/include/libxml2 -IBuild/CoreFoundation -IBuild -IBuild/CoreFoundation/usr/include -IBuild/CoreFoundation/usr/include/CoreFoundation -IBuild/CoreFoundation/usr/include/CoreFoundation -IBuild/CoreFoundation/usr/include/CoreFoundation -DDEPLOYMENT_TARGET_MACOSX -I//usr/include -I//usr/local/include -DU_SHOW_DRAFT_API=1 -DCF_BUILDING_CF=1 -DDEPLOYMENT_RUNTIME_C=1 -fconstant-cfstrings -fexceptions -Wno-shorten-64-to-32 -Wno-deprecated-declarations -Wno-unreachable-code -Wno-conditional-uninitialized -Wno-unused-variable -Wno-int-conversion -Wno-unused-function -I./-IUNUSED/usr/include/curl -IUNUSED/usr/include/libxml2  -include Base.subproj/CoreFoundation_Prefix.h  -c URL.subproj/CFURL.c -o Build/CoreFoundation/URL.subproj/CFURL.c.o 
In file included from URL.subproj/CFURL.c:29:
In file included from /nix/store/8qgxk5cpwdnc398136dbp9sad4max9k5-Libsystem-1238.60.2/include/syslog.h:23:
/nix/store/8qgxk5cpwdnc398136dbp9sad4max9k5-Libsystem-1238.60.2/include/sys/syslog.h:227:37: error: expected function body after function declarator
void    syslog(int, const char *, ...) __DARWIN_ALIAS_STARTING(__MAC_10_13, __IPHONE_NA, __DARWIN_EXTSN(syslog)) __printflike(2, 3) __not_tail_called;
                                       ^
/nix/store/8qgxk5cpwdnc398136dbp9sad4max9k5-Libsystem-1238.60.2/include/sys/cdefs.h:592:53: note: expanded from macro '__DARWIN_ALIAS_STARTING'
#define __DARWIN_ALIAS_STARTING(_mac, _iphone, x)   __DARWIN_ALIAS_STARTING_MAC_##_mac(x)
                                                    ^
<scratch space>:7:1: note: expanded from here
__DARWIN_ALIAS_STARTING_MAC___MAC_10_13
^
1 error generated.
ninja: build stopped: subcommand failed.

[512/512] retrying build, workaround for #66811
  With clang_7 the build of CFRuntime.c fails intermittently.
  See https://github.com/NixOS/nixpkgs/issues/66811 for more details.

installing
cp: cannot stat './Build/CoreFoundation/libCoreFoundation.dylib': No such file or directory
builder for '/nix/store/nlj3hqxbmpyxc6kvsivm0mlqjvcvdhxn-swift-corefoundation.drv' failed with exit code 1
error: build of '/nix/store/j61d7rq7a4k0vbh4m9lw9wsg9dv843km-clang-wrapper-7.1.0.drv', '/nix/store/nlj3hqxbmpyxc6kvsivm0mlqjvcvdhxn-swift-corefoundation.drv' failed

I'm currently trying to incorporate LnL's work on bumping the llvmPackages used in the Darwin stdenv to 9 from 7 to see if this is a toolchain issue.

llvmPackages_9

Stage 2 fails to build because Csu, a dependency of Libsystem, doesn't build because of a missing header stdbool.h:

toonn@terra ~/s/nixpkgs> nix-build -A stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.darwin.Csu
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoringthese derivations will be built:
  /nix/store/5z84dch42nv4as195rkrjv3l5nvribxc-Csu-85.drv
building '/nix/store/5z84dch42nv4as195rkrjv3l5nvribxc-Csu-85.drv'...
unpacking sources
unpacking source archive /nix/store/5bdnlv9gsq6rcx22qcdq4drnlsf8vfpk-Csu-85.tar.gz
source root is Csu-85
setting SOURCE_DATE_EPOCH to timestamp 1381273907 of file Csu-85/start.s
patching sources
configuring
no configure script, doing nothing
building
build flags: -j8 -l8 SHELL=/nix/store/f175szd6yjvjak05cm5x2rgbcpv0g6gx-bootstrap-tools/bin/bash
Makefile:153: target '/lib' given more than once in the same rule
cc  -r  -Os -mmacosx-version-min=10.6 -mdynamic-no-pic -nostdlib -keep_private_externs start.s crt.c dyld_glue.s -o crt1.v1.o  -DCRT -DOLD_LIBSYSTEM_SUPPORT
cc  -r  -Os -mmacosx-version-min=10.6 -nostdlib -keep_private_externs start.s crt.c dyld_glue.s -o crt1.v2.o  -DCRT
cc  -r  -Os -mmacosx-version-min=10.6 -nostdlib -keep_private_externs start.s crt.c -o crt1.v3.o  -DADD_PROGRAM_VARS 
cc  -r  -Os -mmacosx-version-min=10.6 -nostdlib -keep_private_externs start.s crt.c -o crt1.v4.o  -DADD_PROGRAM_VARS 
cc  -r  -Os -mmacosx-version-min=10.6 -nostdlib -keep_private_externs start.s crt.c dyld_glue.s -o gcrt1.o  -DGCRT  -DOLD_LIBSYSTEM_SUPPORT
cc  -r  -Os -static -Wl,-new_linker -nostdlib -keep_private_externs start.s crt.c -o crt0.o 
cc  -r  -Os -mmacosx-version-min=10.6  -nostdlib -keep_private_externs dyld_glue.s icplusplus.c -o dylib1.v1.o  -DCFM_GLUE
cc  -r  -Os -mmacosx-version-min=10.6  -nostdlib -keep_private_externs dyld_glue.s -o dylib1.v2.o  -DCFM_GLUE
cc  -r  -Os -mmacosx-version-min=10.6  -nostdlib -keep_private_externs dyld_glue.s -o bundle1.v1.o 
cc  -r  -Os -nostdlib -keep_private_externs lazy_dylib_helper.s lazy_dylib_loader.c -o lazydylib1.o 
In file included from lazy_dylib_loader.c:30:
/nix/store/dvfchnaf7ca3s0rppkh3i7m768jn7vzk-bootstrap-stage0-Libsystem/include/dlfcn.h:40:10: fatal error: 'stdbool.h' file not found
#include <stdbool.h>
         ^~~~~~~~~~~
1 error generated.
make: *** [Makefile:104: lazydylib1.o] Error 1
builder for '/nix/store/5z84dch42nv4as195rkrjv3l5nvribxc-Csu-85.drv' failed with exit code 2
error: build of '/nix/store/5z84dch42nv4as195rkrjv3l5nvribxc-Csu-85.drv' failed

Clang 9 needed lib/clang/9.1.0 in the bootstrapFiles.

Now libtapi fails to build:

In file included from /tmp/nix-build-libtapi-1100.0.11.drv-0/source/src/llvm/projects/clang/lib/Basic/SourceManager.cpp:1195:/nix/store/86mp2saqg47mdd419lx2j5fz2wa2n8xi-bootstrap-stage0-clang-wrapper-9.0.1/resource-root/include/emmintrin.h:2308:19: error: use of undeclared identifier '__builtin_ia32_pavgb128'
  return (__m128i)__builtin_ia32_pavgb128((__v16qi)__a, (__v16qi)__b);
                  ^/nix/store/86mp2saqg47mdd419lx2j5fz2wa2n8xi-bootstrap-stage0-clang-wrapper-9.0.1/resource-root/include/emmintrin.h:2328:19: error: use of undeclared identifier '__builtin_ia32_pavgw128'
  return (__m128i)__builtin_ia32_pavgw128((__v8hi)__a, (__v8hi)__b);
                  ^

Forgot to update the clang binaries in the bootstrapFiles.

Properly generate bootstrap-tools

Since updating things in the bootstrapFiles keeps popping up I figured I'd generate it properly using make-bootstrap-tools.nix. However, I run into infinite recursion when trying to update xnu, which we need for python3-minimal as above.

toonn@terra ~/s/nixpkgs> nix-build pkgs/stdenv/darwin/make-bootstrap-tools.nix -A build --no-out-link --show-trace
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
error: while evaluating the attribute 'buildCommand' of the derivation 'stdenv-bootstrap-tools' at /Users/toonn/src/nixpkgs/pkgs/stdenv/darwin/make-bootstrap-tools.nix:24:5:
while evaluating the attribute 'buildInputs' of the derivation 'libxml2-2.9.10' at /Users/toonn/src/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:192:11:
while evaluating the attribute 'CPPFLAGS' of the derivation 'python3-3.8.8' at /Users/toonn/src/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:192:11:
while evaluating anonymous function at /Users/toonn/src/nixpkgs/pkgs/development/interpreters/python/cpython/default.nix:237:41, called from undefined position:
while evaluating the attribute 'buildInputs' of the derivation 'configd-453.19' at /Users/toonn/src/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:192:11:
while evaluating the attribute 'installPhase' of the derivation 'IOKit-' at /Users/toonn/src/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:192:11:
while evaluating the attribute 'postInstall' of the derivation 'xnu-4570.71.2' at /Users/toonn/src/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:192:11:
while evaluating 'optionalString' at /Users/toonn/src/nixpkgs/lib/strings.nix:202:5, called from /Users/toonn/src/nixpkgs/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix:89:17:
while evaluating the attribute 'nativeBuildInputs' of the derivation 'xnu-3789.70.16' at /Users/toonn/src/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:192:11:
infinite recursion encountered, at undefined position

I've figured out this is because the xnu-10_12 dependency uses a non-overridden python3. If I explicitly pass xnu's python3 I can avoid the recursion. Maybe xnu-10_12 should be at the darwin.* top level so it can be similarly overriden as xnu?

llvmPackages_11 AKA llvmPackages_9 a Déjà vu

Now that I have an LLVM 11 bootstrap-tools I need to get stdenv to use it. To do this I evaluate the bootstrapFiles attribute of make-bootstrap-tools.nix in a repl. Then I pass this to the stdenv like so, in this case to build another bootstrap-tools:

nix-build --no-out-link -E 'let np = (import ./. { stdenvStages = args: let args'"'"' = args // { bootstrapFiles = { bzip2 = "/nix/store/034hi1861jbxxgv2dcwcwx42s92sp8yk-stdenv-bootstrap-tools/on-server/bzip2"; cpio = "/nix/store/034hi1861jbxxgv2dcwcwx42s92sp8yk-stdenv-bootstrap-tools/on-server/cpio"; mkdir = "/nix/store/034hi1861jbxxgv2dcwcwx42s92sp8yk-stdenv-bootstrap-tools/on-server/mkdir"; sh = "/nix/store/034hi1861jbxxgv2dcwcwx42s92sp8yk-stdenv-bootstrap-tools/on-server/sh"; tarball = "/nix/store/034hi1861jbxxgv2dcwcwx42s92sp8yk-stdenv-bootstrap-tools/on-server/bootstrap-tools.cpio.bz2"; };}; in (import pkgs/stdenv/darwin args'"'"').stagesDarwin; }); in (np.callPackage (import pkgs/stdenv/darwin/make-bootstrap-tools.nix) {}).build'

This is only sufficient to get stage0 to use the new clang-11 and causes the same error as above for llvmPackages_9, the build for darwin.Csu cannot find stdbool.h because it's looking in .../lib/clang/7.1.0 and the bootstrap-tools only have .../lib/clang/11.1.0.

However, when bumping llvmPackages_7 to llvmPackages_11 for the stdenv, not forgetting to update bootstrapClangVersion so clang can find the libs for its version, I get evaluation errors.

error: while evaluating the attribute 'buildCommand' of the derivation 'stdenv-bootstrap-tools' at /Users/toonn/src/nixpkgs/pkgs/stdenv/darwin/make-bootstrap-tools.nix:24:5:
while evaluating the attribute 'installPhase' of the derivation 'Libsystem-1238.60.2' at /Users/toonn/src/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:192:11:
while evaluating the attribute 'nativeBuildInputs' of the derivation 'xnu-3789.70.16' at /Users/toonn/src/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:192:11:
while evaluating the attribute 'nativeBuildInputs' of the derivation 'bootstrap_cmds-121' at /Users/toonn/src/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:192:11:
while evaluating the attribute 'nativeBuildInputs' of the derivation 'bison-3.7.5' at /Users/toonn/src/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:192:11:
while evaluating the attribute 'stdenv' of the derivation 'gnum4-1.4.18' at /Users/toonn/src/nixpkgs/pkgs/development/tools/misc/gnum4/default.nix:9:3:
while evaluating the attribute 'allowedRequisites' of the derivation 'bootstrap-stage1-stdenv-darwin' at /Users/toonn/src/nixpkgs/pkgs/stdenv/generic/default.nix:88:14:
while evaluating the attribute 'buildInputs' of the derivation 'libc++-7.1.0' at /Users/toonn/src/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:192:11:
while evaluating the attribute 'nativeBuildInputs' of the derivation 'libc++abi-7.1.0' at /Users/toonn/src/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:192:11:
while evaluating the attribute 'buildInputs' of the derivation 'cmake-3.19.4' at /Users/toonn/src/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:192:11:
while evaluating the attribute 'nativeBuildInputs' of the derivation 'bzip2-1.0.6.0.1' at /Users/toonn/src/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:192:11:
while evaluating the attribute 'buildCommand' of the derivation 'hook' at /Users/toonn/src/nixpkgs/pkgs/build-support/trivial-builders.nix:7:7:
while evaluating 'optionalString' at /Users/toonn/src/nixpkgs/lib/strings.nix:202:5, called from /Users/toonn/src/nixpkgs/pkgs/build-support/trivial-builders.nix:382:12:
while evaluating the attribute 'nativeBuildInputs' of the derivation 'autoconf-2.70' at /Users/toonn/src/nixpkgs/pkgs/development/tools/misc/autoconf/default.nix:9:3:
while evaluating the attribute 'postInstall' of the derivation 'perl-5.32.1' at /Users/toonn/src/nixpkgs/pkgs/development/interpreters/perl/default.nix:22:5:
while evaluating the attribute 'cc.cc' at /Users/toonn/src/nixpkgs/pkgs/stdenv/generic/default.nix:166:14:value is a string while a set was expected, at /Users/toonn/src/nixpkgs/pkgs/development/interpreters/perl/default.nix:134:36

This seems to be because cc = "/dev/null" in stage0. The exact same evaluation errors occur when bumping to llvmPackages_9 instead, which suggests there's something about the bootstrapping process I'm overlooking. So far I figured if you provide a different bootstrapFiles to the stdenv with a new llvm version you could then bump the llvm version used in the stdenv.

Even when I try to pass the local bootstrap-tools for LLVM 7 the build does not succeed.

toonn@terra ~/s/nixpkgs> nix-store --read-log /nix/store/x5ra8x598a9pm6sqkpxp4gc0gmwbifms-expand-response-params.drv
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
no configure script, doing nothing
@nix { "action": "setPhase", "phase": "buildPhase" }
building
ld: library not found for -lSystem
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)

Wrong libcxx version

A weird observation is the following from a repl:

np = import ./. {}
# ~stage0.pkgs.libcxx.name:
np.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.pkgs.libcxx.name
"libc++-7.1.0"

I'm not sure where libc++ is getting its version from. The 7.1.0 seems a little suspicious because that's the clang we're upgrading from. Grepping pkgs/development/compilers/llvm/11 doesn't give any results. It is an explicit argument in pkgs/development/compilers/llvm/11/libc++/default.nix and passed with an inherit in pkgs/development/compilers/llvm/11/default.nix (actually it's inherited into a callPackage definition as part of the autoArgs) and I'm not sure where version is coming from at this point version is defined at the top of this file, in this case it should be 11.1.0.

Turns out this is because the stdenv doesn't explicitly specify the version to get some of the llvmPackages_* from, like libcxx for instance. So when bumping LLVM in the stdenv you need to bump the default LLVM for Darwin in all-packages.nix.

TODO: Maybe stdenv should more exhaustively specify which llvmPackages_* to get libraries from?

Missing libclang-cpp

Next up is a missing shared library for bootstrap-stage0-clang when run:

toonn@terra ~/s/nixpkgs> nix-build --no-out-link -E 'let np = (import ./. { stdenvStages = args: let args'"'"' = args // { bootstrapFiles = { bzip2 = "/nix/store/mgba16w2q11ls1fkxqqg7jqhsl12lvvg-stdenv-bootstrap-tools/on-server/bzip2"; cpio = "/nix/store/mgba16w2q11ls1fkxqqg7jqhsl12lvvg-stdenv-bootstrap-tools/on-server/cpio"; mkdir = "/nix/store/mgba16w2q11ls1fkxqqg7jqhsl12lvvg-stdenv-bootstrap-tools/on-server/mkdir"; sh = "/nix/store/mgba16w2q11ls1fkxqqg7jqhsl12lvvg-stdenv-bootstrap-tools/on-server/sh"; tarball = "/nix/store/mgba16w2q11ls1fkxqqg7jqhsl12lvvg-stdenv-bootstrap-tools/on-server/bootstrap-tools.cpio.bz2"; };}; in (import pkgs/stdenv/darwin args'"'"').stagesDarwin; }); in (np.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.stdenv.__bootPackages.llvmPackages_11.clang-unwrapped)' --show-trace
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
/nix/store/3m4jgjmp9mqwb35sql2jmd53qgs1ac75-bootstrap-stage0-clang
toonn@terra ~/s/nixpkgs> /nix/store/3m4jgjmp9mqwb35sql2jmd53qgs1ac75-bootstrap-stage0-clang/bin/clang --version
dyld: Library not loaded: @rpath/libclang-cpp.11.1.dylib
  Referenced from: /nix/store/3m4jgjmp9mqwb35sql2jmd53qgs1ac75-bootstrap-stage0-clang/bin/clang
  Reason: image not found
fish: Job 1, '/nix/store/3m4jgjmp9mqwb35sql2j…' terminated by signal SIGABRT (Abort)

Fixed by including libclang-cpp.11.1.dylib in bootstrap-tools.

Csu build uses the wrong compiler version

Building of the bootstrap-tools with LLVM 11 bootstrap-tools fails because of a missing header for Csu:

@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/5bdnlv9gsq6rcx22qcdq4drnlsf8vfpk-Csu-85.tar.gz
source root is Csu-85
setting SOURCE_DATE_EPOCH to timestamp 1381273907 of file Csu-85/start.s
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
no configure script, doing nothing
@nix { "action": "setPhase", "phase": "buildPhase" }
building
build flags: -j8 -l8 SHELL=/nix/store/6jysbyhc43sjvfiyh1bpvi1n3zbz212r-bootstrap-tools/bin/bash
Makefile:153: target '/lib' given more than once in the same rule
cc  -r  -Os -mmacosx-version-min=10.6 -mdynamic-no-pic -nostdlib -keep_private_externs start.s crt.c dyld_glue.s -o crt1.v1.o  -DCRT -DOLD_LIBSYSTEM_SUPPORT
cc  -r  -Os -mmacosx-version-min=10.6 -nostdlib -keep_private_externs start.s crt.c dyld_glue.s -o crt1.v2.o  -DCRT
cc  -r  -Os -mmacosx-version-min=10.6 -nostdlib -keep_private_externs start.s crt.c -o crt1.v3.o  -DADD_PROGRAM_VARS 
cc  -r  -Os -mmacosx-version-min=10.6 -nostdlib -keep_private_externs start.s crt.c -o crt1.v4.o  -DADD_PROGRAM_VARS 
cc  -r  -Os -mmacosx-version-min=10.6 -nostdlib -keep_private_externs start.s crt.c dyld_glue.s -o gcrt1.o  -DGCRT  -DOLD_LIBSYSTEM_SUPPORT
cc  -r  -Os -static -Wl,-new_linker -nostdlib -keep_private_externs start.s crt.c -o crt0.o 
cc  -r  -Os -mmacosx-version-min=10.6  -nostdlib -keep_private_externs dyld_glue.s icplusplus.c -o dylib1.v1.o  -DCFM_GLUE
cc  -r  -Os -mmacosx-version-min=10.6  -nostdlib -keep_private_externs dyld_glue.s -o dylib1.v2.o  -DCFM_GLUE
cc  -r  -Os -mmacosx-version-min=10.6  -nostdlib -keep_private_externs dyld_glue.s -o bundle1.v1.o 
cc  -r  -Os -nostdlib -keep_private_externs lazy_dylib_helper.s lazy_dylib_loader.c -o lazydylib1.o 
In file included from lazy_dylib_loader.c:30:
/nix/store/hm0z4razdg703xj1dq07a5pbpaxqqacq-bootstrap-stage0-Libsystem/include/dlfcn.h:40:10: fatal error: 'stdbool.h' file not found
#include <stdbool.h>
         ^~~~~~~~~~~
1 error generated.
make: *** [Makefile:104: lazydylib1.o] Error 1
make: *** Waiting for unfinished jobs....

This is the same error as above in the llvmPackages_9 section but this time the proper lib/clang/11.1.0 is included in the bootstrap-tools. However, the wrong clang version is somehow getting into the build (custom buildPhase for darwin.Csu):

@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/5bdnlv9gsq6rcx22qcdq4drnlsf8vfpk-Csu-85.tar.gz
source root is Csu-85
setting SOURCE_DATE_EPOCH to timestamp 1381273907 of file Csu-85/start.s
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
no configure script, doing nothing
@nix { "action": "setPhase", "phase": "buildPhase" }
building
#####

cc is /nix/store/3c9js5afkdf335gpqz9936vcw8838k4r-bootstrap-stage0-clang-wrapper-11.1.0/bin/cc
clang version 7.1.0 (tags/RELEASE_710/final)
Target: x86_64-apple-darwin
Thread model: posix
InstalledDir: /nix/store/cfy5d73kvmfvhwd9d25pwnvdrwjny4rs-bootstrap-stage0-clang/bin


#####

Note that this is from a build with an LLVM 11 bootstrap-tools passed in:

toonn@terra ~/s/nixpkgs> nix-build --no-out-link -E 'let np = (import ./. { stdenvStages = args: let args'"'"' = args // { bootstrapFiles = { bzip2 = "/nix/store/jf3a2q3xhyas219acf9f20njwycrmv0f-stdenv-bootstrap-tools/on-server/bzip2"; cpio = "/nix/store/jf3a2q3xhyas219acf9f20njwycrmv0f-stdenv-bootstrap-tools/on-server/cpio"; mkdir = "/nix/store/jf3a2q3xhyas219acf9f20njwycrmv0f-stdenv-bootstrap-tools/on-server/mkdir"; sh = "/nix/store/jf3a2q3xhyas219acf9f20njwycrmv0f-stdenv-bootstrap-tools/on-server/sh"; tarball = "/nix/store/jf3a2q3xhyas219acf9f20njwycrmv0f-stdenv-bootstrap-tools/on-server/bootstrap-tools.cpio.bz2"; };}; in (import pkgs/stdenv/darwin args'"'"').stagesDarwin; }); in (np.callPackage (import pkgs/stdenv/darwin/make-bootstrap-tools.nix) {}).build' --show-trace

Actually, because make-bootstrap-tools.nix imports pkgspath it loses the bootstrapFiles that are passed in. I made changes to be able to pass in bootstrapFiles like so:

toonn@terra ~/s/nixpkgs> nix-build --no-out-link -E 'let bootstrapFiles = { bootstrapFiles = { bzip2 = "/nix/store/jf3a2q3xhyas219acf9f20njwycrmv0f-stdenv-bootstrap-tools/on-server/bzip2"; cpio = "/nix/store/jf3a2q3xhyas219acf9f20njwycrmv0f-stdenv-bootstrap-tools/on-server/cpio"; mkdir = "/nix/store/jf3a2q3xhyas219acf9f20njwycrmv0f-stdenv-bootstrap-tools/on-server/mkdir"; sh = "/nix/store/jf3a2q3xhyas219acf9f20njwycrmv0f-stdenv-bootstrap-tools/on-server/sh"; tarball = "/nix/store/jf3a2q3xhyas219acf9f20njwycrmv0f-stdenv-bootstrap-tools/on-server/bootstrap-tools.cpio.bz2"; }; }; in (import pkgs/stdenv/darwin/make-bootstrap-tools.nix bootstrapFiles).build'

Duplicate symbol when building cpio

Running the above command to build new bootstrap-tools (or anything really because it's a Libsystem dependency) results in an error when linking cpio due to a duplicate symbol:

duplicate symbol '_program_name' in:
    global.o
    ../gnu/libgnu.a(progname.o)
ld: 1 duplicate symbol for architecture x86_64
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [Makefile:1276: cpio] Error 1
make[2]: Leaving directory '/private/tmp/nix-build-cpio-2.13.drv-1/cpio-2.13/src'
make[1]: *** [Makefile:1282: all-recursive] Error 1
make[1]: Leaving directory '/private/tmp/nix-build-cpio-2.13.drv-1/cpio-2.13'
make: *** [Makefile:1222: all] Error 2
builder for '/nix/store/y3p6qh086ndcwvk4a4q6snjfv0s9vfv9-cpio-2.13.drv' failed with exit code 2
cannot build derivation '/nix/store/i4qj25m8kpc7l6s792b0j1wv3iapmbjl-Libsystem-1238.60.2.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/x428id5bhp333919k3l7m4rkzsxhram5-stdenv-bootstrap-tools.drv': 1 dependencies couldn't be built
error: build of '/nix/store/x428id5bhp333919k3l7m4rkzsxhram5-stdenv-bootstrap-tools.drv' failed

Tail of the log for cpio because the log above is messy:

make[2]: Entering directory '/private/tmp/nix-build-cpio-2.13.drv-1/cpio-2.13/src'
  CC       copyin.o
  CC       main.o
  CC       tar.o
  CC       util.o
  CC       filemode.o
  CC       idcache.o
  CC       makepath.o
  CC       userspec.o
  CC       fatal.o
  CC       global.o
  CC       dstring.o
  CC       defer.o
  CC       copypass.o
  CC       copyout.o
  CCLD     cpio
ld: warning: -sdk_version and -platform_version are not compatible, ignoring -sdk_version
duplicate symbol '_program_name' in:
    global.o
    ../gnu/libgnu.a(progname.o)
ld: 1 duplicate symbol for architecture x86_64
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [Makefile:1276: cpio] Error 1
make[2]: Leaving directory '/private/tmp/nix-build-cpio-2.13.drv-1/cpio-2.13/src'
make[1]: *** [Makefile:1282: all-recursive] Error 1
make[1]: Leaving directory '/private/tmp/nix-build-cpio-2.13.drv-1/cpio-2.13'
make: *** [Makefile:1222: all] Error 2

I believe this is an upstream bug and I've reported it via the bug-cpio mailing list. It is probably due to clang 11.0.0 default to -fno-common rather than -fcommon. For now I'm patching the build to pass the -fcommon hammer.

cmake-boot

Seemingly similar issue as above, clang 11.0.0 introduced the -Welaborated-enum-base flag, which is an error by default.

Quite a long log
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/wbdm01v0r6p108w7xvg9p062mjkqcrxx-cmake-3.19.4.tar.gz
source root is cmake-3.19.4
setting SOURCE_DATE_EPOCH to timestamp 1611847725 of file cmake-3.19.4/doxygen.config
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
applying patch /nix/store/a0i0a09n86p92p1s8ic482ldv974q517-search-path.patch
patching file Modules/Platform/UnixPaths.cmake
patching file Modules/Platform/WindowsPaths.cmake
applying patch /nix/store/zyyf54l6ifz7v838wp2f9icqhpiwyx68-application-services.patch
patching file Source/CMakeLists.txt
Hunk #1 succeeded at 905 (offset 12 lines).
patching file Source/cmGlobalXCodeGenerator.cxx
Hunk #1 succeeded at 46 (offset 3 lines).
patching file Utilities/cmlibarchive/CMakeLists.txt
applying patch /nix/store/scbgacx2m0h3f3nsp89hl4bz3lmxd0av-libuv-application-services.patch
patching file Utilities/cmlibuv/CMakeLists.txt
patching file Utilities/cmlibuv/src/unix/fsevents.c
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
fixing cmake files...
substituteStream(): WARNING: pattern '${PYTHON_EXECUTABLE}' doesn't match anything in file 'Modules/FindCxxTest.cmake'
configure flags: --prefix=/nix/store/40cnhs541xjq3i2rix6611sz0n4awaqb-cmake-boot-3.19.4 --parallel=8 CC=clang CXX=clang++ --docdir=share/doc/cmake-boot3.19.4 --no-system-libs -- -DCMAKE_CXX_COMPILER=c++ -DCMAKE_C_COMPILER=cc -DCMAKE_AR=/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/bin/ar -DCMAKE_RANLIB=/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/bin/ranlib -DCMAKE_STRIP=/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/bin/strip -DCMAKE_USE_OPENSSL=OFF -DBUILD_CursesDialog=OFF
---------------------------------------------
CMake 3.19.4, Copyright 2000-2020 Kitware, Inc. and Contributors
C compiler on this system is: clang   
C++ compiler on this system is: clang++    
Makefile processor on this system is: make
clang++ has setenv
clang++ has unsetenv
clang++ does not have environ in stdlib.h
clang++ has stl wstring
clang++ does not have <ext/stdio_filebuf.h>
---------------------------------------------
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmAddCustomCommandCommand.cxx -o cmAddCustomCommandCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmAddCustomTargetCommand.cxx -o cmAddCustomTargetCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmAddDefinitionsCommand.cxx -o cmAddDefinitionsCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmAddDependenciesCommand.cxx -o cmAddDependenciesCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmAddExecutableCommand.cxx -o cmAddExecutableCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmAddLibraryCommand.cxx -o cmAddLibraryCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmAddSubDirectoryCommand.cxx -o cmAddSubDirectoryCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmAddTestCommand.cxx -o cmAddTestCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmArgumentParser.cxx -o cmArgumentParser.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmBinUtilsLinker.cxx -o cmBinUtilsLinker.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmBinUtilsLinuxELFGetRuntimeDependenciesTool.cxx -o cmBinUtilsLinuxELFGetRuntimeDependenciesTool.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmBinUtilsLinuxELFLinker.cxx -o cmBinUtilsLinuxELFLinker.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.cxx -o cmBinUtilsLinuxELFObjdumpGetRuntimeDependenciesTool.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmBinUtilsMacOSMachOGetRuntimeDependenciesTool.cxx -o cmBinUtilsMacOSMachOGetRuntimeDependenciesTool.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmBinUtilsMacOSMachOLinker.cxx -o cmBinUtilsMacOSMachOLinker.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx -o cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmBinUtilsWindowsPEGetRuntimeDependenciesTool.cxx -o cmBinUtilsWindowsPEGetRuntimeDependenciesTool.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.cxx -o cmBinUtilsWindowsPEDumpbinGetRuntimeDependenciesTool.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmBinUtilsWindowsPELinker.cxx -o cmBinUtilsWindowsPELinker.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.cxx -o cmBinUtilsWindowsPEObjdumpGetRuntimeDependenciesTool.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmBreakCommand.cxx -o cmBreakCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmBuildCommand.cxx -o cmBuildCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmCMakeMinimumRequired.cxx -o cmCMakeMinimumRequired.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmCMakePath.cxx -o cmCMakePath.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmCMakePolicyCommand.cxx -o cmCMakePolicyCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmCPackPropertiesGenerator.cxx -o cmCPackPropertiesGenerator.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmCacheManager.cxx -o cmCacheManager.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmCheckCustomOutputs.cxx -o cmCheckCustomOutputs.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmCommand.cxx -o cmCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmCommandArgumentParserHelper.cxx -o cmCommandArgumentParserHelper.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmCommands.cxx -o cmCommands.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmCommonTargetGenerator.cxx -o cmCommonTargetGenerator.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmComputeComponentGraph.cxx -o cmComputeComponentGraph.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmComputeLinkDepends.cxx -o cmComputeLinkDepends.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmComputeLinkInformation.cxx -o cmComputeLinkInformation.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmComputeTargetDepends.cxx -o cmComputeTargetDepends.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmConsoleBuf.cxx -o cmConsoleBuf.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmConditionEvaluator.cxx -o cmConditionEvaluator.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmConfigureFileCommand.cxx -o cmConfigureFileCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmContinueCommand.cxx -o cmContinueCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmCoreTryCompile.cxx -o cmCoreTryCompile.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmCreateTestSourceList.cxx -o cmCreateTestSourceList.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmCustomCommand.cxx -o cmCustomCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmCustomCommandGenerator.cxx -o cmCustomCommandGenerator.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmCustomCommandLines.cxx -o cmCustomCommandLines.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmDefinePropertyCommand.cxx -o cmDefinePropertyCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmDefinitions.cxx -o cmDefinitions.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmDocumentationFormatter.cxx -o cmDocumentationFormatter.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmEnableLanguageCommand.cxx -o cmEnableLanguageCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmEnableTestingCommand.cxx -o cmEnableTestingCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmExecProgramCommand.cxx -o cmExecProgramCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmExecuteProcessCommand.cxx -o cmExecuteProcessCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmExpandedCommandArgument.cxx -o cmExpandedCommandArgument.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmExportBuildFileGenerator.cxx -o cmExportBuildFileGenerator.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmExportFileGenerator.cxx -o cmExportFileGenerator.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmExportInstallFileGenerator.cxx -o cmExportInstallFileGenerator.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmExportSet.cxx -o cmExportSet.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmExportTryCompileFileGenerator.cxx -o cmExportTryCompileFileGenerator.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmExprParserHelper.cxx -o cmExprParserHelper.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmExternalMakefileProjectGenerator.cxx -o cmExternalMakefileProjectGenerator.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFileCommand.cxx -o cmFileCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFileCopier.cxx -o cmFileCopier.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFileInstaller.cxx -o cmFileInstaller.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFileTime.cxx -o cmFileTime.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFileTimeCache.cxx -o cmFileTimeCache.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFileTimes.cxx -o cmFileTimes.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindBase.cxx -o cmFindBase.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindCommon.cxx -o cmFindCommon.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindFileCommand.cxx -o cmFindFileCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindLibraryCommand.cxx -o cmFindLibraryCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindPackageCommand.cxx -o cmFindPackageCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindPathCommand.cxx -o cmFindPathCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindProgramCommand.cxx -o cmFindProgramCommand.o
clang++        -DCMAKE_BOOTSTRAP    -DCMake_HAVE_CXX_MAKE_UNIQUE=1   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Bootstrap.cmk   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/LexerParser   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities/std   -I/private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Utilities  -c /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmForEachCommand.cxx -o cmForEachCommand.o
In file included from /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindProgramCommand.cxx:15:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:43:
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:477:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef CF_ENUM(CFIndex, CFComparisonResult) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:150:55: note: expanded from macro 'CF_ENUM'
#define CF_ENUM(...) __CF_ENUM_GET_MACRO(__VA_ARGS__, __CF_NAMED_ENUM, __CF_ANON_ENUM, )(__VA_ARGS__)
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:123:48: note: expanded from macro '__CF_ENUM_GET_MACRO'
#define __CF_ENUM_GET_MACRO(_1, _2, NAME, ...) NAME
                                               ^
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:125:75: note: expanded from macro '__CF_NAMED_ENUM'
#define __CF_NAMED_ENUM(_type, _name)     enum __CF_ENUM_ATTRIBUTES _name : _type _name; enum _name : _type
                                                                          ^~~~~~~
In file included from /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindProgramCommand.cxx:15:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:49:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h:14:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFLocale.h:16:
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFNotificationCenter.h:25:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef CF_ENUM(CFIndex, CFNotificationSuspensionBehavior) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:150:55: note: expanded from macro 'CF_ENUM'
#define CF_ENUM(...) __CF_ENUM_GET_MACRO(__VA_ARGS__, __CF_NAMED_ENUM, __CF_ANON_ENUM, )(__VA_ARGS__)
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:123:48: note: expanded from macro '__CF_ENUM_GET_MACRO'
#define __CF_ENUM_GET_MACRO(_1, _2, NAME, ...) NAME
                                               ^
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:125:75: note: expanded from macro '__CF_NAMED_ENUM'
#define __CF_NAMED_ENUM(_type, _name)     enum __CF_ENUM_ATTRIBUTES _name : _type _name; enum _name : _type
                                                                          ^~~~~~~
In file included from /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindProgramCommand.cxx:15:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:49:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h:14:
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFLocale.h:98:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef CF_ENUM(CFIndex, CFLocaleLanguageDirection) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:150:55: note: expanded from macro 'CF_ENUM'
#define CF_ENUM(...) __CF_ENUM_GET_MACRO(__VA_ARGS__, __CF_NAMED_ENUM, __CF_ANON_ENUM, )(__VA_ARGS__)
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:123:48: note: expanded from macro '__CF_ENUM_GET_MACRO'
#define __CF_ENUM_GET_MACRO(_1, _2, NAME, ...) NAME
                                               ^
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:125:75: note: expanded from macro '__CF_NAMED_ENUM'
#define __CF_NAMED_ENUM(_type, _name)     enum __CF_ENUM_ATTRIBUTES _name : _type _name; enum _name : _type
                                                                          ^~~~~~~
In file included from /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindProgramCommand.cxx:15:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:49:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h:16:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h:18:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h:17:
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFCharacterSet.h:62:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef CF_ENUM(CFIndex, CFCharacterSetPredefinedSet) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:150:55: note: expanded from macro 'CF_ENUM'
#define CF_ENUM(...) __CF_ENUM_GET_MACRO(__VA_ARGS__, __CF_NAMED_ENUM, __CF_ANON_ENUM, )(__VA_ARGS__)
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:123:48: note: expanded from macro '__CF_ENUM_GET_MACRO'
#define __CF_ENUM_GET_MACRO(_1, _2, NAME, ...) NAME
                                               ^
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:125:75: note: expanded from macro '__CF_NAMED_ENUM'
#define __CF_NAMED_ENUM(_type, _name)     enum __CF_ENUM_ATTRIBUTES _name : _type _name; enum _name : _type
                                                                          ^~~~~~~
In file included from /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindProgramCommand.cxx:15:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:49:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h:16:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h:18:
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h:105:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef CF_ENUM(CFStringEncoding, CFStringBuiltInEncodings) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:150:55: note: expanded from macro 'CF_ENUM'
#define CF_ENUM(...) __CF_ENUM_GET_MACRO(__VA_ARGS__, __CF_NAMED_ENUM, __CF_ANON_ENUM, )(__VA_ARGS__)
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:123:48: note: expanded from macro '__CF_ENUM_GET_MACRO'
#define __CF_ENUM_GET_MACRO(_1, _2, NAME, ...) NAME
                                               ^
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:125:75: note: expanded from macro '__CF_NAMED_ENUM'
#define __CF_NAMED_ENUM(_type, _name)     enum __CF_ENUM_ATTRIBUTES _name : _type _name; enum _name : _type
                                                                          ^~~~~~~
In file included from /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindProgramCommand.cxx:15:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:49:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h:16:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h:18:
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h:688:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef CF_ENUM(CFIndex, CFStringNormalizationForm) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:150:55: note: expanded from macro 'CF_ENUM'
#define CF_ENUM(...) __CF_ENUM_GET_MACRO(__VA_ARGS__, __CF_NAMED_ENUM, __CF_ANON_ENUM, )(__VA_ARGS__)
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:123:48: note: expanded from macro '__CF_ENUM_GET_MACRO'
#define __CF_ENUM_GET_MACRO(_1, _2, NAME, ...) NAME
                                               ^
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:125:75: note: expanded from macro '__CF_NAMED_ENUM'
#define __CF_NAMED_ENUM(_type, _name)     enum __CF_ENUM_ATTRIBUTES _name : _type _name; enum _name : _type
                                                                          ^~~~~~~
In file included from /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindProgramCommand.cxx:15:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:49:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFCalendar.h:16:
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFTimeZone.h:79:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef CF_ENUM(CFIndex, CFTimeZoneNameStyle) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:150:55: note: expanded from macro 'CF_ENUM'
#define CF_ENUM(...) __CF_ENUM_GET_MACRO(__VA_ARGS__, __CF_NAMED_ENUM, __CF_ANON_ENUM, )(__VA_ARGS__)
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:123:48: note: expanded from macro '__CF_ENUM_GET_MACRO'
#define __CF_ENUM_GET_MACRO(_1, _2, NAME, ...) NAME
                                               ^
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:125:75: note: expanded from macro '__CF_NAMED_ENUM'
#define __CF_NAMED_ENUM(_type, _name)     enum __CF_ENUM_ATTRIBUTES _name : _type _name; enum _name : _type
                                                                          ^~~~~~~
In file included from /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindProgramCommand.cxx:15:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:53:
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFDateFormatter.h:45:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef CF_ENUM(CFIndex, CFDateFormatterStyle) {        // date and time format styles
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:150:55: note: expanded from macro 'CF_ENUM'
#define CF_ENUM(...) __CF_ENUM_GET_MACRO(__VA_ARGS__, __CF_NAMED_ENUM, __CF_ANON_ENUM, )(__VA_ARGS__)
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:123:48: note: expanded from macro '__CF_ENUM_GET_MACRO'
#define __CF_ENUM_GET_MACRO(_1, _2, NAME, ...) NAME
                                               ^
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:125:75: note: expanded from macro '__CF_NAMED_ENUM'
#define __CF_NAMED_ENUM(_type, _name)     enum __CF_ENUM_ATTRIBUTES _name : _type _name; enum _name : _type
                                                                          ^~~~~~~
In file included from /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindProgramCommand.cxx:15:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:57:
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFNumber.h:31:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef CF_ENUM(CFIndex, CFNumberType) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:150:55: note: expanded from macro 'CF_ENUM'
#define CF_ENUM(...) __CF_ENUM_GET_MACRO(__VA_ARGS__, __CF_NAMED_ENUM, __CF_ANON_ENUM, )(__VA_ARGS__)
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:123:48: note: expanded from macro '__CF_ENUM_GET_MACRO'
#define __CF_ENUM_GET_MACRO(_1, _2, NAME, ...) NAME
                                               ^
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:125:75: note: expanded from macro '__CF_NAMED_ENUM'
#define __CF_NAMED_ENUM(_type, _name)     enum __CF_ENUM_ATTRIBUTES _name : _type _name; enum _name : _type
                                                                          ^~~~~~~
In file included from /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindProgramCommand.cxx:15:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:58:
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFNumberFormatter.h:29:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef CF_ENUM(CFIndex, CFNumberFormatterStyle) {      // number format styles
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:150:55: note: expanded from macro 'CF_ENUM'
#define CF_ENUM(...) __CF_ENUM_GET_MACRO(__VA_ARGS__, __CF_NAMED_ENUM, __CF_ANON_ENUM, )(__VA_ARGS__)
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:123:48: note: expanded from macro '__CF_ENUM_GET_MACRO'
#define __CF_ENUM_GET_MACRO(_1, _2, NAME, ...) NAME
                                               ^
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:125:75: note: expanded from macro '__CF_NAMED_ENUM'
#define __CF_NAMED_ENUM(_type, _name)     enum __CF_ENUM_ATTRIBUTES _name : _type _name; enum _name : _type
                                                                          ^~~~~~~
In file included from /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindProgramCommand.cxx:15:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:58:
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFNumberFormatter.h:144:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef CF_ENUM(CFIndex, CFNumberFormatterRoundingMode) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:150:55: note: expanded from macro 'CF_ENUM'
#define CF_ENUM(...) __CF_ENUM_GET_MACRO(__VA_ARGS__, __CF_NAMED_ENUM, __CF_ANON_ENUM, )(__VA_ARGS__)
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:123:48: note: expanded from macro '__CF_ENUM_GET_MACRO'
#define __CF_ENUM_GET_MACRO(_1, _2, NAME, ...) NAME
                                               ^
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:125:75: note: expanded from macro '__CF_NAMED_ENUM'
#define __CF_NAMED_ENUM(_type, _name)     enum __CF_ENUM_ATTRIBUTES _name : _type _name; enum _name : _type
                                                                          ^~~~~~~
In file included from /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindProgramCommand.cxx:15:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:58:
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFNumberFormatter.h:154:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef CF_ENUM(CFIndex, CFNumberFormatterPadPosition) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:150:55: note: expanded from macro 'CF_ENUM'
#define CF_ENUM(...) __CF_ENUM_GET_MACRO(__VA_ARGS__, __CF_NAMED_ENUM, __CF_ANON_ENUM, )(__VA_ARGS__)
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:123:48: note: expanded from macro '__CF_ENUM_GET_MACRO'
#define __CF_ENUM_GET_MACRO(_1, _2, NAME, ...) NAME
                                               ^
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:125:75: note: expanded from macro '__CF_NAMED_ENUM'
#define __CF_NAMED_ENUM(_type, _name)     enum __CF_ENUM_ATTRIBUTES _name : _type _name; enum _name : _type
                                                                          ^~~~~~~
In file included from /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindProgramCommand.cxx:15:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:60:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:17:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:16:
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h:21:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef CF_ENUM(CFIndex, CFURLPathStyle) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:150:55: note: expanded from macro 'CF_ENUM'
#define CF_ENUM(...) __CF_ENUM_GET_MACRO(__VA_ARGS__, __CF_NAMED_ENUM, __CF_ANON_ENUM, )(__VA_ARGS__)
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:123:48: note: expanded from macro '__CF_ENUM_GET_MACRO'
#define __CF_ENUM_GET_MACRO(_1, _2, NAME, ...) NAME
                                               ^
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:125:75: note: expanded from macro '__CF_NAMED_ENUM'
#define __CF_NAMED_ENUM(_type, _name)     enum __CF_ENUM_ATTRIBUTES _name : _type _name; enum _name : _type
                                                                          ^~~~~~~
In file included from /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindProgramCommand.cxx:15:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:60:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:17:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:16:
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h:294:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef CF_ENUM(CFIndex, CFURLComponentType) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:150:55: note: expanded from macro 'CF_ENUM'
#define CF_ENUM(...) __CF_ENUM_GET_MACRO(__VA_ARGS__, __CF_NAMED_ENUM, __CF_ANON_ENUM, )(__VA_ARGS__)
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:123:48: note: expanded from macro '__CF_ENUM_GET_MACRO'
#define __CF_ENUM_GET_MACRO(_1, _2, NAME, ...) NAME
                                               ^
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:125:75: note: expanded from macro '__CF_NAMED_ENUM'
#define __CF_NAMED_ENUM(_type, _name)     enum __CF_ENUM_ATTRIBUTES _name : _type _name; enum _name : _type
                                                                          ^~~~~~~
In file included from /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindProgramCommand.cxx:15:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:60:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:17:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:17:
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFRunLoop.h:35:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef CF_ENUM(SInt32, CFRunLoopRunResult) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:150:55: note: expanded from macro 'CF_ENUM'
#define CF_ENUM(...) __CF_ENUM_GET_MACRO(__VA_ARGS__, __CF_NAMED_ENUM, __CF_ANON_ENUM, )(__VA_ARGS__)
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:123:48: note: expanded from macro '__CF_ENUM_GET_MACRO'
#define __CF_ENUM_GET_MACRO(_1, _2, NAME, ...) NAME
                                               ^
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:125:75: note: expanded from macro '__CF_NAMED_ENUM'
#define __CF_NAMED_ENUM(_type, _name)     enum __CF_ENUM_ATTRIBUTES _name : _type _name; enum _name : _type
                                                                          ^~~~~~~
In file included from /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindProgramCommand.cxx:15:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:60:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:17:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:18:
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFSocket.h:99:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef CF_ENUM(CFIndex, CFSocketError) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:150:55: note: expanded from macro 'CF_ENUM'
#define CF_ENUM(...) __CF_ENUM_GET_MACRO(__VA_ARGS__, __CF_NAMED_ENUM, __CF_ANON_ENUM, )(__VA_ARGS__)
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:123:48: note: expanded from macro '__CF_ENUM_GET_MACRO'
#define __CF_ENUM_GET_MACRO(_1, _2, NAME, ...) NAME
                                               ^
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:125:75: note: expanded from macro '__CF_NAMED_ENUM'
#define __CF_NAMED_ENUM(_type, _name)     enum __CF_ENUM_ATTRIBUTES _name : _type _name; enum _name : _type
                                                                          ^~~~~~~
In file included from /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindProgramCommand.cxx:15:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:60:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:17:
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:27:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef CF_ENUM(CFIndex, CFStreamStatus) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:150:55: note: expanded from macro 'CF_ENUM'
#define CF_ENUM(...) __CF_ENUM_GET_MACRO(__VA_ARGS__, __CF_NAMED_ENUM, __CF_ANON_ENUM, )(__VA_ARGS__)
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:123:48: note: expanded from macro '__CF_ENUM_GET_MACRO'
#define __CF_ENUM_GET_MACRO(_1, _2, NAME, ...) NAME
                                               ^
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:125:75: note: expanded from macro '__CF_NAMED_ENUM'
#define __CF_NAMED_ENUM(_type, _name)     enum __CF_ENUM_ATTRIBUTES _name : _type _name; enum _name : _type
                                                                          ^~~~~~~
In file included from /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindProgramCommand.cxx:15:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:60:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:17:
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFStream.h:275:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef CF_ENUM(CFIndex, CFStreamErrorDomain) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:150:55: note: expanded from macro 'CF_ENUM'
#define CF_ENUM(...) __CF_ENUM_GET_MACRO(__VA_ARGS__, __CF_NAMED_ENUM, __CF_ANON_ENUM, )(__VA_ARGS__)
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:123:48: note: expanded from macro '__CF_ENUM_GET_MACRO'
#define __CF_ENUM_GET_MACRO(_1, _2, NAME, ...) NAME
                                               ^
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:125:75: note: expanded from macro '__CF_NAMED_ENUM'
#define __CF_NAMED_ENUM(_type, _name)     enum __CF_ENUM_ATTRIBUTES _name : _type _name; enum _name : _type
                                                                          ^~~~~~~
In file included from /private/tmp/nix-build-cmake-boot-3.19.4.drv-0/cmake-3.19.4/Source/cmFindProgramCommand.cxx:15:
In file included from /nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:60:
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFPropertyList.h:69:9: error: non-defining declaration of enumeration with a fixed underlying type is only permitted as a standalone declaration; missing list of enumerators? [-Welaborated-enum-base]
typedef CF_ENUM(CFIndex, CFPropertyListFormat) {
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:150:55: note: expanded from macro 'CF_ENUM'
#define CF_ENUM(...) __CF_ENUM_GET_MACRO(__VA_ARGS__, __CF_NAMED_ENUM, __CF_ANON_ENUM, )(__VA_ARGS__)
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:123:48: note: expanded from macro '__CF_ENUM_GET_MACRO'
#define __CF_ENUM_GET_MACRO(_1, _2, NAME, ...) NAME
                                               ^
/nix/store/7s9ra8gyq839w3fwk9i3jlp97cnd18vi-bootstrap-tools/Library/Frameworks/CoreFoundation.framework/Headers/CFAvailability.h:125:75: note: expanded from macro '__CF_NAMED_ENUM'
#define __CF_NAMED_ENUM(_type, _name)     enum __CF_ENUM_ATTRIBUTES _name : _type _name; enum _name : _type
                                                                          ^~~~~~~
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Makefile:148: cmFindProgramCommand.o] Error 1
make: *** Waiting for unfinished jobs....

Updating cmake to 3.20.1 didn't help. Figuring out how to pass -Wno-elaborated-enum-base to get the pre-11.0.0 behavior. Needed to pass -Wno-undef-prefix as well.

More -Wno-undef-prefix

ICU and configd required the same treatment. Is LLVM 11 really so recent as to require all this hammering, feels like a game of Whack-a-Mole.

Looks like these issue will go away with the update to Apple SDK 10.13, because these TARGET_OS_* are defined there. Hmm, they were also defined in the 10.12 SDK.

Ah, we generate our own TargetConditionals.h in the Libsystem expression. Patching that should resolve all of these issues in one fell swoop.

Swift CoreFoundation undefined TARGET_OS_*

The TargetConditionals.h header they include doesn't define TARGET_OS_IPHONE and others. I'm not sure we want darwin.CF depending on darwin.Libsystem and I couldn't figure out how to do the include without introducing circularity so I simply patched the included header to define the missing TARGET_OS_* to equal 0. This may prevent using CF to compile for iOS though, so it may not be a solution.

libcxxabi requires libunwind

Even on darwin libcxxabi needs libunwind. On darwin this is darwin.libunwind though, pkgs/development/libraries/libunwind is only supported on linux. The libunwind used in libcxxabi is the one included with LLVM.

Library not found for -lunwind
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/hrj6rpsld3j08vjj8xgmnzk3riavcmbw-libcxxabi-11.1.0.src.tar.xz
source root is libcxxabi-11.1.0.src
unpacking source archive /nix/store/1wh48rk0995n9gz1s0z4qswss06x9lvb-libcxx-11.1.0.src.tar.xz
unpacking source archive /nix/store/4izdn2v6inz2wadnc3zad5rryqwdply2-llvm-11.1.0.src.tar.xz
setting SOURCE_DATE_EPOCH to timestamp 1612389070 of file libcxxabi-11.1.0.src/www/spec.html
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
applying patch /nix/store/24a06br9jvy87sbanym8hijfq4j2dsqm-no-threads.patch
patching file CMakeLists.txt
Hunk #1 succeeded at 354 (offset -8 lines).
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
fixing cmake files...
cmake flags: -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_SKIP_BUILD_RPATH=ON -DBUILD_TESTING=OFF -DCMAKE_INSTALL_LOCALEDIR=/nix/store/0x04ivv0vwf8hbvmxf1z0kf19pq1f25i-libc++abi-x86_64-apple-darwin-11.1.0/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/0x04ivv0vwf8hbvmxf1z0kf19pq1f25i-libc++abi-x86_64-apple-darwin-11.1.0/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/0x04ivv0vwf8hbvmxf1z0kf19pq1f25i-libc++abi-x86_64-apple-darwin-11.1.0/lib -DCMAKE_INSTALL_DOCDIR=/nix/store/0x04ivv0vwf8hbvmxf1z0kf19pq1f25i-libc++abi-x86_64-apple-darwin-11.1.0/share/doc/libcxxabi -DCMAKE_INSTALL_INFODIR=/nix/store/0x04ivv0vwf8hbvmxf1z0kf19pq1f25i-libc++abi-x86_64-apple-darwin-11.1.0/share/info -DCMAKE_INSTALL_MANDIR=/nix/store/0x04ivv0vwf8hbvmxf1z0kf19pq1f25i-libc++abi-x86_64-apple-darwin-11.1.0/share/man -DCMAKE_INSTALL_OLDINCLUDEDIR=/nix/store/0x04ivv0vwf8hbvmxf1z0kf19pq1f25i-libc++abi-x86_64-apple-darwin-11.1.0/include -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/0x04ivv0vwf8hbvmxf1z0kf19pq1f25i-libc++abi-x86_64-apple-darwin-11.1.0/include -DCMAKE_INSTALL_SBINDIR=/nix/store/0x04ivv0vwf8hbvmxf1z0kf19pq1f25i-libc++abi-x86_64-apple-darwin-11.1.0/sbin -DCMAKE_INSTALL_BINDIR=/nix/store/0x04ivv0vwf8hbvmxf1z0kf19pq1f25i-libc++abi-x86_64-apple-darwin-11.1.0/bin -DCMAKE_INSTALL_NAME_DIR=/nix/store/0x04ivv0vwf8hbvmxf1z0kf19pq1f25i-libc++abi-x86_64-apple-darwin-11.1.0/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_OSX_SYSROOT= -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_STRIP=/nix/store/5qylv5c9rxiv31ala896s65gcfd6dm00-bootstrap-stage0-clang/bin/strip -DCMAKE_RANLIB=/nix/store/5qylv5c9rxiv31ala896s65gcfd6dm00-bootstrap-stage0-clang/bin/ranlib -DCMAKE_AR=/nix/store/5qylv5c9rxiv31ala896s65gcfd6dm00-bootstrap-stage0-clang/bin/ar -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_INSTALL_PREFIX=/nix/store/0x04ivv0vwf8hbvmxf1z0kf19pq1f25i-libc++abi-x86_64-apple-darwin-11.1.0 -DLLVM_ENABLE_LIBCXX=ON -DLIBCXXABI_USE_LLVM_UNWINDER=ON -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_HOST_SYSTEM_NAME=Darwin -DCMAKE_HOST_SYSTEM_PROCESSOR=x86_64 
-- The CXX compiler identification is Clang 11.1.0
-- The C compiler identification is Clang 11.1.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /nix/store/0ql9hyncshf3d32wpp0bclh8sjj76v6f-bootstrap-stage0-clang-wrapper-11.1.0/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /nix/store/0ql9hyncshf3d32wpp0bclh8sjj76v6f-bootstrap-stage0-clang-wrapper-11.1.0/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Configuring for standalone build.
CMake Warning at cmake/Modules/HandleOutOfTreeLLVM.cmake:60 (message):
  UNSUPPORTED LIBCXXABI CONFIGURATION DETECTED: llvm-config not found and
  LLVM_PATH not defined.

  Reconfigure with -DLLVM_CONFIG_PATH=path/to/llvm-config or
  -DLLVM_PATH=path/to/llvm-source-root.
Call Stack (most recent call first):
  cmake/Modules/HandleOutOfTreeLLVM.cmake:84 (find_llvm_parts)
  cmake/Modules/HandleOutOfTreeLLVM.cmake:142 (configure_out_of_tree_llvm)
  CMakeLists.txt:33 (include)


-- Libc++abi will be using libc++ includes from /tmp/nix-build-libc++abi-x86_64-apple-darwin-11.1.0.drv-1/libcxxabi-11.1.0.src/../libcxx/include
-- Looking for fopen in c
-- Looking for fopen in c - found
-- Looking for __gcc_personality_v0 in gcc_s
-- Looking for __gcc_personality_v0 in gcc_s - not found
-- Looking for __aeabi_uldivmod in gcc
-- Looking for __aeabi_uldivmod in gcc - not found
-- Performing Test LIBCXXABI_HAS_NODEFAULTLIBS_FLAG
-- Performing Test LIBCXXABI_HAS_NODEFAULTLIBS_FLAG - Success
-- Performing Test LIBCXXABI_HAS_COMMENT_LIB_PRAGMA
-- Performing Test LIBCXXABI_HAS_COMMENT_LIB_PRAGMA - Failed
-- Performing Test LIBCXXABI_HAS_NOSTDINCXX_FLAG
-- Performing Test LIBCXXABI_HAS_NOSTDINCXX_FLAG - Success
-- Looking for dladdr in dl
-- Looking for dladdr in dl - found
-- Looking for pthread_once in pthread
-- Looking for pthread_once in pthread - found
-- Looking for __cxa_thread_atexit_impl in c
-- Looking for __cxa_thread_atexit_impl in c - not found
-- Looking for write in System
-- Looking for write in System - found
-- Performing Test LIBCXXABI_SUPPORTS_WERROR_EQ_RETURN_TYPE_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WERROR_EQ_RETURN_TYPE_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_W_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_W_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WALL_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WALL_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WCHAR_SUBSCRIPTS_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WCHAR_SUBSCRIPTS_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WCONVERSION_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WCONVERSION_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WMISMATCHED_TAGS_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WMISMATCHED_TAGS_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WMISSING_BRACES_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WMISSING_BRACES_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WNEWLINE_EOF_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WNEWLINE_EOF_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WUNUSED_FUNCTION_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WUNUSED_FUNCTION_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WSHADOW_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WSHADOW_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WSHORTEN_64_TO_32_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WSHORTEN_64_TO_32_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WSIGN_COMPARE_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WSIGN_COMPARE_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WSIGN_CONVERSION_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WSIGN_CONVERSION_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WSTRICT_ALIASING_EQ_2_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WSTRICT_ALIASING_EQ_2_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WSTRICT_OVERFLOW_EQ_4_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WSTRICT_OVERFLOW_EQ_4_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WUNUSED_PARAMETER_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WUNUSED_PARAMETER_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WUNUSED_VARIABLE_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WUNUSED_VARIABLE_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WWRITE_STRINGS_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WWRITE_STRINGS_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WUNDEF_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WUNDEF_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WNO_ERROR_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WNO_ERROR_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_WX_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_WX_FLAG - Failed
-- Performing Test LIBCXXABI_SUPPORTS_PEDANTIC_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_PEDANTIC_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_FSTRICT_ALIASING_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_FSTRICT_ALIASING_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_EHSC_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_EHSC_FLAG - Failed
-- Performing Test LIBCXXABI_SUPPORTS_FUNWIND_TABLES_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_FUNWIND_TABLES_FLAG - Success
-- Performing Test LIBCXXABI_SUPPORTS_NODEFAULTLIBS_FLAG
-- Performing Test LIBCXXABI_SUPPORTS_NODEFAULTLIBS_FLAG - Success
-- Could not find CrashReporterClient, not linking against it
-- Could not find ParallelSTL, libc++abi will not attempt to use it but the build may fail if the libc++ in use needs it to be available.
-- Configuring done
CMake Warning (dev):
  Policy CMP0068 is not set: RPATH settings on macOS do not affect
  install_name.  Run "cmake --help-policy CMP0068" for policy details.  Use
  the cmake_policy command to set the policy and suppress this warning.

  For compatibility with older versions of CMake, the install_name fields for
  the following targets are still affected by RPATH settings:

   cxxabi_shared

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    BUILD_TESTING
    CMAKE_EXPORT_NO_PACKAGE_REGISTRY
    CMAKE_FIND_USE_PACKAGE_REGISTRY
    CMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY
    CMAKE_INSTALL_BINDIR
    CMAKE_INSTALL_DOCDIR
    CMAKE_INSTALL_INCLUDEDIR
    CMAKE_INSTALL_INFODIR
    CMAKE_INSTALL_LIBDIR
    CMAKE_INSTALL_LIBEXECDIR
    CMAKE_INSTALL_LOCALEDIR
    CMAKE_INSTALL_MANDIR
    CMAKE_INSTALL_OLDINCLUDEDIR
    CMAKE_INSTALL_SBINDIR
    CMAKE_POLICY_DEFAULT_CMP0025
    LLVM_ENABLE_LIBCXX


-- Build files have been written to: /tmp/nix-build-libc++abi-x86_64-apple-darwin-11.1.0.drv-1/libcxxabi-11.1.0.src/build
cmake: enabled parallel building
@nix { "action": "setPhase", "phase": "buildPhase" }
building
build flags: -j8 -l8 SHELL=/nix/store/byydas4ipfzgq69p7lrwldq76lrhg0p1-bootstrap-tools/bin/bash
[  5%] Building CXX object src/CMakeFiles/cxxabi_static.dir/cxa_aux_runtime.cpp.o
[  5%] Building CXX object src/CMakeFiles/cxxabi_shared.dir/cxa_aux_runtime.cpp.o
[  8%] Building CXX object src/CMakeFiles/cxxabi_static.dir/cxa_default_handlers.cpp.o
[ 11%] Building CXX object src/CMakeFiles/cxxabi_shared.dir/cxa_default_handlers.cpp.o
[ 13%] Building CXX object src/CMakeFiles/cxxabi_static.dir/cxa_demangle.cpp.o
[ 16%] Building CXX object src/CMakeFiles/cxxabi_shared.dir/cxa_demangle.cpp.o
[ 19%] Building CXX object src/CMakeFiles/cxxabi_static.dir/cxa_exception_storage.cpp.o
[ 22%] Building CXX object src/CMakeFiles/cxxabi_shared.dir/cxa_exception_storage.cpp.o
clang-11clang-11: warning: : argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]warning
: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang-11clang-11: : warningwarning: : argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]

clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang-11clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
[ 27%] Building CXX object src/CMakeFiles/cxxabi_shared.dir/cxa_guard.cpp.o
[ 27%] Building CXX object src/CMakeFiles/cxxabi_static.dir/cxa_guard.cpp.o
clang-11clang-11: : warningwarning: : argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]

[ 30%] Building CXX object src/CMakeFiles/cxxabi_static.dir/cxa_handlers.cpp.o
[ 33%] Building CXX object src/CMakeFiles/cxxabi_shared.dir/cxa_handlers.cpp.o
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
[ 36%] Building CXX object src/CMakeFiles/cxxabi_shared.dir/cxa_vector.cpp.o
[ 38%] Building CXX object src/CMakeFiles/cxxabi_static.dir/cxa_vector.cpp.o
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
[ 41%] Building CXX object src/CMakeFiles/cxxabi_static.dir/cxa_virtual.cpp.o
[ 44%] Building CXX object src/CMakeFiles/cxxabi_shared.dir/cxa_virtual.cpp.o
[ 47%] Building CXX object src/CMakeFiles/cxxabi_static.dir/stdlib_exception.cpp.o
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
[ 50%] Building CXX object src/CMakeFiles/cxxabi_shared.dir/stdlib_exception.cpp.o
[ 52%] Building CXX object src/CMakeFiles/cxxabi_static.dir/stdlib_stdexcept.cpp.o
[ 55%] Building CXX object src/CMakeFiles/cxxabi_shared.dir/stdlib_stdexcept.cpp.o
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
[ 58%] Building CXX object src/CMakeFiles/cxxabi_shared.dir/stdlib_typeinfo.cpp.o
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
[ 61%] Building CXX object src/CMakeFiles/cxxabi_static.dir/stdlib_typeinfo.cpp.o
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
[ 63%] Building CXX object src/CMakeFiles/cxxabi_shared.dir/abort_message.cpp.o
[ 66%] Building CXX object src/CMakeFiles/cxxabi_static.dir/abort_message.cpp.o
[ 72%] Building CXX object src/CMakeFiles/cxxabi_static.dir/fallback_malloc.cpp.o
[ 72%] Building CXX object src/CMakeFiles/cxxabi_shared.dir/fallback_malloc.cpp.o
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
[ 75%] Building CXX object src/CMakeFiles/cxxabi_static.dir/private_typeinfo.cpp.o
[ 77%] Building CXX object src/CMakeFiles/cxxabi_static.dir/stdlib_new_delete.cpp.o
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
[ 80%] Building CXX object src/CMakeFiles/cxxabi_shared.dir/private_typeinfo.cpp.o
[ 83%] Building CXX object src/CMakeFiles/cxxabi_static.dir/cxa_exception.cpp.o
[ 86%] Building CXX object src/CMakeFiles/cxxabi_shared.dir/stdlib_new_delete.cpp.o
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
[ 88%] Building CXX object src/CMakeFiles/cxxabi_shared.dir/cxa_exception.cpp.o
[ 91%] Building CXX object src/CMakeFiles/cxxabi_static.dir/cxa_personality.cpp.o
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
[ 94%] Building CXX object src/CMakeFiles/cxxabi_shared.dir/cxa_personality.cpp.o
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
[100%] Linking CXX shared library ../lib/libc++abi.dylib
[100%] Linking CXX static library ../lib/libc++abi.a
clang-11: warning: argument unused during compilation: '-rtlib=compiler-rt' [-Wunused-command-line-argument]
ld: library not found for -lunwind
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [src/CMakeFiles/cxxabi_shared.dir/build.make:353: lib/libc++abi.1.0.dylib] Error 1
make[1]: *** [CMakeFiles/Makefile2:208: src/CMakeFiles/cxxabi_shared.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[100%] Built target cxxabi_static
make: *** [Makefile:136: all] Error 2

Stdenv bootstrap stage 3 ends up depending on LLVM 11 libunwind

I'm puzzled by this error. Does it mean stage3 is depending on libunwind without declaring it as a buildInput? But this isn't necessary for Linux, so what is going on?

building '/nix/store/5fi5jzc9aw5gyx6lqnk9s9wywfclakgx-bootstrap-stage3-stdenv-darwin.drv'...
output '/nix/store/03m9azsfjp4dpi513a703fy7n8rnd9lw-bootstrap-stage3-stdenv-darwin' is not allowed to refer to the following paths:
  /nix/store/wr77bfgqsv3yi1zqk73ph50q6xyf23n6-libunwind-11.1.0
note: keeping build directory '/private/tmp/nix-build-bootstrap-stage3-stdenv-darwin.drv-0'
building '/nix/store/m369ddqhgcyh35v7g51pjbb7dhhs3m9c-bootstrap-stage3-stdenv-darwin.drv'...
cannot build derivation '/nix/store/j73038h44hy3m0n3wraaq03dsjh1j5n8-bzip2-1.0.6.0.2.drv': 1 dependencies couldn't be built

The answer to both of these last sections was to drop the libunwind buildInput of libcxxabi again and reintroduce the standalone argument to toggle the -DLLVM_ENABLE_LIBCXX flag separately from the llvm unwinder flag.

Stdenv ends up referring to LLVM 7

I'm not sure how this can happen. The bootstrap-tools used in this build should be the LLVM 11 ones and stdenv and all-packages.nix have both had LLVM bumped to 11.

toonn@terra ~/s/nixpkgs> nix-build --no-out-link -E 'let np = import ./. {}; bts = _: tool: "/nix/store/0661xw25czfv5kqm0wd00sj0bmgcbfy6-stdenv-bootstrap-tools/on-server/" + tool; bootstrapFiles = { bootstrapFiles = np.lib.mapAttrs bts { bzip2 = "bzip2"; cpio = "cpio"; mkdir = "mkdir"; sh = "sh"; tarball = "bootstrap-tools.cpio.bz2"; }; }; in (import pkgs/stdenv/darwin/make-bootstrap-tools.nix bootstrapFiles).build' --keep-failed
warning: Nix search path entry '/nix/var/nix/profiles/per-user/root/channels' does not exist, ignoring
warning: dumping very large path (> 256 MiB); this may run out of memory
these derivations will be built:
  /nix/store/0z3360p5hr8p27gvcpkrf5bahf7r21v6-stdenv-darwin.drv
  /nix/store/5v9hmxgbv5c02qhfi773xayrkvjhlykc-perl-5.32.1.drv
  /nix/store/rnqbc3g2k5x81ck3bj9whh052cvy6lvk-openssl-1.1.1k.drv
  /nix/store/i8lx44chxz66dvfgs4asdq5j58j1b8rr-libssh2-1.9.0.drv
  /nix/store/ix8zjc2z7y9i7m4dq9a3bwhxf58dalxa-gnum4-1.4.18.drv
  /nix/store/2dp815ajbmdqrc4jfrsrra0lb6w17xl1-bison-3.7.6.drv
  /nix/store/33k1lmm47s461kqg09jqbhx1pjpjq5wc-gettext-0.21.drv
  /nix/store/r72p8nkjwrapjdhv17sx1v208mkc93ai-perl5.32.1-gettext-1.07.drv
  /nix/store/4161gfjkan8mg44i3lh46q2dgllanm0v-help2man-1.48.1.drv
  /nix/store/dzi28piprhwclp4l48g07zcwh4sf9ai7-autoconf-2.70.drv
  /nix/store/kfm51vbs922vgjg1bqzs0nfd5vzxxbhk-automake-1.16.3.drv
  /nix/store/s05k5sixkg1sqir68749zswa1k5bllsd-libtool-2.4.6.drv
  /nix/store/6hc7is22801fr0mw00c6m1ry7jagw52m-hook.drv
  /nix/store/2ncwh7dd6xqhj36pinrcnppf9g19kwr8-flex-2.6.4.drv
  /nix/store/k0rjsqqsg6bbppijb7l6k1jqfpcfd5ab-bootstrap_cmds-121.drv
  /nix/store/930llwckbiaphwnpxlnxmx5svpxhqfwi-pkg-config-0.29.2.drv
  /nix/store/wirqcfm8qhklcy09v6hx40g6cx4mnpym-pkg-config-wrapper-0.29.2.drv
  /nix/store/mrvyyxli8b98fis3mrasa5xgk8761h3c-libkrb5-1.18.drv
  /nix/store/giin43xfbxvhp4br928bjly96p4446xq-c-ares-1.17.1.drv
  /nix/store/j3qbm214ampq0hsjyrppqwd7i78r1fw2-libev-4.33.drv
  /nix/store/nrbh270nkc04v11ja1fbhq9d0cc2l66q-nghttp2-1.43.0.drv
  /nix/store/62m1qjj0f1h4360xlzswfqwbirp1zs1w-curl-7.76.1.drv
  /nix/store/a8ml8dazjs71ix5qyhp2kcc4yav3y71v-expat-2.2.10.drv
  /nix/store/j85zb5hxr7pix97087v8dhyzv83fxd89-bsdmake-24.drv
  /nix/store/b0brbc93f7dzg2avx5lqwnrbmjv8hzs3-adv_cmds-119.drv
  /nix/store/bqxqpw9kq5q345faa976yjf64c67ba62-ps-1003.1-2008.drv
  /nix/store/3yqzh5l7cwlv0mlah7akanalsksrx909-cpio-2.13.drv
  /nix/store/47p8dskv6hv5bdcmb6mkknridzb1jlh2-gdbm-1.19.drv
  /nix/store/cz92dnbff0m6jknf957xhzxa6wbksafv-sqlite-3.35.2.drv
  /nix/store/s26w6p1hwqbfzmc09h77zs67kpzzhs1h-nuke-references.drv
  /nix/store/v05dhqv55lni649g78d9rvn42zr11vxp-readline-6.3p08.drv
  /nix/store/25jbcsa9jhr76drfc99h36klipl6y1pz-launchd-842.92.1.drv
  /nix/store/99k4ll9yzwbvlp758jp31ni0fhy20m12-Security-55471.14.18.drv
  /nix/store/h8fnv2riqa1ccyddm432gw28ckwygp8a-unifdef-2.12.drv
  /nix/store/dn87dqgc59hhmn0r10mvzyjv0xylbz9h-xnu-3789.70.16.drv
  /nix/store/hxlyd4imil4wln2n00s2ihw74ly0ydw8-ppp-838.50.1.drv
  /nix/store/k5d87hms1aahp54zwxcfz5rr3j1fzd4d-IOKit-.drv
  /nix/store/zgibfbjah5p0cyqdm16dcynmq1bvh8j4-eap8021x-222.40.1.drv
  /nix/store/ynqhkahw8y29lwfb07142vnrbs3a7bq1-configd-453.19.drv
  /nix/store/7yxil4zsm99rsxqglhhzlv8qj6dldqjl-python3-3.8.9.drv
  /nix/store/1b2mx7i344laj32qfmzq0c476m4g2rln-libxml2-2.9.10.drv
  /nix/store/zl6a0bkaik93nd8gvbpbjy3v3nskfsqs-xar-1.6.1.drv
  /nix/store/kfcha72sqzjskl2q76jqirhgsysy5kyf-pbzx-1.0.2.drv
  /nix/store/pick9458dnd638ja8l724c64mapsg88h-MacOS_SDK-10.12.drv
  /nix/store/1xqiji5gw5hciw2li3g1igb7vcrsbz3c-libyaml-0.2.5.drv
  /nix/store/ws0gfx5b2cf46vkx3r1qiml2khixx68h-print-reexports.drv
  /nix/store/0n0mzr6wj58npv9swm5ljj0q66pdgpd9-apple-framework-IOKit.drv
  /nix/store/cw8kfvm63sjmkvkz2zx92ahi9l9vc88f-apple-framework-Security.drv
  /nix/store/0avji9a29wng7f1g50ndnq5g15dblydr-apple-framework-ServiceManagement.drv
  /nix/store/3z5a83zrqibxvk3sy7ah3hr5x93h4054-apple-framework-NetFS.drv
  /nix/store/gl17fmq88vvb52929kv7ax21vl8f4r0g-apple-framework-CFNetwork.drv
  /nix/store/lwzk4cgngswqz4bl6734khw8n2m3465y-apple-framework-DiskArbitration.drv
  /nix/store/p7x96715l8xb2wnhpjxv9l1r5yl1ahgh-apple-framework-CoreFoundation.drv
  /nix/store/rwlxkhpx7cjfg4l58kdvbb854xa56qjl-apple-framework-OpenDirectory.drv
  /nix/store/vp2p2nwfwyc7f2zqzgnzx5yq1dyj2l37-apple-framework-CoreData.drv
  /nix/store/xl7sp8iybczks79438677si7f48n6vxm-apple-framework-CoreAudio.drv
  /nix/store/gfgfg4rlj1p1skdwsnz9k89gb384ax7f-apple-framework-CoreServices.drv
  /nix/store/3bfss842g36v7sygpywv2mkg1nlchfid-apple-lib-xpc.drv
  /nix/store/1wrk5nql8k72lym7z4yqg4iq86j33kbn-apple-framework-IOSurface.drv
  /nix/store/66rr5kpaww0807apcnmzr852w61nzn1v-apple-framework-CoreBluetooth.drv
  /nix/store/3vn74qiqm29w92yvmn3kg5mc1mva94kp-apple-framework-IOBluetooth.drv
  /nix/store/pvwvxyxh0yc3qqckwhxz5nac6f4zjqzw-apple-framework-SecurityFoundation.drv
  /nix/store/mdcpfmwdjq3rjndl5r2yvl0hw8rdikmp-apple-framework-CoreWLAN.drv
  /nix/store/wsx5ydr23ci63jf1nw5bgrckv47xc1jh-apple-framework-Accelerate.drv
  /nix/store/wyrx1zqndw4gr3a039g7vqykmirgxg3c-apple-framework-SystemConfiguration.drv
  /nix/store/karpzjqkz1i4apmni8xbc56dgvc0wyh5-apple-framework-CoreGraphics.drv
  /nix/store/j81j94nqvvzhg42yq76f7mxi5r1kajis-apple-framework-CoreText.drv
  /nix/store/l7776pvq9nvivrai434ny6lz0hfmwph9-apple-framework-ImageIO.drv
  /nix/store/05pci16lzqa8m3cfi98v0yahy0c9d480-apple-framework-ApplicationServices.drv
  /nix/store/fnvccy0a4c7mywlhwbxa7sby4ys5hvy1-libuv-1.41.0.drv
  /nix/store/7m7ncdrrix0hcvksz1s6k7r1r24347nz-which-2.21.drv
  /nix/store/mi8l0mijpc65f73alrvciaxd8qw9x5s8-rhash-1.4.1.drv
  /nix/store/52z37h6s2qcrb4cqmixpk4fwc2rhblxw-cmake-boot-3.20.1.drv
  /nix/store/rnzm3m3bdpxrxr6r593qvk5a8nlx4b24-file-5.39.drv
  /nix/store/2fz1jh338qc3yrl29wkmz9zj9smq9az0-zstd-1.4.9.drv
  /nix/store/4f35r5jsqsyyc4qz9aikk2dahwyzhipv-lzo-2.10.drv
  /nix/store/cl5ilnfq3kpapyw5z9wpg47rr95hczmx-sharutils-4.15.2.drv
  /nix/store/wlfc9vjwsrm4n0647jz5xldqsg3z5mpf-autoconf-2.69.drv
  /nix/store/hywbxqhnpzbv18gvwdpax4yw3mzc0dn9-hook.drv
  /nix/store/q6lgy6l4pqwx0v0m7pwcmywphzvpnw01-libarchive-3.5.1.drv
  /nix/store/025d7iiijhyqiwz8spdgprwc756yhsp4-cmake-3.20.1.drv
  /nix/store/0w7wjx02zfsgx4ljy11y8j6ylaqig57y-libtapi-1100.0.11.drv
  /nix/store/5wgi9b6962nc6hi0j3n08c96waasj0yj-curl-7.76.1.drv
  /nix/store/afabqw8ai1475wk4gizx0xsgqns00jil-gnutar-1.34.drv
  /nix/store/jz3dpsibybs11mg95i0pyn6vn045lqmd-stdenv-bootstrap-tools.drv
building '/nix/store/0z3360p5hr8p27gvcpkrf5bahf7r21v6-stdenv-darwin.drv'...
output '/nix/store/3s1v43zrhqyz22xbfbw7c7k7zqr1dlk2-stdenv-darwin' is not allowed to refer to the following paths:
  /nix/store/vi15jsxsvgrkix0k9shw7xwrmix52fzs-llvm-7.1.0-lib
  /nix/store/yi2hpzrsh217zchk8gii3crk3i2vwamf-llvm-7.1.0
note: keeping build directory '/private/tmp/nix-build-stdenv-darwin.drv-5'
cannot build derivation '/nix/store/jz3dpsibybs11mg95i0pyn6vn045lqmd-stdenv-bootstrap-tools.drv': 1 dependencies couldn't be built
error: build of '/nix/store/jz3dpsibybs11mg95i0pyn6vn045lqmd-stdenv-bootstrap-tools.drv' failed
toonn@terra ~/s/nixpkgs> ls -a /private/tmp/nix-build-stdenv-darwin.drv-5
.           ..          .sandbox.sb
toonn@terra ~/s/nixpkgs> ls -Ra /nix/store/3s1v43zrhqyz22xbfbw7c7k7zqr1dlk2-stdenv-darwin
.           ..          nix-support setup

/nix/store/3s1v43zrhqyz22xbfbw7c7k7zqr1dlk2-stdenv-darwin/nix-support:
.  ..
Contents of `setup`, looks like the trivial builder?
export SHELL=/nix/store/avdmc6sdh8bf8bq1rxg8h2vs6cswn5zw-bash-4.4-p23/bin/bash
initialPath="/nix/store/g7f21llphclrwazwwpkrn0ipz1fmw1g8-coreutils-8.32 /nix/store/lshsd1s7bbsbibx2yivql2p1m8iz8qj6-findutils-4.7.0 /nix/store/qix7mk8c6nyy20gznax1y7jafa0w9ji9-diffutils-3.7 /nix/store/m0sxqjwg9m1nzzwrj105sp7gqxcmf73x-gnused-4.8 /nix/store/25m4kbmhbpbsvnrkggclbi1rxjnyk1my-gnugrep-3.6 /nix/store/mn780s9xh88irkc671graxfxchllm6zi-gawk-5.1.0 /nix/store/d6m317x32bj7jwnkrr7r4qr1g4xrghzm-gnutar-1.34 /nix/store/1ij9ddrwgzrh0nbkvqrpxsgpb77a3fap-gzip-1.10 /nix/store/1j9djiz7hy9a4lvk0sk4r44iacz7wg7i-bzip2-1.0.6.0.2-bin /nix/store/fx935whdywmzcaynsglswmqmdvl4rj0d-gnumake-4.3 /nix/store/avdmc6sdh8bf8bq1rxg8h2vs6cswn5zw-bash-4.4-p23 /nix/store/5h32nqss5q35wkirvmrad3r26sjjn341-patch-2.7.6 /nix/store/vj7yzjdvs9y9xyfifkhb1whgblb2v6b8-xz-5.2.5-bin"
defaultNativeBuildInputs="/nix/store/mjjy30kxz775bhhi6j9phw81qh6dsbrf-move-docs.sh /nix/store/kxw6q8v6isaqjm702d71n2421cxamq68-make-symlinks-relative.sh /nix/store/cl3qd985p1yxyfkj96v0hqxiy3w69xq5-compress-man-pages.sh /nix/store/h54dzwd7rdh2jlcv91424csl6d0ccgjy-strip.sh /nix/store/bnj8d7mvbkg3vdb07yz74yhl3g107qq5-patch-shebangs.sh /nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh /nix/store/1i5y55x4b4m9qkx5dqbmr1r6bvrqbanw-multiple-outputs.sh /nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh /nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh /nix/store/ngg1cv31c8c7bcm2n8ww4g06nq7s4zhm-set-source-date-epoch-to-latest.sh /nix/store/pr6nzbscdpg94yvr151lrif2kg0csx7b-reproducible-builds.sh /nix/store/phxb4rmdk07x588h69b2yw8nkyqw1k9s-clang-wrapper-11.1.0"
defaultBuildInputs="/nix/store/5d8lvlf63jbx4pwdplwnbxwzsqqrji3z-swift-corefoundation"
export NIX_ENFORCE_NO_NATIVE=${NIX_ENFORCE_NO_NATIVE-1}
export NIX_ENFORCE_PURITY=${NIX_ENFORCE_PURITY-1}
export NIX_IGNORE_LD_THROUGH_GCC=1
unset SDKROOT

# Workaround for https://openradar.appspot.com/22671534 on 10.11.
export gl_cv_func_getcwd_abort_bug=no

stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
export NIX_COREFOUNDATION_RPATH=/nix/store/5d8lvlf63jbx4pwdplwnbxwzsqqrji3z-swift-corefoundation/Library/Frameworks
export PATH_LOCALE=/nix/store/ls3sp6i5p4cip35qafyzwpvamqs3saj5-adv_cmds-119-locale/share/locale
export NIX_DONT_SET_RPATH_FOR_BUILD=1
export NIX_DONT_SET_RPATH=1
export NIX_NO_SELF_RPATH=1
export MACOSX_DEPLOYMENT_TARGET=10.12

set -eu
set -o pipefail

if (( "${NIX_DEBUG:-0}" >= 6 )); then
    set -x
fi

: ${outputs:=out}


######################################################################
# Hook handling.


# Run all hooks with the specified name in the order in which they
# were added, stopping if any fails (returns a non-zero exit
# code). The hooks for <hookName> are the shell function or variable
# <hookName>, and the values of the shell array ‘<hookName>Hooks’.
runHook() {
    local hookName="$1"
    shift
    local hooksSlice="${hookName%Hook}Hooks[@]"

    local hook
    # Hack around old bash being bad and thinking empty arrays are
    # undefined.
    for hook in "_callImplicitHook 0 $hookName" ${!hooksSlice+"${!hooksSlice}"}; do
        _eval "$hook" "$@"
    done

    return 0
}


# Run all hooks with the specified name, until one succeeds (returns a
# zero exit code). If none succeed, return a non-zero exit code.
runOneHook() {
    local hookName="$1"
    shift
    local hooksSlice="${hookName%Hook}Hooks[@]"

    local hook ret=1
    # Hack around old bash like above
    for hook in "_callImplicitHook 1 $hookName" ${!hooksSlice+"${!hooksSlice}"}; do
        if _eval "$hook" "$@"; then
            ret=0
            break
        fi
    done

    return "$ret"
}


# Run the named hook, either by calling the function with that name or
# by evaluating the variable with that name. This allows convenient
# setting of hooks both from Nix expressions (as attributes /
# environment variables) and from shell scripts (as functions). If you
# want to allow multiple hooks, use runHook instead.
_callImplicitHook() {
    local def="$1"
    local hookName="$2"
    if declare -F "$hookName" > /dev/null; then
        "$hookName"
    elif type -p "$hookName" > /dev/null; then
        source "$hookName"
    elif [ -n "${!hookName:-}" ]; then
        eval "${!hookName}"
    else
        return "$def"
    fi
    # `_eval` expects hook to need nounset disable and leave it
    # disabled anyways, so Ok to to delegate. The alternative of a
    # return trap is no good because it would affect nested returns.
}


# A function wrapper around ‘eval’ that ensures that ‘return’ inside
# hooks exits the hook, not the caller. Also will only pass args if
# command can take them
_eval() {
    if declare -F "$1" > /dev/null 2>&1; then
        "$@" # including args
    else
        eval "$1"
    fi
}


######################################################################
# Logging.

# Obsolete.
stopNest() { true; }
header() { echo "$1"; }
closeNest() { true; }

# Prints a command such that all word splits are unambiguous. We need
# to split the command in three parts because the middle format string
# will be, and must be, repeated for each argument. The first argument
# goes before the ':' and is just for convenience.
echoCmd() {
    printf "%s:" "$1"
    shift
    printf ' %q' "$@"
    echo
}


######################################################################
# Error handling.

exitHandler() {
    exitCode="$?"
    set +e

    if [ -n "${showBuildStats:-}" ]; then
        times > "$NIX_BUILD_TOP/.times"
        local -a times=($(cat "$NIX_BUILD_TOP/.times"))
        # Print the following statistics:
        # - user time for the shell
        # - system time for the shell
        # - user time for all child processes
        # - system time for all child processes
        echo "build time elapsed: " "${times[@]}"
    fi

    if (( "$exitCode" != 0 )); then
        runHook failureHook

        # If the builder had a non-zero exit code and
        # $succeedOnFailure is set, create the file
        # ‘$out/nix-support/failed’ to signal failure, and exit
        # normally.  Otherwise, return the original exit code.
        if [ -n "${succeedOnFailure:-}" ]; then
            echo "build failed with exit code $exitCode (ignored)"
            mkdir -p "$out/nix-support"
            printf "%s" "$exitCode" > "$out/nix-support/failed"
            exit 0
        fi

    else
        runHook exitHook
    fi

    exit "$exitCode"
}

trap "exitHandler" EXIT


######################################################################
# Helper functions.


addToSearchPathWithCustomDelimiter() {
    local delimiter="$1"
    local varName="$2"
    local dir="$3"
    if [[ -d "$dir" && "${!varName:+${delimiter}${!varName}${delimiter}}" \
          != *"${delimiter}${dir}${delimiter}"* ]]; then
        export "${varName}=${!varName:+${!varName}${delimiter}}${dir}"
    fi
}

addToSearchPath() {
    addToSearchPathWithCustomDelimiter ":" "$@"
}

# Add $1/lib* into rpaths.
# The function is used in multiple-outputs.sh hook,
# so it is defined here but tried after the hook.
_addRpathPrefix() {
    if [ "${NIX_NO_SELF_RPATH:-0}" != 1 ]; then
        export NIX_LDFLAGS="-rpath $1/lib ${NIX_LDFLAGS-}"
        if [ -n "${NIX_LIB64_IN_SELF_RPATH:-}" ]; then
            export NIX_LDFLAGS="-rpath $1/lib64 ${NIX_LDFLAGS-}"
        fi
        if [ -n "${NIX_LIB32_IN_SELF_RPATH:-}" ]; then
            export NIX_LDFLAGS="-rpath $1/lib32 ${NIX_LDFLAGS-}"
        fi
    fi
}

# Return success if the specified file is an ELF object.
isELF() {
    local fn="$1"
    local fd
    local magic
    exec {fd}< "$fn"
    read -r -n 4 -u "$fd" magic
    exec {fd}<&-
    if [ "$magic" = $'\177ELF' ]; then return 0; else return 1; fi
}

# Return success if the specified file is a script (i.e. starts with
# "#!").
isScript() {
    local fn="$1"
    local fd
    local magic
    exec {fd}< "$fn"
    read -r -n 2 -u "$fd" magic
    exec {fd}<&-
    if [[ "$magic" =~ \#! ]]; then return 0; else return 1; fi
}

# printf unfortunately will print a trailing newline regardless
printLines() {
    (( "$#" > 0 )) || return 0
    printf '%s\n' "$@"
}

printWords() {
    (( "$#" > 0 )) || return 0
    printf '%s ' "$@"
}

######################################################################
# Initialisation.


# Set a fallback default value for SOURCE_DATE_EPOCH, used by some build tools
# to provide a deterministic substitute for the "current" time. Note that
# 315532800 = 1980-01-01 12:00:00. We use this date because python's wheel
# implementation uses zip archive and zip does not support dates going back to
# 1970.
export SOURCE_DATE_EPOCH
: ${SOURCE_DATE_EPOCH:=315532800}


# Wildcard expansions that don't match should expand to an empty list.
# This ensures that, for instance, "for i in *; do ...; done" does the
# right thing.
shopt -s nullglob


# Set up the initial path.
PATH=
HOST_PATH=
for i in $initialPath; do
    if [ "$i" = / ]; then i=; fi
    addToSearchPath PATH "$i/bin"

    # For backward compatibility, we add initial path to HOST_PATH so
    # it can be used in auto patch-shebangs. Unfortunately this will
    # not work with cross compilation.
    if [ -z "${strictDeps-}" ]; then
        addToSearchPath HOST_PATH "$i/bin"
    fi
done

unset i

if (( "${NIX_DEBUG:-0}" >= 1 )); then
    echo "initial path: $PATH"
fi


# Check that the pre-hook initialised SHELL.
if [ -z "${SHELL:-}" ]; then echo "SHELL not set"; exit 1; fi
BASH="$SHELL"
export CONFIG_SHELL="$SHELL"


# Execute the pre-hook.
if [ -z "${shell:-}" ]; then export shell="$SHELL"; fi
runHook preHook


# Allow the caller to augment buildInputs (it's not always possible to
# do this before the call to setup.sh, since the PATH is empty at that
# point; here we have a basic Unix environment).
runHook addInputsHook


# Package accumulators

# shellcheck disable=SC2034
declare -a pkgsBuildBuild pkgsBuildHost pkgsBuildTarget
declare -a pkgsHostHost pkgsHostTarget
declare -a pkgsTargetTarget

declare -a pkgBuildAccumVars=(pkgsBuildBuild pkgsBuildHost pkgsBuildTarget)
declare -a pkgHostAccumVars=(pkgsHostHost pkgsHostTarget)
declare -a pkgTargetAccumVars=(pkgsTargetTarget)

declare -a pkgAccumVarVars=(pkgBuildAccumVars pkgHostAccumVars pkgTargetAccumVars)


# Hooks

declare -a envBuildBuildHooks envBuildHostHooks envBuildTargetHooks
declare -a envHostHostHooks envHostTargetHooks
declare -a envTargetTargetHooks

declare -a pkgBuildHookVars=(envBuildBuildHook envBuildHostHook envBuildTargetHook)
declare -a pkgHostHookVars=(envHostHostHook envHostTargetHook)
declare -a pkgTargetHookVars=(envTargetTargetHook)

declare -a pkgHookVarVars=(pkgBuildHookVars pkgHostHookVars pkgTargetHookVars)

# Add env hooks for all sorts of deps with the specified host offset.
addEnvHooks() {
    local depHostOffset="$1"
    shift
    local pkgHookVarsSlice="${pkgHookVarVars[$depHostOffset + 1]}[@]"
    local pkgHookVar
    for pkgHookVar in "${!pkgHookVarsSlice}"; do
        eval "${pkgHookVar}s"'+=("$@")'
    done
}


# Propagated dep files

declare -a propagatedBuildDepFiles=(
    propagated-build-build-deps
    propagated-native-build-inputs # Legacy name for back-compat
    propagated-build-target-deps
)
declare -a propagatedHostDepFiles=(
    propagated-host-host-deps
    propagated-build-inputs # Legacy name for back-compat
)
declare -a propagatedTargetDepFiles=(
    propagated-target-target-deps
)
declare -a propagatedDepFilesVars=(
    propagatedBuildDepFiles
    propagatedHostDepFiles
    propagatedTargetDepFiles
)

# Platform offsets: build = -1, host = 0, target = 1
declare -a allPlatOffsets=(-1 0 1)


# Mutually-recursively find all build inputs. See the dependency section of the
# stdenv chapter of the Nixpkgs manual for the specification this algorithm
# implements.
findInputs() {
    local -r pkg="$1"
    local -ri hostOffset="$2"
    local -ri targetOffset="$3"

    # Sanity check
    (( "$hostOffset" <= "$targetOffset" )) || exit -1

    local varVar="${pkgAccumVarVars[$hostOffset + 1]}"
    local varRef="$varVar[\$targetOffset - \$hostOffset]"
    local var="${!varRef}"
    unset -v varVar varRef

    # TODO(@Ericson2314): Restore using associative array once Darwin
    # nix-shell doesn't use impure bash. This should replace the O(n)
    # case with an O(1) hash map lookup, assuming bash is implemented
    # well :D.
    local varSlice="$var[*]"
    # ${..-} to hack around old bash empty array problem
    case "${!varSlice-}" in
        *" $pkg "*) return 0 ;;
    esac
    unset -v varSlice

    eval "$var"'+=("$pkg")'

    if ! [ -e "$pkg" ]; then
        echo "build input $pkg does not exist" >&2
        exit 1
    fi

    # The current package's host and target offset together
    # provide a <=-preserving homomorphism from the relative
    # offsets to current offset
    local -i mapOffsetResult
    function mapOffset() {
        local -ri inputOffset="$1"
        if (( "$inputOffset" <= 0 )); then
            local -ri outputOffset="$inputOffset + $hostOffset"
        else
            local -ri outputOffset="$inputOffset - 1 + $targetOffset"
        fi
        mapOffsetResult="$outputOffset"
    }

    # Host offset relative to that of the package whose immediate
    # dependencies we are currently exploring.
    local -i relHostOffset
    for relHostOffset in "${allPlatOffsets[@]}"; do
        # `+ 1` so we start at 0 for valid index
        local files="${propagatedDepFilesVars[$relHostOffset + 1]}"

        # Host offset relative to the package currently being
        # built---as absolute an offset as will be used.
        mapOffset relHostOffset
        local -i hostOffsetNext="$mapOffsetResult"

        # Ensure we're in bounds relative to the package currently
        # being built.
        [[ "${allPlatOffsets[*]}" = *"$hostOffsetNext"*  ]] || continue

        # Target offset relative to the *host* offset of the package
        # whose immediate dependencies we are currently exploring.
        local -i relTargetOffset
        for relTargetOffset in "${allPlatOffsets[@]}"; do
            (( "$relHostOffset" <= "$relTargetOffset" )) || continue

            local fileRef="${files}[$relTargetOffset - $relHostOffset]"
            local file="${!fileRef}"
            unset -v fileRef

            # Target offset relative to the package currently being
            # built.
            mapOffset relTargetOffset
            local -i targetOffsetNext="$mapOffsetResult"

            # Once again, ensure we're in bounds relative to the
            # package currently being built.
            [[ "${allPlatOffsets[*]}" = *"$targetOffsetNext"* ]] || continue

            [[ -f "$pkg/nix-support/$file" ]] || continue

            local pkgNext
            read -r -d '' pkgNext < "$pkg/nix-support/$file" || true
            for pkgNext in $pkgNext; do
                findInputs "$pkgNext" "$hostOffsetNext" "$targetOffsetNext"
            done
        done
    done
}

# Make sure all are at least defined as empty
: ${depsBuildBuild=} ${depsBuildBuildPropagated=}
: ${nativeBuildInputs=} ${propagatedNativeBuildInputs=} ${defaultNativeBuildInputs=}
: ${depsBuildTarget=} ${depsBuildTargetPropagated=}
: ${depsHostHost=} ${depsHostHostPropagated=}
: ${buildInputs=} ${propagatedBuildInputs=} ${defaultBuildInputs=}
: ${depsTargetTarget=} ${depsTargetTargetPropagated=}

for pkg in $depsBuildBuild $depsBuildBuildPropagated; do
    findInputs "$pkg" -1 -1
done
for pkg in $nativeBuildInputs $propagatedNativeBuildInputs; do
    findInputs "$pkg" -1  0
done
for pkg in $depsBuildTarget $depsBuildTargetPropagated; do
    findInputs "$pkg" -1  1
done
for pkg in $depsHostHost $depsHostHostPropagated; do
    findInputs "$pkg"  0  0
done
for pkg in $buildInputs $propagatedBuildInputs ; do
    findInputs "$pkg"  0  1
done
for pkg in $depsTargetTarget $depsTargetTargetPropagated; do
    findInputs "$pkg"  1  1
done
# Default inputs must be processed last
for pkg in $defaultNativeBuildInputs; do
    findInputs "$pkg" -1  0
done
for pkg in $defaultBuildInputs; do
    findInputs "$pkg"  0  1
done

# Add package to the future PATH and run setup hooks
activatePackage() {
    local pkg="$1"
    local -ri hostOffset="$2"
    local -ri targetOffset="$3"

    # Sanity check
    (( "$hostOffset" <= "$targetOffset" )) || exit -1

    if [ -f "$pkg" ]; then
        source "$pkg"
    fi

    # Only dependencies whose host platform is guaranteed to match the
    # build platform are included here. That would be `depsBuild*`,
    # and legacy `nativeBuildInputs`, in general. If we aren't cross
    # compiling, however, everything can be put on the PATH. To ease
    # the transition, we do include everything in thatcase.
    #
    # TODO(@Ericson2314): Don't special-case native compilation
    if [[ -z "${strictDeps-}" || "$hostOffset" -le -1 ]]; then
        addToSearchPath _PATH "$pkg/bin"
    fi

    if [[ "$hostOffset" -le -1 ]]; then
        addToSearchPath _XDG_DATA_DIRS "$pkg/share"
    fi

    if [[ "$hostOffset" -eq 0 && -d "$pkg/bin" ]]; then
        addToSearchPath _HOST_PATH "$pkg/bin"
    fi

    if [[ -f "$pkg/nix-support/setup-hook" ]]; then
        source "$pkg/nix-support/setup-hook"
    fi
}

_activatePkgs() {
    local -i hostOffset targetOffset
    local pkg

    for hostOffset in "${allPlatOffsets[@]}"; do
        local pkgsVar="${pkgAccumVarVars[$hostOffset + 1]}"
        for targetOffset in "${allPlatOffsets[@]}"; do
            (( "$hostOffset" <= "$targetOffset" )) || continue
            local pkgsRef="${pkgsVar}[$targetOffset - $hostOffset]"
            local pkgsSlice="${!pkgsRef}[@]"
            for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; do
                activatePackage "$pkg" "$hostOffset" "$targetOffset"
            done
        done
    done
}

# Run the package setup hooks and build _PATH
_activatePkgs

# Set the relevant environment variables to point to the build inputs
# found above.
#
# These `depOffset`s, beyond indexing the arrays, also tell the env
# hook what sort of dependency (ignoring propagatedness) is being
# passed to the env hook. In a real language, we'd append a closure
# with this information to the relevant env hook array, but bash
# doesn't have closures, so it's easier to just pass this in.
_addToEnv() {
    local -i depHostOffset depTargetOffset
    local pkg

    for depHostOffset in "${allPlatOffsets[@]}"; do
        local hookVar="${pkgHookVarVars[$depHostOffset + 1]}"
        local pkgsVar="${pkgAccumVarVars[$depHostOffset + 1]}"
        for depTargetOffset in "${allPlatOffsets[@]}"; do
            (( "$depHostOffset" <= "$depTargetOffset" )) || continue
            local hookRef="${hookVar}[$depTargetOffset - $depHostOffset]"
            if [[ -z "${strictDeps-}" ]]; then

                # Keep track of which packages we have visited before.
                local visitedPkgs=""

                # Apply environment hooks to all packages during native
                # compilation to ease the transition.
                #
                # TODO(@Ericson2314): Don't special-case native compilation
                for pkg in \
                    ${pkgsBuildBuild+"${pkgsBuildBuild[@]}"} \
                    ${pkgsBuildHost+"${pkgsBuildHost[@]}"} \
                    ${pkgsBuildTarget+"${pkgsBuildTarget[@]}"} \
                    ${pkgsHostHost+"${pkgsHostHost[@]}"} \
                    ${pkgsHostTarget+"${pkgsHostTarget[@]}"} \
                    ${pkgsTargetTarget+"${pkgsTargetTarget[@]}"}
                do
                    if [[ "$visitedPkgs" = *"$pkg"* ]]; then
                        continue
                    fi
                    runHook "${!hookRef}" "$pkg"
                    visitedPkgs+=" $pkg"
                done
            else
                local pkgsRef="${pkgsVar}[$depTargetOffset - $depHostOffset]"
                local pkgsSlice="${!pkgsRef}[@]"
                for pkg in ${!pkgsSlice+"${!pkgsSlice}"}; do
                    runHook "${!hookRef}" "$pkg"
                done
            fi
        done
    done
}

# Run the package-specific hooks set by the setup-hook scripts.
_addToEnv


# Unset setup-specific declared variables
unset allPlatOffsets
unset pkgBuildAccumVars pkgHostAccumVars pkgTargetAccumVars pkgAccumVarVars
unset pkgBuildHookVars pkgHostHookVars pkgTargetHookVars pkgHookVarVars
unset propagatedDepFilesVars


_addRpathPrefix "$out"


# Set the TZ (timezone) environment variable, otherwise commands like
# `date' will complain (e.g., `Tue Mar 9 10:01:47 Local time zone must
# be set--see zic manual page 2004').
export TZ=UTC


# Set the prefix.  This is generally $out, but it can be overriden,
# for instance if we just want to perform a test build/install to a
# temporary location and write a build report to $out.
if [ -z "${prefix:-}" ]; then
    prefix="$out";
fi

if [ "${useTempPrefix:-}" = 1 ]; then
    prefix="$NIX_BUILD_TOP/tmp_prefix";
fi


PATH="${_PATH-}${_PATH:+${PATH:+:}}$PATH"
HOST_PATH="${_HOST_PATH-}${_HOST_PATH:+${HOST_PATH:+:}}$HOST_PATH"
export XDG_DATA_DIRS="${_XDG_DATA_DIRS-}${_XDG_DATA_DIRS:+${XDG_DATA_DIRS:+:}}${XDG_DATA_DIRS-}"
if (( "${NIX_DEBUG:-0}" >= 1 )); then
    echo "final path: $PATH"
    echo "final host path: $HOST_PATH"
    echo "final data dirs: $XDG_DATA_DIRS"
fi

unset _PATH
unset _HOST_PATH
unset _XDG_DATA_DIRS


# Make GNU Make produce nested output.
export NIX_INDENT_MAKE=1


# Normalize the NIX_BUILD_CORES variable. The value might be 0, which
# means that we're supposed to try and auto-detect the number of
# available CPU cores at run-time.

if [ -z "${NIX_BUILD_CORES:-}" ]; then
  NIX_BUILD_CORES="1"
elif [ "$NIX_BUILD_CORES" -le 0 ]; then
  NIX_BUILD_CORES=$(nproc 2>/dev/null || true)
  if expr >/dev/null 2>&1 "$NIX_BUILD_CORES" : "^[0-9][0-9]*$"; then
    :
  else
    NIX_BUILD_CORES="1"
  fi
fi
export NIX_BUILD_CORES


# Prevent SSL libraries from using certificates in /etc/ssl, unless set explicitly.
# Leave it in impure shells for convenience.
if [ -z "${NIX_SSL_CERT_FILE:-}" ] && [ "${IN_NIX_SHELL:-}" != "impure" ]; then
  export NIX_SSL_CERT_FILE=/no-cert-file.crt
fi
# Another variant left for compatibility.
if [ -z "${SSL_CERT_FILE:-}" ] && [ "${IN_NIX_SHELL:-}" != "impure" ]; then
  export SSL_CERT_FILE=/no-cert-file.crt
fi


######################################################################
# Textual substitution functions.


substituteStream() {
    local var=$1
    local description=$2
    shift 2

    while (( "$#" )); do
        case "$1" in
            --replace)
                pattern="$2"
                replacement="$3"
                shift 3
                local savedvar
                savedvar="${!var}"
                eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'
                if [ "$pattern" != "$replacement" ]; then
                    if [ "${!var}" == "$savedvar" ]; then
                        echo "substituteStream(): WARNING: pattern '$pattern' doesn't match anything in $description" >&2
                    fi
                fi
                ;;

            --subst-var)
                local varName="$2"
                shift 2
                # check if the used nix attribute name is a valid bash name
                if ! [[ "$varName" =~ ^[a-zA-Z_][a-zA-Z0-9_]*$ ]]; then
                    echo "substituteStream(): ERROR: substitution variables must be valid Bash names, \"$varName\" isn't." >&2
                    return 1
                fi
                if [ -z ${!varName+x} ]; then
                    echo "substituteStream(): ERROR: variable \$$varName is unset" >&2
                    return 1
                fi
                pattern="@$varName@"
                replacement="${!varName}"
                eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'
                ;;

            --subst-var-by)
                pattern="@$2@"
                replacement="$3"
                eval "$var"'=${'"$var"'//"$pattern"/"$replacement"}'
                shift 3
                ;;

            *)
                echo "substituteStream(): ERROR: Invalid command line argument: $1" >&2
                return 1
                ;;
        esac
    done

    printf "%s" "${!var}"
}

consumeEntire() {
    # read returns non-0 on EOF, so we want read to fail
    if IFS='' read -r -N 0 $1; then
        echo "consumeEntire(): ERROR: Input null bytes, won't process" >&2
        return 1
    fi
}

substitute() {
    local input="$1"
    local output="$2"
    shift 2

    if [ ! -f "$input" ]; then
        echo "substitute(): ERROR: file '$input' does not exist" >&2
        return 1
    fi

    local content
    consumeEntire content < "$input"

    if [ -e "$output" ]; then chmod +w "$output"; fi
    substituteStream content "file '$input'" "$@" > "$output"
}

substituteInPlace() {
    local fileName="$1"
    shift
    substitute "$fileName" "$fileName" "$@"
}

_allFlags() {
    for varName in $(awk 'BEGIN { for (v in ENVIRON) if (v ~ /^[a-z][a-zA-Z0-9_]*$/) print v }'); do
        if (( "${NIX_DEBUG:-0}" >= 1 )); then
            printf "@%s@ -> %q\n" "${varName}" "${!varName}"
        fi
        args+=("--subst-var" "$varName")
    done
}

substituteAllStream() {
    local -a args=()
    _allFlags

    substituteStream "$1" "$2" "${args[@]}"
}

# Substitute all environment variables that start with a lowercase character and
# are valid Bash names.
substituteAll() {
    local input="$1"
    local output="$2"

    local -a args=()
    _allFlags

    substitute "$input" "$output" "${args[@]}"
}


substituteAllInPlace() {
    local fileName="$1"
    shift
    substituteAll "$fileName" "$fileName" "$@"
}


######################################################################
# What follows is the generic builder.


# This function is useful for debugging broken Nix builds.  It dumps
# all environment variables to a file `env-vars' in the build
# directory.  If the build fails and the `-K' option is used, you can
# then go to the build directory and source in `env-vars' to reproduce
# the environment used for building.
dumpVars() {
    if [ "${noDumpEnvVars:-0}" != 1 ]; then
        export 2>/dev/null >| "$NIX_BUILD_TOP/env-vars" || true
    fi
}


# Utility function: echo the base name of the given path, with the
# prefix `HASH-' removed, if present.
stripHash() {
    local strippedName casematchOpt=0
    # On separate line for `set -e`
    strippedName="$(basename -- "$1")"
    shopt -q nocasematch && casematchOpt=1
    shopt -u nocasematch
    if [[ "$strippedName" =~ ^[a-z0-9]{32}- ]]; then
        echo "${strippedName:33}"
    else
        echo "$strippedName"
    fi
    if (( casematchOpt )); then shopt -s nocasematch; fi
}


unpackCmdHooks+=(_defaultUnpack)
_defaultUnpack() {
    local fn="$1"

    if [ -d "$fn" ]; then

        # We can't preserve hardlinks because they may have been
        # introduced by store optimization, which might break things
        # in the build.
        cp -pr --reflink=auto -- "$fn" "$(stripHash "$fn")"

    else

        case "$fn" in
            *.tar.xz | *.tar.lzma | *.txz)
                # Don't rely on tar knowing about .xz.
                xz -d < "$fn" | tar xf -
                ;;
            *.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz)
                # GNU tar can automatically select the decompression method
                # (info "(tar) gzip").
                tar xf "$fn"
                ;;
            *)
                return 1
                ;;
        esac

    fi
}


unpackFile() {
    curSrc="$1"
    header "unpacking source archive $curSrc" 3
    if ! runOneHook unpackCmd "$curSrc"; then
        echo "do not know how to unpack source archive $curSrc"
        exit 1
    fi
}


unpackPhase() {
    runHook preUnpack

    if [ -z "${srcs:-}" ]; then
        if [ -z "${src:-}" ]; then
            # shellcheck disable=SC2016
            echo 'variable $src or $srcs should point to the source'
            exit 1
        fi
        srcs="$src"
    fi

    # To determine the source directory created by unpacking the
    # source archives, we record the contents of the current
    # directory, then look below which directory got added.  Yeah,
    # it's rather hacky.
    local dirsBefore=""
    for i in *; do
        if [ -d "$i" ]; then
            dirsBefore="$dirsBefore $i "
        fi
    done

    # Unpack all source archives.
    for i in $srcs; do
        unpackFile "$i"
    done

    # Find the source directory.

    # set to empty if unset
    : ${sourceRoot=}

    if [ -n "${setSourceRoot:-}" ]; then
        runOneHook setSourceRoot
    elif [ -z "$sourceRoot" ]; then
        for i in *; do
            if [ -d "$i" ]; then
                case $dirsBefore in
                    *\ $i\ *)
                        ;;
                    *)
                        if [ -n "$sourceRoot" ]; then
                            echo "unpacker produced multiple directories"
                            exit 1
                        fi
                        sourceRoot="$i"
                        ;;
                esac
            fi
        done
    fi

    if [ -z "$sourceRoot" ]; then
        echo "unpacker appears to have produced no directories"
        exit 1
    fi

    echo "source root is $sourceRoot"

    # By default, add write permission to the sources.  This is often
    # necessary when sources have been copied from other store
    # locations.
    if [ "${dontMakeSourcesWritable:-0}" != 1 ]; then
        chmod -R u+w -- "$sourceRoot"
    fi

    runHook postUnpack
}


patchPhase() {
    runHook prePatch

    for i in ${patches:-}; do
        header "applying patch $i" 3
        local uncompress=cat
        case "$i" in
            *.gz)
                uncompress="gzip -d"
                ;;
            *.bz2)
                uncompress="bzip2 -d"
                ;;
            *.xz)
                uncompress="xz -d"
                ;;
            *.lzma)
                uncompress="lzma -d"
                ;;
        esac
        # "2>&1" is a hack to make patch fail if the decompressor fails (nonexistent patch, etc.)
        # shellcheck disable=SC2086
        $uncompress < "$i" 2>&1 | patch ${patchFlags:--p1}
    done

    runHook postPatch
}


fixLibtool() {
    sed -i -e 's^eval sys_lib_.*search_path=.*^^' "$1"
}


configurePhase() {
    runHook preConfigure

    # set to empty if unset
    : ${configureScript=}
    : ${configureFlags=}

    if [[ -z "$configureScript" && -x ./configure ]]; then
        configureScript=./configure
    fi

    if [ -z "${dontFixLibtool:-}" ]; then
        local i
        find . -iname "ltmain.sh" -print0 | while IFS='' read -r -d '' i; do
            echo "fixing libtool script $i"
            fixLibtool "$i"
        done
    fi

    if [[ -z "${dontAddPrefix:-}" && -n "$prefix" ]]; then
        configureFlags="${prefixKey:---prefix=}$prefix $configureFlags"
    fi

    # Add --disable-dependency-tracking to speed up some builds.
    if [ -z "${dontAddDisableDepTrack:-}" ]; then
        if [ -f "$configureScript" ] && grep -q dependency-tracking "$configureScript"; then
            configureFlags="--disable-dependency-tracking $configureFlags"
        fi
    fi

    # By default, disable static builds.
    if [ -z "${dontDisableStatic:-}" ]; then
        if [ -f "$configureScript" ] && grep -q enable-static "$configureScript"; then
            configureFlags="--disable-static $configureFlags"
        fi
    fi

    if [ -n "$configureScript" ]; then
        # Old bash empty array hack
        # shellcheck disable=SC2086
        local flagsArray=(
            $configureFlags ${configureFlagsArray+"${configureFlagsArray[@]}"}
        )
        echoCmd 'configure flags' "${flagsArray[@]}"
        # shellcheck disable=SC2086
        $configureScript "${flagsArray[@]}"
        unset flagsArray
    else
        echo "no configure script, doing nothing"
    fi

    runHook postConfigure
}


buildPhase() {
    runHook preBuild

    # set to empty if unset
    : ${makeFlags=}

    if [[ -z "$makeFlags" && -z "${makefile:-}" && ! ( -e Makefile || -e makefile || -e GNUmakefile ) ]]; then
        echo "no Makefile, doing nothing"
    else
        foundMakefile=1

        # Old bash empty array hack
        # shellcheck disable=SC2086
        local flagsArray=(
            ${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}}
            SHELL=$SHELL
            $makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"}
            $buildFlags ${buildFlagsArray+"${buildFlagsArray[@]}"}
        )

        echoCmd 'build flags' "${flagsArray[@]}"
        make ${makefile:+-f $makefile} "${flagsArray[@]}"
        unset flagsArray
    fi

    runHook postBuild
}


checkPhase() {
    runHook preCheck

    if [[ -z "${foundMakefile:-}" ]]; then
        echo "no Makefile or custom checkPhase, doing nothing"
        runHook postCheck
        return
    fi

    if [[ -z "${checkTarget:-}" ]]; then
        #TODO(@oxij): should flagsArray influence make -n?
        if make -n ${makefile:+-f $makefile} check >/dev/null 2>&1; then
            checkTarget=check
        elif make -n ${makefile:+-f $makefile} test >/dev/null 2>&1; then
            checkTarget=test
        fi
    fi

    if [[ -z "${checkTarget:-}" ]]; then
        echo "no check/test target in ${makefile:-Makefile}, doing nothing"
    else
        # Old bash empty array hack
        # shellcheck disable=SC2086
        local flagsArray=(
            ${enableParallelChecking:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}}
            SHELL=$SHELL
            $makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"}
            ${checkFlags:-VERBOSE=y} ${checkFlagsArray+"${checkFlagsArray[@]}"}
            ${checkTarget}
        )

        echoCmd 'check flags' "${flagsArray[@]}"
        make ${makefile:+-f $makefile} "${flagsArray[@]}"

        unset flagsArray
    fi

    runHook postCheck
}


installPhase() {
    runHook preInstall

    if [ -n "$prefix" ]; then
        mkdir -p "$prefix"
    fi

    # Old bash empty array hack
    # shellcheck disable=SC2086
    local flagsArray=(
        SHELL=$SHELL
        $makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"}
        $installFlags ${installFlagsArray+"${installFlagsArray[@]}"}
        ${installTargets:-install}
    )

    echoCmd 'install flags' "${flagsArray[@]}"
    make ${makefile:+-f $makefile} "${flagsArray[@]}"
    unset flagsArray

    runHook postInstall
}


# The fixup phase performs generic, package-independent stuff, like
# stripping binaries, running patchelf and setting
# propagated-build-inputs.
fixupPhase() {
    # Make sure everything is writable so "strip" et al. work.
    local output
    for output in $outputs; do
        if [ -e "${!output}" ]; then chmod -R u+w "${!output}"; fi
    done

    runHook preFixup

    # Apply fixup to each output.
    local output
    for output in $outputs; do
        prefix="${!output}" runHook fixupOutput
    done


    # Propagate dependencies & setup hook into the development output.
    declare -ra flatVars=(
        # Build
        depsBuildBuildPropagated
        propagatedNativeBuildInputs
        depsBuildTargetPropagated
        # Host
        depsHostHostPropagated
        propagatedBuildInputs
        # Target
        depsTargetTargetPropagated
    )
    declare -ra flatFiles=(
        "${propagatedBuildDepFiles[@]}"
        "${propagatedHostDepFiles[@]}"
        "${propagatedTargetDepFiles[@]}"
    )

    local propagatedInputsIndex
    for propagatedInputsIndex in "${!flatVars[@]}"; do
        local propagatedInputsSlice="${flatVars[$propagatedInputsIndex]}[@]"
        local propagatedInputsFile="${flatFiles[$propagatedInputsIndex]}"

        [[ "${!propagatedInputsSlice}" ]] || continue

        mkdir -p "${!outputDev}/nix-support"
        # shellcheck disable=SC2086
        printWords ${!propagatedInputsSlice} > "${!outputDev}/nix-support/$propagatedInputsFile"
    done


    if [ -n "${setupHook:-}" ]; then
        mkdir -p "${!outputDev}/nix-support"
        substituteAll "$setupHook" "${!outputDev}/nix-support/setup-hook"
    fi

    # TODO(@Ericson2314): Remove after https://github.com/NixOS/nixpkgs/pull/31414
    if [ -n "${setupHooks:-}" ]; then
        mkdir -p "${!outputDev}/nix-support"
        local hook
        for hook in $setupHooks; do
            local content
            consumeEntire content < "$hook"
            substituteAllStream content "file '$hook'" >> "${!outputDev}/nix-support/setup-hook"
            unset -v content
        done
        unset -v hook
    fi

    # Propagate user-env packages into the output with binaries, TODO?

    if [ -n "${propagatedUserEnvPkgs:-}" ]; then
        mkdir -p "${!outputBin}/nix-support"
        # shellcheck disable=SC2086
        printWords $propagatedUserEnvPkgs > "${!outputBin}/nix-support/propagated-user-env-packages"
    fi

    runHook postFixup
}


installCheckPhase() {
    runHook preInstallCheck

    if [[ -z "${foundMakefile:-}" ]]; then
        echo "no Makefile or custom installCheckPhase, doing nothing"
    #TODO(@oxij): should flagsArray influence make -n?
    elif [[ -z "${installCheckTarget:-}" ]] \
       && ! make -n ${makefile:+-f $makefile} ${installCheckTarget:-installcheck} >/dev/null 2>&1; then
        echo "no installcheck target in ${makefile:-Makefile}, doing nothing"
    else
        # Old bash empty array hack
        # shellcheck disable=SC2086
        local flagsArray=(
            ${enableParallelChecking:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}}
            SHELL=$SHELL
            $makeFlags ${makeFlagsArray+"${makeFlagsArray[@]}"}
            $installCheckFlags ${installCheckFlagsArray+"${installCheckFlagsArray[@]}"}
            ${installCheckTarget:-installcheck}
        )

        echoCmd 'installcheck flags' "${flagsArray[@]}"
        make ${makefile:+-f $makefile} "${flagsArray[@]}"
        unset flagsArray
    fi

    runHook postInstallCheck
}


distPhase() {
    runHook preDist

    # Old bash empty array hack
    # shellcheck disable=SC2086
    local flagsArray=(
        $distFlags ${distFlagsArray+"${distFlagsArray[@]}"} ${distTarget:-dist}
    )

    echo 'dist flags: %q' "${flagsArray[@]}"
    make ${makefile:+-f $makefile} "${flagsArray[@]}"

    if [ "${dontCopyDist:-0}" != 1 ]; then
        mkdir -p "$out/tarballs"

        # Note: don't quote $tarballs, since we explicitly permit
        # wildcards in there.
        # shellcheck disable=SC2086
        cp -pvd ${tarballs:-*.tar.gz} "$out/tarballs"
    fi

    runHook postDist
}


showPhaseHeader() {
    local phase="$1"
    case "$phase" in
        unpackPhase) header "unpacking sources";;
        patchPhase) header "patching sources";;
        configurePhase) header "configuring";;
        buildPhase) header "building";;
        checkPhase) header "running tests";;
        installPhase) header "installing";;
        fixupPhase) header "post-installation fixup";;
        installCheckPhase) header "running install tests";;
        *) header "$phase";;
    esac
}


genericBuild() {
    if [ -f "${buildCommandPath:-}" ]; then
        source "$buildCommandPath"
        return
    fi
    if [ -n "${buildCommand:-}" ]; then
        eval "$buildCommand"
        return
    fi

    if [ -z "${phases:-}" ]; then
        phases="${prePhases:-} unpackPhase patchPhase ${preConfigurePhases:-} \
            configurePhase ${preBuildPhases:-} buildPhase checkPhase \
            ${preInstallPhases:-} installPhase ${preFixupPhases:-} fixupPhase installCheckPhase \
            ${preDistPhases:-} distPhase ${postPhases:-}";
    fi

    for curPhase in $phases; do
        if [[ "$curPhase" = unpackPhase && -n "${dontUnpack:-}" ]]; then continue; fi
        if [[ "$curPhase" = patchPhase && -n "${dontPatch:-}" ]]; then continue; fi
        if [[ "$curPhase" = configurePhase && -n "${dontConfigure:-}" ]]; then continue; fi
        if [[ "$curPhase" = buildPhase && -n "${dontBuild:-}" ]]; then continue; fi
        if [[ "$curPhase" = checkPhase && -z "${doCheck:-}" ]]; then continue; fi
        if [[ "$curPhase" = installPhase && -n "${dontInstall:-}" ]]; then continue; fi
        if [[ "$curPhase" = fixupPhase && -n "${dontFixup:-}" ]]; then continue; fi
        if [[ "$curPhase" = installCheckPhase && -z "${doInstallCheck:-}" ]]; then continue; fi
        if [[ "$curPhase" = distPhase && -z "${doDist:-}" ]]; then continue; fi

        if [[ -n $NIX_LOG_FD ]]; then
            echo "@nix { \"action\": \"setPhase\", \"phase\": \"$curPhase\" }" >&$NIX_LOG_FD
        fi

        showPhaseHeader "$curPhase"
        dumpVars

        # Evaluate the variable named $curPhase if it exists, otherwise the
        # function named $curPhase.
        eval "${!curPhase:-$curPhase}"

        if [ "$curPhase" = unpackPhase ]; then
            cd "${sourceRoot:-.}"
        fi
    done
}


# Execute the post-hooks.
runHook postHook


# Execute the global user hook (defined through the Nixpkgs
# configuration option ‘stdenv.userHook’).  This can be used to set
# global compiler optimisation flags, for instance.
runHook userHook


dumpVars

# Disable nounset for nix-shell.
set +u

Duplicate symbol in sharutils

duplicate symbol '_program_name' in:
    shar.o
    shar-opts.o
ld: 1 duplicate symbol for architecture x86_64
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [Makefile:1359: shar] Error 1
make[2]: Leaving directory '/private/tmp/nix-build-sharutils-4.15.2.drv-0/sharutils-4.15.2/src'
make[1]: *** [Makefile:1296: all-recursive] Error 1
make[1]: Leaving directory '/private/tmp/nix-build-sharutils-4.15.2.drv-0/sharutils-4.15.2'
make: *** [Makefile:1234: all] Error 2
note: keeping build directory '/private/tmp/nix-build-sharutils-4.15.2.drv-0'
builder for '/nix/store/zwkmp9agvrqiddchvc7whl93gq3c85zb-sharutils-4.15.2.drv' failed with exit code 2

Applying the same "fix" as for cpio, passing -fcommon in CFLAGS this time.

@thefloweringash

This comment has been minimized.

Copy link

@thefloweringash thefloweringash commented Mar 23, 2021

This cat and mouse game simply continues, which makes me think maybe when generating the stubs I should not allow running of add-aliases.sh?

In pre-tbd nixpkgs the aliases were part of the libSystem definition, and this structure was preserved to minimize the amount of change when adding Big Sur support. There was some work to move the aliases to the stubs, but it's not quite complete. Note the version of darwin-stubs in nixpkgs is pre add-aliases.sh.

There's some more discussion here: NixOS/nixpkgs#107013 (comment).

Stage 0 clang cannot create executables

The actual error will be in that config.log.

@toonn

This comment has been minimized.

Copy link
Owner Author

@toonn toonn commented Mar 23, 2021

@thefloweringash, thanks, that's indeed the bit I found. Removing the ln lines seems to have done the trick. Does the stubs repo generate too many symlinks or may there me symlinks missing?

I've included part of the config.log output. Not sure what -lSystem refers to though. Whether it refers to stubs/10.13/System or libSystem.B.tbd or something else entirely.

@toonn

This comment has been minimized.

Copy link
Owner Author

@toonn toonn commented Apr 17, 2021

@LnL7, could you take a look at the latest section? I don't understand why bumping the LLVM used in stdenv would cause evaluation errors unless llvmPackages_7 was groomed specially to avoid circular dependencies on build tools.

EDIT: Mystery solved, part of stdenv relies on the default LLVM defined in all-packages.nix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment