Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start script doesn't work with --use-nix #1475

Closed
joneshf opened this issue Jan 23, 2021 · 5 comments · Fixed by #1509
Closed

Start script doesn't work with --use-nix #1475

joneshf opened this issue Jan 23, 2021 · 5 comments · Fixed by #1509

Comments

@joneshf
Copy link
Contributor

joneshf commented Jan 23, 2021

Describe the bug
The start script doesn't work with --use-nix. It seems to fail on building ghc, but that might be a red herring.

To Reproduce

  1. Curl the start script:
    $ curl https://haskell.build/start > start
  2. Run the start script with --use-nix:
    $ sh start --use-nix
  3. Follow the instructions to run the example (making note to use BAZEL_USE_CPP_ONLY_TOOLCHAIN on macOS):
    $ BAZEL_USE_CPP_ONLY_TOOLCHAIN=1 bazel run //:example
$ BAZEL_USE_CPP_ONLY_TOOLCHAIN=1 bazel run //:example
these derivations will be built:
  /nix/store/q325bf3n7y33nszmsn9pgcnxbp3dpava-python3-3.7.3.drv
  /nix/store/wn2znfqwss14pnzqmcp5zl77i0a636c3-hook.drv
  /nix/store/f765d9hw19g85bgxh14dfc6pzxjci1fj-python3.7-setuptools-40.8.0.drv
  /nix/store/llccrlnyxj6z1xpqhpqi9f3mm7zsak5y-python3.7-bootstrapped-pip-19.0.3.drv
  /nix/store/26k6qs8hpb45k1szhiyq8xj7wva73h18-python3.7-pip-19.0.3.drv
  /nix/store/7j7pa5i9gdzf8kg7aka11235qylsqg8h-python3.7-setuptools_scm-3.2.0.drv
  /nix/store/0269q5xiv84v27rgjj97kvqy21m407p1-python3.7-pluggy-0.8.1.drv
  /nix/store/b1pi73bf3f8x9cpvgbl0id792wi1bilx-python3.7-attrs-18.2.0.drv
  /nix/store/v84ci6qxw3abv1ynp11iyslx6kkl7gcf-python3.7-coverage-4.5.2.drv
  /nix/store/2gdmm1wpvrwjh7790garga689r3siphw-python3.7-hypothesis-4.7.3.drv
  /nix/store/n0zk5mlmbhl39y231a3wmypcrnav4g3f-python3.7-six-1.12.0.drv
  /nix/store/yvz341h9njbnq4sjfclnrw0as9p5wiyy-python3.7-nose-1.3.7.drv
  /nix/store/bw8iysf516smkx877sak4c34flrbagp9-python3.7-more-itertools-6.0.0.drv
  /nix/store/fkis5cxj47mc409n98a3ww046yphmn67-python3.7-atomicwrites-1.3.0.drv
  /nix/store/lxif3f7251dp1yhwp9ljk9arg8rsi3bi-python3.7-pbr-5.1.2.drv
  /nix/store/da9nhkn1kd3yag38ra7m01vzpkwdgvr7-python3.7-linecache2-1.0.0.drv
  /nix/store/qhnc684w8ai2s1pd7di713k10pp251py-python3.7-traceback2-1.4.0.drv
  /nix/store/482s5f56ab37k8rgmmhhqhkb4r59rfp0-python3.7-unittest2-1.1.0.drv
  /nix/store/2qikqpbqmhc15dnpr465df7pqrymcyl1-python3.7-funcsigs-1.0.2.drv
  /nix/store/mqqj832h76wwyqa3mqjwlmwxbdz9msbx-python3.7-mock-2.0.0.drv
  /nix/store/rdb8gsx50clrwcr62zm0ab60qq2v1qvh-python3.7-py-1.7.0.drv
  /nix/store/m4q93y62jjrylz2sfnz519lllhnvflip-python3.7-pytest-4.2.1.drv
  /nix/store/bkgccx1ik269lly5j2kcmj758li4p1n6-python3.7-pytest-runner-4.2.drv
  /nix/store/0va2g1ggf17vcmrcz3rcdgfnjbd06rlf-python3.7-mccabe-0.6.1.drv
  /nix/store/g8gm9mbb8cb20ybkcxzc7ryjrabfj9hh-python3.7-pytest-3.10.1.drv
  /nix/store/qhh0hwvix16103j3n1fqyf1ik2f4wwm6-python3.7-apipkg-1.5.drv
  /nix/store/8lpcjzapb3785l0bp41djsq6pxsw0880-python3.7-execnet-1.5.0.drv
  /nix/store/ak5f9lgmkxjdprwar88v09x1xv2akqq3-python3.7-pytest-forked-1.0.2.drv
  /nix/store/n6kjrd88yv0as8vv5lgnd3rq4zl36rj7-python3.7-filelock-3.0.10.drv
  /nix/store/18rlpm7sbmwjwqbl0l0r5yshmglqk5l5-python3.7-pytest-xdist-1.26.1.drv
  /nix/store/5wd1r3k993v1qrlx2a290q5sd7jz12hn-python3.7-webencodings-0.5.1.drv
  /nix/store/n2a86q7kks5z7ypgvrjkq56k52nzyzy8-python3.7-u-msgpack-python-2.5.0.drv
  /nix/store/bkczdm968w34lgzg2jkfs8yjrfj6nsvf-python3.7-pytest-expect-1.1.0.drv
  /nix/store/5klvszrm6nk7cvih0jknb6pwn3hqg5kz-python3.7-pyflakes-2.1.0.drv
  /nix/store/jyi9l5jncsvziz3hqkvza4hiqxl53r8s-python3.7-entrypoints-0.3.drv
  /nix/store/yh4v2lq13jr3wgsnzfrsg8xpfcq7ccfr-python3.7-pycodestyle-2.5.0.drv
  /nix/store/xnjpz0lm8f5vjvh0s4w6kxigirfkrm8v-python3.7-flake8-3.7.6.drv
  /nix/store/1r1fmqq2w4nn7b4v6rg42rg6wi5m928k-python3.7-html5lib-1.0.1.drv
  /nix/store/4rq4n5n0xdplq62gy3rq13g4mx70ykms-python3.7-imagesize-1.1.0.drv
  /nix/store/6gqnqqda3b85yl17qx2k6kkwsa9bdgzb-python3.7-Whoosh-2.7.4.drv
  /nix/store/czlss7dj7vrfvf8xdn10k5ra0s9kdy48-python3.7-certifi-2018.11.29.drv
  /nix/store/4l4c2ivgkhb8dq4m93qandh5nqkaiyyh-python3.7-pytz-2018.9.drv
  /nix/store/5j625i831g3w24wy6wl1srdpzhp9v32h-python3.7-asn1crypto-0.24.0.drv
  /nix/store/5ka0g02yagg43292bcppg4rcwsk8yfpa-python3.7-cryptography_vectors-2.5.drv
  /nix/store/klnq1nlzcnzsms5s4k5yb10dk8qqd80f-python3.7-flaky-3.5.3.drv
  /nix/store/6r6w91zhz3afh1pp50k90jcrmh4lrn90-python3.7-hypothesis-4.7.3.drv
  /nix/store/3p35scvz71zvbd6xhl0dh3ghxsfiw6gi-python3.7-pyparsing-2.3.1.drv
  /nix/store/aihnq1fkq8bf0sqs56z7x6nx9n7zc7g6-python3.7-pretend-1.0.9.drv
  /nix/store/8djyqjpzmsabj6r9w9fdsdz5ckqfg8x6-python3.7-packaging-19.0.drv
  /nix/store/3z24m1d08ywxgbwiqnpsa5ih9kbwqkwy-python3.7-pycparser-2.19.drv
  /nix/store/fia9p3py25rfrr04jc72i05mcmxyjbp2-python3.7-cffi-1.12.1.drv
  /nix/store/vxb23z7dxgjlcmxi6jqpn3ga80ml97m3-python3.7-iso8601-0.1.12.drv
  /nix/store/4gk78j3mvh2yp6cvx49x1snwiricphwi-python3.7-cryptography-2.5.drv
  /nix/store/n68hdx52kzm7p3v6jz50bwripwkp6ga3-python3.7-pyasn1-0.4.5.drv
  /nix/store/nn89fsmyhh29clcjicjd1qf7fsjvkad4-python3.7-idna-2.8.drv
  /nix/store/8hzjprmq9yjib25a8jarb2bswc72wxzr-python3.7-pyOpenSSL-19.0.0.drv
  /nix/store/lyrvlzl1l4vkcl3wq1wsvbx2fl4z865x-python3.7-pysocks-1.6.8.drv
  /nix/store/m74d664rlkv1f6z9xigvq80gdax7j0yz-python3.7-urllib3-1.24.1.drv
  /nix/store/xv19sp8zb7p3m9v1k6r5qzmcq7k48wlc-python3.7-chardet-3.0.4.drv
  /nix/store/cdbgbxvkk4jj7y95hxaf488ba5bmamdq-python3.7-requests-2.21.0.drv
  /nix/store/w3qdcxqzc615p1bqfajw004z7nfirbda-python3.7-docutils-0.14.drv
  /nix/store/ziksz5d8w2npnbah3c2bhvzlwb0pp5nz-python3.7-Pygments-2.3.1.drv
  /nix/store/inr2yrna7j73v8f0rlw57my2lfm4wsdm-python3.7-alabaster-0.7.12.drv
  /nix/store/l36xpl5v3p4d7km1h9jfp974290i2phk-python3.7-MarkupSafe-1.1.0.drv
  /nix/store/n91sgwlxyja0pk9kmk4xgmkqchgjr4c2-python3.7-Jinja2-2.10.drv
  /nix/store/qphqrpcbb0f7pp699wvgy6fdc78pf0l5-python3.7-SQLAlchemy-1.2.14.drv
  /nix/store/sdlwswf0xvszakq83rja2lj3hxp4zrpr-python3.7-sphinxcontrib-websupport-1.1.0.drv
  /nix/store/sq7fw5i2jky9lxicv1sk75z3ph5545fz-python3.7-simplejson-3.16.0.drv
  /nix/store/2mrhags0m6yg2b88ry3l3h8dqdha3v70-python3.7-python-dateutil-2.8.0.drv
  /nix/store/4b6hczr9vjzl0dhv81svkznvsr8ibhrf-python3.7-freezegun-0.3.11.drv
  /nix/store/wvj48ing82w3bjs6qbwhk4vywv5w84pj-python3.7-Babel-2.6.0.drv
  /nix/store/43jgqgrs8fy8mvcfpd3rv6p84gzbnarn-python3.7-pkgconfig-1.4.0.drv
  /nix/store/whdjn69pr0d8ixl0kmpa51m4zwp366b7-gdb-8.2.1.drv
  /nix/store/5kmiqic5i7p69g5d7zcis09zv48sx9ga-python3.7-Cython-0.29.5.drv
  /nix/store/gzky5slwdyq9rjma7vwvb16ymzmdxck7-python3.7-PyStemmer-1.3.0.drv
  /nix/store/zrxv6mrh8v8ifryvwwrzrvqlbspkl3pz-python3.7-snowballstemmer-1.2.1.drv
  /nix/store/65g2fyndlfq3d4m7kzp4c2xfpzsd8dsm-python3.7-sphinx-1.8.3.drv
  /nix/store/26rq8gd6dh6vzn9rzz56ljqdr1sq90wi-ghc-8.6.4.drv
building '/nix/store/q325bf3n7y33nszmsn9pgcnxbp3dpava-python3-3.7.3.drv'...
unpacking sources
unpacking source archive /nix/store/r5ik1sbafp0kr3a7prnaca1lmmqmb0b6-Python-3.7.3.tar.xz
source root is Python-3.7.3
setting SOURCE_DATE_EPOCH to timestamp 1553547549 of file Python-3.7.3/Misc/NEWS
patching sources
applying patch /nix/store/gd8ycd6j3qhcq1qccaqz68zdq5l4c2wf-no-ldconfig.patch
patching file Lib/ctypes/util.py
applying patch /nix/store/ggk7z3dvydrkypxff7d7c6v1slvbriin-darwin-libutil.patch
patching file Modules/posixmodule.c
Hunk #1 succeeded at 5907 (offset 27 lines).
applying patch /nix/store/9kwzs3pplms8sijf55sdryypzvic4x1s-python-3.x-distutils-C++.patch
patching file Lib/_osx_support.py
patching file Lib/distutils/cygwinccompiler.py
patching file Lib/distutils/sysconfig.py
Hunk #1 succeeded at 183 (offset 13 lines).
Hunk #2 succeeded at 202 (offset 13 lines).
Hunk #3 succeeded at 231 (offset 13 lines).
patching file Lib/distutils/unixccompiler.py
Hunk #3 FAILED at 183.
1 out of 3 hunks FAILED -- saving rejects to file Lib/distutils/unixccompiler.py.rej
patching file Makefile.pre.in
Hunk #1 succeeded at 615 (offset 31 lines).
builder for '/nix/store/q325bf3n7y33nszmsn9pgcnxbp3dpava-python3-3.7.3.drv' failed with exit code 1
cannot build derivation '/nix/store/26rq8gd6dh6vzn9rzz56ljqdr1sq90wi-ghc-8.6.4.drv': 1 dependencies couldn't be built
error: build of '/nix/store/26rq8gd6dh6vzn9rzz56ljqdr1sq90wi-ghc-8.6.4.drv' failed
INFO: Repository rules_haskell_ghc_nixpkgs instantiated at:
  no stack (--record_rule_instantiation_callstack not enabled)
Repository rule _nixpkgs_package defined at:
  /private/var/tmp/_bazel_joneshf/879b19e556b222310ec90a9792c11d4b/external/io_tweag_rules_nixpkgs/nixpkgs/nixpkgs.bzl:211:35: in <toplevel>
ERROR: An error occurred during the fetch of repository 'rules_haskell_ghc_nixpkgs':
   Traceback (most recent call last):
	File "/private/var/tmp/_bazel_joneshf/879b19e556b222310ec90a9792c11d4b/external/io_tweag_rules_nixpkgs/nixpkgs/nixpkgs.bzl", line 177
		_execute_or_fail(repository_ctx, <4 more arguments>)
	File "/private/var/tmp/_bazel_joneshf/879b19e556b222310ec90a9792c11d4b/external/io_tweag_rules_nixpkgs/nixpkgs/nixpkgs.bzl", line 620, in _execute_or_fail
		fail(<1 more arguments>)

Cannot build Nix attribute 'ghc'.
Command: [/Users/joneshf/.nix-profile/bin/nix-build, "-E", "import <nixpkgs> { config = {}; overlays = []; }", "-A", "ghc", "--out-link", "bazel-support/nix-out-link", "-I", "nixpkgs=/private/var/tmp/_bazel_joneshf/879b19e556b222310ec90a9792c11d4b/external/nixpkgs/nixpkgs"]
Return code: 100
Error output:
these derivations will be built:
  /nix/store/q325bf3n7y33nszmsn9pgcnxbp3dpava-python3-3.7.3.drv
  /nix/store/wn2znfqwss14pnzqmcp5zl77i0a636c3-hook.drv
  /nix/store/f765d9hw19g85bgxh14dfc6pzxjci1fj-python3.7-setuptools-40.8.0.drv
  /nix/store/llccrlnyxj6z1xpqhpqi9f3mm7zsak5y-python3.7-bootstrapped-pip-19.0.3.drv
  /nix/store/26k6qs8hpb45k1szhiyq8xj7wva73h18-python3.7-pip-19.0.3.drv
  /nix/store/7j7pa5i9gdzf8kg7aka11235qylsqg8h-python3.7-setuptools_scm-3.2.0.drv
  /nix/store/0269q5xiv84v27rgjj97kvqy21m407p1-python3.7-pluggy-0.8.1.drv
  /nix/store/b1pi73bf3f8x9cpvgbl0id792wi1bilx-python3.7-attrs-18.2.0.drv
  /nix/store/v84ci6qxw3abv1ynp11iyslx6kkl7gcf-python3.7-coverage-4.5.2.drv
  /nix/store/2gdmm1wpvrwjh7790garga689r3siphw-python3.7-hypothesis-4.7.3.drv
  /nix/store/n0zk5mlmbhl39y231a3wmypcrnav4g3f-python3.7-six-1.12.0.drv
  /nix/store/yvz341h9njbnq4sjfclnrw0as9p5wiyy-python3.7-nose-1.3.7.drv
  /nix/store/bw8iysf516smkx877sak4c34flrbagp9-python3.7-more-itertools-6.0.0.drv
  /nix/store/fkis5cxj47mc409n98a3ww046yphmn67-python3.7-atomicwrites-1.3.0.drv
  /nix/store/lxif3f7251dp1yhwp9ljk9arg8rsi3bi-python3.7-pbr-5.1.2.drv
  /nix/store/da9nhkn1kd3yag38ra7m01vzpkwdgvr7-python3.7-linecache2-1.0.0.drv
  /nix/store/qhnc684w8ai2s1pd7di713k10pp251py-python3.7-traceback2-1.4.0.drv
  /nix/store/482s5f56ab37k8rgmmhhqhkb4r59rfp0-python3.7-unittest2-1.1.0.drv
  /nix/store/2qikqpbqmhc15dnpr465df7pqrymcyl1-python3.7-funcsigs-1.0.2.drv
  /nix/store/mqqj832h76wwyqa3mqjwlmwxbdz9msbx-python3.7-mock-2.0.0.drv
  /nix/store/rdb8gsx50clrwcr62zm0ab60qq2v1qvh-python3.7-py-1.7.0.drv
  /nix/store/m4q93y62jjrylz2sfnz519lllhnvflip-python3.7-pytest-4.2.1.drv
  /nix/store/bkgccx1ik269lly5j2kcmj758li4p1n6-python3.7-pytest-runner-4.2.drv
  /nix/store/0va2g1ggf17vcmrcz3rcdgfnjbd06rlf-python3.7-mccabe-0.6.1.drv
  /nix/store/g8gm9mbb8cb20ybkcxzc7ryjrabfj9hh-python3.7-pytest-3.10.1.drv
  /nix/store/qhh0hwvix16103j3n1fqyf1ik2f4wwm6-python3.7-apipkg-1.5.drv
  /nix/store/8lpcjzapb3785l0bp41djsq6pxsw0880-python3.7-execnet-1.5.0.drv
  /nix/store/ak5f9lgmkxjdprwar88v09x1xv2akqq3-python3.7-pytest-forked-1.0.2.drv
  /nix/store/n6kjrd88yv0as8vv5lgnd3rq4zl36rj7-python3.7-filelock-3.0.10.drv
  /nix/store/18rlpm7sbmwjwqbl0l0r5yshmglqk5l5-python3.7-pytest-xdist-1.26.1.drv
  /nix/store/5wd1r3k993v1qrlx2a290q5sd7jz12hn-python3.7-webencodings-0.5.1.drv
  /nix/store/n2a86q7kks5z7ypgvrjkq56k52nzyzy8-python3.7-u-msgpack-python-2.5.0.drv
  /nix/store/bkczdm968w34lgzg2jkfs8yjrfj6nsvf-python3.7-pytest-expect-1.1.0.drv
  /nix/store/5klvszrm6nk7cvih0jknb6pwn3hqg5kz-python3.7-pyflakes-2.1.0.drv
  /nix/store/jyi9l5jncsvziz3hqkvza4hiqxl53r8s-python3.7-entrypoints-0.3.drv
  /nix/store/yh4v2lq13jr3wgsnzfrsg8xpfcq7ccfr-python3.7-pycodestyle-2.5.0.drv
  /nix/store/xnjpz0lm8f5vjvh0s4w6kxigirfkrm8v-python3.7-flake8-3.7.6.drv
  /nix/store/1r1fmqq2w4nn7b4v6rg42rg6wi5m928k-python3.7-html5lib-1.0.1.drv
  /nix/store/4rq4n5n0xdplq62gy3rq13g4mx70ykms-python3.7-imagesize-1.1.0.drv
  /nix/store/6gqnqqda3b85yl17qx2k6kkwsa9bdgzb-python3.7-Whoosh-2.7.4.drv
  /nix/store/czlss7dj7vrfvf8xdn10k5ra0s9kdy48-python3.7-certifi-2018.11.29.drv
  /nix/store/4l4c2ivgkhb8dq4m93qandh5nqkaiyyh-python3.7-pytz-2018.9.drv
  /nix/store/5j625i831g3w24wy6wl1srdpzhp9v32h-python3.7-asn1crypto-0.24.0.drv
  /nix/store/5ka0g02yagg43292bcppg4rcwsk8yfpa-python3.7-cryptography_vectors-2.5.drv
  /nix/store/klnq1nlzcnzsms5s4k5yb10dk8qqd80f-python3.7-flaky-3.5.3.drv
  /nix/store/6r6w91zhz3afh1pp50k90jcrmh4lrn90-python3.7-hypothesis-4.7.3.drv
  /nix/store/3p35scvz71zvbd6xhl0dh3ghxsfiw6gi-python3.7-pyparsing-2.3.1.drv
  /nix/store/aihnq1fkq8bf0sqs56z7x6nx9n7zc7g6-python3.7-pretend-1.0.9.drv
  /nix/store/8djyqjpzmsabj6r9w9fdsdz5ckqfg8x6-python3.7-packaging-19.0.drv
  /nix/store/3z24m1d08ywxgbwiqnpsa5ih9kbwqkwy-python3.7-pycparser-2.19.drv
  /nix/store/fia9p3py25rfrr04jc72i05mcmxyjbp2-python3.7-cffi-1.12.1.drv
  /nix/store/vxb23z7dxgjlcmxi6jqpn3ga80ml97m3-python3.7-iso8601-0.1.12.drv
  /nix/store/4gk78j3mvh2yp6cvx49x1snwiricphwi-python3.7-cryptography-2.5.drv
  /nix/store/n68hdx52kzm7p3v6jz50bwripwkp6ga3-python3.7-pyasn1-0.4.5.drv
  /nix/store/nn89fsmyhh29clcjicjd1qf7fsjvkad4-python3.7-idna-2.8.drv
  /nix/store/8hzjprmq9yjib25a8jarb2bswc72wxzr-python3.7-pyOpenSSL-19.0.0.drv
  /nix/store/lyrvlzl1l4vkcl3wq1wsvbx2fl4z865x-python3.7-pysocks-1.6.8.drv
  /nix/store/m74d664rlkv1f6z9xigvq80gdax7j0yz-python3.7-urllib3-1.24.1.drv
  /nix/store/xv19sp8zb7p3m9v1k6r5qzmcq7k48wlc-python3.7-chardet-3.0.4.drv
  /nix/store/cdbgbxvkk4jj7y95hxaf488ba5bmamdq-python3.7-requests-2.21.0.drv
  /nix/store/w3qdcxqzc615p1bqfajw004z7nfirbda-python3.7-docutils-0.14.drv
  /nix/store/ziksz5d8w2npnbah3c2bhvzlwb0pp5nz-python3.7-Pygments-2.3.1.drv
  /nix/store/inr2yrna7j73v8f0rlw57my2lfm4wsdm-python3.7-alabaster-0.7.12.drv
  /nix/store/l36xpl5v3p4d7km1h9jfp974290i2phk-python3.7-MarkupSafe-1.1.0.drv
  /nix/store/n91sgwlxyja0pk9kmk4xgmkqchgjr4c2-python3.7-Jinja2-2.10.drv
  /nix/store/qphqrpcbb0f7pp699wvgy6fdc78pf0l5-python3.7-SQLAlchemy-1.2.14.drv
  /nix/store/sdlwswf0xvszakq83rja2lj3hxp4zrpr-python3.7-sphinxcontrib-websupport-1.1.0.drv
  /nix/store/sq7fw5i2jky9lxicv1sk75z3ph5545fz-python3.7-simplejson-3.16.0.drv
  /nix/store/2mrhags0m6yg2b88ry3l3h8dqdha3v70-python3.7-python-dateutil-2.8.0.drv
  /nix/store/4b6hczr9vjzl0dhv81svkznvsr8ibhrf-python3.7-freezegun-0.3.11.drv
  /nix/store/wvj48ing82w3bjs6qbwhk4vywv5w84pj-python3.7-Babel-2.6.0.drv
  /nix/store/43jgqgrs8fy8mvcfpd3rv6p84gzbnarn-python3.7-pkgconfig-1.4.0.drv
  /nix/store/whdjn69pr0d8ixl0kmpa51m4zwp366b7-gdb-8.2.1.drv
  /nix/store/5kmiqic5i7p69g5d7zcis09zv48sx9ga-python3.7-Cython-0.29.5.drv
  /nix/store/gzky5slwdyq9rjma7vwvb16ymzmdxck7-python3.7-PyStemmer-1.3.0.drv
  /nix/store/zrxv6mrh8v8ifryvwwrzrvqlbspkl3pz-python3.7-snowballstemmer-1.2.1.drv
  /nix/store/65g2fyndlfq3d4m7kzp4c2xfpzsd8dsm-python3.7-sphinx-1.8.3.drv
  /nix/store/26rq8gd6dh6vzn9rzz56ljqdr1sq90wi-ghc-8.6.4.drv
building '/nix/store/q325bf3n7y33nszmsn9pgcnxbp3dpava-python3-3.7.3.drv'...
unpacking sources
unpacking source archive /nix/store/r5ik1sbafp0kr3a7prnaca1lmmqmb0b6-Python-3.7.3.tar.xz
source root is Python-3.7.3
setting SOURCE_DATE_EPOCH to timestamp 1553547549 of file Python-3.7.3/Misc/NEWS
patching sources
applying patch /nix/store/gd8ycd6j3qhcq1qccaqz68zdq5l4c2wf-no-ldconfig.patch
patching file Lib/ctypes/util.py
applying patch /nix/store/ggk7z3dvydrkypxff7d7c6v1slvbriin-darwin-libutil.patch
patching file Modules/posixmodule.c
Hunk #1 succeeded at 5907 (offset 27 lines).
applying patch /nix/store/9kwzs3pplms8sijf55sdryypzvic4x1s-python-3.x-distutils-C++.patch
patching file Lib/_osx_support.py
patching file Lib/distutils/cygwinccompiler.py
patching file Lib/distutils/sysconfig.py
Hunk #1 succeeded at 183 (offset 13 lines).
Hunk #2 succeeded at 202 (offset 13 lines).
Hunk #3 succeeded at 231 (offset 13 lines).
patching file Lib/distutils/unixccompiler.py
Hunk #3 FAILED at 183.
1 out of 3 hunks FAILED -- saving rejects to file Lib/distutils/unixccompiler.py.rej
patching file Makefile.pre.in
Hunk #1 succeeded at 615 (offset 31 lines).
builder for '/nix/store/q325bf3n7y33nszmsn9pgcnxbp3dpava-python3-3.7.3.drv' failed with exit code 1
cannot build derivation '/nix/store/26rq8gd6dh6vzn9rzz56ljqdr1sq90wi-ghc-8.6.4.drv': 1 dependencies couldn't be built
error: build of '/nix/store/26rq8gd6dh6vzn9rzz56ljqdr1sq90wi-ghc-8.6.4.drv' failed

ERROR: /Users/joneshf/programming/joneshf/rules_haskell-env-python-no-such-file-or-directory/BUILD.bazel:29:15: Target '//:example' depends on toolchain '@rules_haskell_ghc_nixpkgs_haskell_toolchain//:toolchain-impl', which cannot be found: no such package '@rules_haskell_ghc_nixpkgs_haskell_toolchain//': no such package '@rules_haskell_ghc_nixpkgs//': Traceback (most recent call last):
	File "/private/var/tmp/_bazel_joneshf/879b19e556b222310ec90a9792c11d4b/external/io_tweag_rules_nixpkgs/nixpkgs/nixpkgs.bzl", line 177
		_execute_or_fail(repository_ctx, <4 more arguments>)
	File "/private/var/tmp/_bazel_joneshf/879b19e556b222310ec90a9792c11d4b/external/io_tweag_rules_nixpkgs/nixpkgs/nixpkgs.bzl", line 620, in _execute_or_fail
		fail(<1 more arguments>)

Cannot build Nix attribute 'ghc'.
Command: [/Users/joneshf/.nix-profile/bin/nix-build, "-E", "import <nixpkgs> { config = {}; overlays = []; }", "-A", "ghc", "--out-link", "bazel-support/nix-out-link", "-I", "nixpkgs=/private/var/tmp/_bazel_joneshf/879b19e556b222310ec90a9792c11d4b/external/nixpkgs/nixpkgs"]
Return code: 100
Error output:
these derivations will be built:
  /nix/store/q325bf3n7y33nszmsn9pgcnxbp3dpava-python3-3.7.3.drv
  /nix/store/wn2znfqwss14pnzqmcp5zl77i0a636c3-hook.drv
  /nix/store/f765d9hw19g85bgxh14dfc6pzxjci1fj-python3.7-setuptools-40.8.0.drv
  /nix/store/llccrlnyxj6z1xpqhpqi9f3mm7zsak5y-python3.7-bootstrapped-pip-19.0.3.drv
  /nix/store/26k6qs8hpb45k1szhiyq8xj7wva73h18-python3.7-pip-19.0.3.drv
  /nix/store/7j7pa5i9gdzf8kg7aka11235qylsqg8h-python3.7-setuptools_scm-3.2.0.drv
  /nix/store/0269q5xiv84v27rgjj97kvqy21m407p1-python3.7-pluggy-0.8.1.drv
  /nix/store/b1pi73bf3f8x9cpvgbl0id792wi1bilx-python3.7-attrs-18.2.0.drv
  /nix/store/v84ci6qxw3abv1ynp11iyslx6kkl7gcf-python3.7-coverage-4.5.2.drv
  /nix/store/2gdmm1wpvrwjh7790garga689r3siphw-python3.7-hypothesis-4.7.3.drv
  /nix/store/n0zk5mlmbhl39y231a3wmypcrnav4g3f-python3.7-six-1.12.0.drv
  /nix/store/yvz341h9njbnq4sjfclnrw0as9p5wiyy-python3.7-nose-1.3.7.drv
  /nix/store/bw8iysf516smkx877sak4c34flrbagp9-python3.7-more-itertools-6.0.0.drv
  /nix/store/fkis5cxj47mc409n98a3ww046yphmn67-python3.7-atomicwrites-1.3.0.drv
  /nix/store/lxif3f7251dp1yhwp9ljk9arg8rsi3bi-python3.7-pbr-5.1.2.drv
  /nix/store/da9nhkn1kd3yag38ra7m01vzpkwdgvr7-python3.7-linecache2-1.0.0.drv
  /nix/store/qhnc684w8ai2s1pd7di713k10pp251py-python3.7-traceback2-1.4.0.drv
  /nix/store/482s5f56ab37k8rgmmhhqhkb4r59rfp0-python3.7-unittest2-1.1.0.drv
  /nix/store/2qikqpbqmhc15dnpr465df7pqrymcyl1-python3.7-funcsigs-1.0.2.drv
  /nix/store/mqqj832h76wwyqa3mqjwlmwxbdz9msbx-python3.7-mock-2.0.0.drv
  /nix/store/rdb8gsx50clrwcr62zm0ab60qq2v1qvh-python3.7-py-1.7.0.drv
  /nix/store/m4q93y62jjrylz2sfnz519lllhnvflip-python3.7-pytest-4.2.1.drv
  /nix/store/bkgccx1ik269lly5j2kcmj758li4p1n6-python3.7-pytest-runner-4.2.drv
  /nix/store/0va2g1ggf17vcmrcz3rcdgfnjbd06rlf-python3.7-mccabe-0.6.1.drv
  /nix/store/g8gm9mbb8cb20ybkcxzc7ryjrabfj9hh-python3.7-pytest-3.10.1.drv
  /nix/store/qhh0hwvix16103j3n1fqyf1ik2f4wwm6-python3.7-apipkg-1.5.drv
  /nix/store/8lpcjzapb3785l0bp41djsq6pxsw0880-python3.7-execnet-1.5.0.drv
  /nix/store/ak5f9lgmkxjdprwar88v09x1xv2akqq3-python3.7-pytest-forked-1.0.2.drv
  /nix/store/n6kjrd88yv0as8vv5lgnd3rq4zl36rj7-python3.7-filelock-3.0.10.drv
  /nix/store/18rlpm7sbmwjwqbl0l0r5yshmglqk5l5-python3.7-pytest-xdist-1.26.1.drv
  /nix/store/5wd1r3k993v1qrlx2a290q5sd7jz12hn-python3.7-webencodings-0.5.1.drv
  /nix/store/n2a86q7kks5z7ypgvrjkq56k52nzyzy8-python3.7-u-msgpack-python-2.5.0.drv
  /nix/store/bkczdm968w34lgzg2jkfs8yjrfj6nsvf-python3.7-pytest-expect-1.1.0.drv
  /nix/store/5klvszrm6nk7cvih0jknb6pwn3hqg5kz-python3.7-pyflakes-2.1.0.drv
  /nix/store/jyi9l5jncsvziz3hqkvza4hiqxl53r8s-python3.7-entrypoints-0.3.drv
  /nix/store/yh4v2lq13jr3wgsnzfrsg8xpfcq7ccfr-python3.7-pycodestyle-2.5.0.drv
  /nix/store/xnjpz0lm8f5vjvh0s4w6kxigirfkrm8v-python3.7-flake8-3.7.6.drv
  /nix/store/1r1fmqq2w4nn7b4v6rg42rg6wi5m928k-python3.7-html5lib-1.0.1.drv
  /nix/store/4rq4n5n0xdplq62gy3rq13g4mx70ykms-python3.7-imagesize-1.1.0.drv
  /nix/store/6gqnqqda3b85yl17qx2k6kkwsa9bdgzb-python3.7-Whoosh-2.7.4.drv
  /nix/store/czlss7dj7vrfvf8xdn10k5ra0s9kdy48-python3.7-certifi-2018.11.29.drv
  /nix/store/4l4c2ivgkhb8dq4m93qandh5nqkaiyyh-python3.7-pytz-2018.9.drv
  /nix/store/5j625i831g3w24wy6wl1srdpzhp9v32h-python3.7-asn1crypto-0.24.0.drv
  /nix/store/5ka0g02yagg43292bcppg4rcwsk8yfpa-python3.7-cryptography_vectors-2.5.drv
  /nix/store/klnq1nlzcnzsms5s4k5yb10dk8qqd80f-python3.7-flaky-3.5.3.drv
  /nix/store/6r6w91zhz3afh1pp50k90jcrmh4lrn90-python3.7-hypothesis-4.7.3.drv
  /nix/store/3p35scvz71zvbd6xhl0dh3ghxsfiw6gi-python3.7-pyparsing-2.3.1.drv
  /nix/store/aihnq1fkq8bf0sqs56z7x6nx9n7zc7g6-python3.7-pretend-1.0.9.drv
  /nix/store/8djyqjpzmsabj6r9w9fdsdz5ckqfg8x6-python3.7-packaging-19.0.drv
  /nix/store/3z24m1d08ywxgbwiqnpsa5ih9kbwqkwy-python3.7-pycparser-2.19.drv
  /nix/store/fia9p3py25rfrr04jc72i05mcmxyjbp2-python3.7-cffi-1.12.1.drv
  /nix/store/vxb23z7dxgjlcmxi6jqpn3ga80ml97m3-python3.7-iso8601-0.1.12.drv
  /nix/store/4gk78j3mvh2yp6cvx49x1snwiricphwi-python3.7-cryptography-2.5.drv
  /nix/store/n68hdx52kzm7p3v6jz50bwripwkp6ga3-python3.7-pyasn1-0.4.5.drv
  /nix/store/nn89fsmyhh29clcjicjd1qf7fsjvkad4-python3.7-idna-2.8.drv
  /nix/store/8hzjprmq9yjib25a8jarb2bswc72wxzr-python3.7-pyOpenSSL-19.0.0.drv
  /nix/store/lyrvlzl1l4vkcl3wq1wsvbx2fl4z865x-python3.7-pysocks-1.6.8.drv
  /nix/store/m74d664rlkv1f6z9xigvq80gdax7j0yz-python3.7-urllib3-1.24.1.drv
  /nix/store/xv19sp8zb7p3m9v1k6r5qzmcq7k48wlc-python3.7-chardet-3.0.4.drv
  /nix/store/cdbgbxvkk4jj7y95hxaf488ba5bmamdq-python3.7-requests-2.21.0.drv
  /nix/store/w3qdcxqzc615p1bqfajw004z7nfirbda-python3.7-docutils-0.14.drv
  /nix/store/ziksz5d8w2npnbah3c2bhvzlwb0pp5nz-python3.7-Pygments-2.3.1.drv
  /nix/store/inr2yrna7j73v8f0rlw57my2lfm4wsdm-python3.7-alabaster-0.7.12.drv
  /nix/store/l36xpl5v3p4d7km1h9jfp974290i2phk-python3.7-MarkupSafe-1.1.0.drv
  /nix/store/n91sgwlxyja0pk9kmk4xgmkqchgjr4c2-python3.7-Jinja2-2.10.drv
  /nix/store/qphqrpcbb0f7pp699wvgy6fdc78pf0l5-python3.7-SQLAlchemy-1.2.14.drv
  /nix/store/sdlwswf0xvszakq83rja2lj3hxp4zrpr-python3.7-sphinxcontrib-websupport-1.1.0.drv
  /nix/store/sq7fw5i2jky9lxicv1sk75z3ph5545fz-python3.7-simplejson-3.16.0.drv
  /nix/store/2mrhags0m6yg2b88ry3l3h8dqdha3v70-python3.7-python-dateutil-2.8.0.drv
  /nix/store/4b6hczr9vjzl0dhv81svkznvsr8ibhrf-python3.7-freezegun-0.3.11.drv
  /nix/store/wvj48ing82w3bjs6qbwhk4vywv5w84pj-python3.7-Babel-2.6.0.drv
  /nix/store/43jgqgrs8fy8mvcfpd3rv6p84gzbnarn-python3.7-pkgconfig-1.4.0.drv
  /nix/store/whdjn69pr0d8ixl0kmpa51m4zwp366b7-gdb-8.2.1.drv
  /nix/store/5kmiqic5i7p69g5d7zcis09zv48sx9ga-python3.7-Cython-0.29.5.drv
  /nix/store/gzky5slwdyq9rjma7vwvb16ymzmdxck7-python3.7-PyStemmer-1.3.0.drv
  /nix/store/zrxv6mrh8v8ifryvwwrzrvqlbspkl3pz-python3.7-snowballstemmer-1.2.1.drv
  /nix/store/65g2fyndlfq3d4m7kzp4c2xfpzsd8dsm-python3.7-sphinx-1.8.3.drv
  /nix/store/26rq8gd6dh6vzn9rzz56ljqdr1sq90wi-ghc-8.6.4.drv
building '/nix/store/q325bf3n7y33nszmsn9pgcnxbp3dpava-python3-3.7.3.drv'...
unpacking sources
unpacking source archive /nix/store/r5ik1sbafp0kr3a7prnaca1lmmqmb0b6-Python-3.7.3.tar.xz
source root is Python-3.7.3
setting SOURCE_DATE_EPOCH to timestamp 1553547549 of file Python-3.7.3/Misc/NEWS
patching sources
applying patch /nix/store/gd8ycd6j3qhcq1qccaqz68zdq5l4c2wf-no-ldconfig.patch
patching file Lib/ctypes/util.py
applying patch /nix/store/ggk7z3dvydrkypxff7d7c6v1slvbriin-darwin-libutil.patch
patching file Modules/posixmodule.c
Hunk #1 succeeded at 5907 (offset 27 lines).
applying patch /nix/store/9kwzs3pplms8sijf55sdryypzvic4x1s-python-3.x-distutils-C++.patch
patching file Lib/_osx_support.py
patching file Lib/distutils/cygwinccompiler.py
patching file Lib/distutils/sysconfig.py
Hunk #1 succeeded at 183 (offset 13 lines).
Hunk #2 succeeded at 202 (offset 13 lines).
Hunk #3 succeeded at 231 (offset 13 lines).
patching file Lib/distutils/unixccompiler.py
Hunk #3 FAILED at 183.
1 out of 3 hunks FAILED -- saving rejects to file Lib/distutils/unixccompiler.py.rej
patching file Makefile.pre.in
Hunk #1 succeeded at 615 (offset 31 lines).
builder for '/nix/store/q325bf3n7y33nszmsn9pgcnxbp3dpava-python3-3.7.3.drv' failed with exit code 1
cannot build derivation '/nix/store/26rq8gd6dh6vzn9rzz56ljqdr1sq90wi-ghc-8.6.4.drv': 1 dependencies couldn't be built
error: build of '/nix/store/26rq8gd6dh6vzn9rzz56ljqdr1sq90wi-ghc-8.6.4.drv' failed

'
ERROR: Analysis of target '//:example' failed; build aborted: Analysis failed
INFO: Elapsed time: 5.354s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded, 2 targets configured)
FAILED: Build did NOT complete successfully (1 packages loaded, 2 targets configured)
    Fetching @rules_haskell_ghc_nixpkgs_haskell_toolchain; Restarting. 5s
    Fetching @local_config_cc; fetching 5s

Expected behavior
It should work without failure.

Environment

  • OS name + version: macOS Catalina 10.15.7 (19H114)
  • Bazel version:
    $ bazel version
    Build label: 3.3.1
    Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
    Build time: Tue Jun 30 15:14:05 2020 (1593530045)
    Build timestamp: 1593530045
    Build timestamp as int: 1593530045
  • Version of the rules: 0.13

Additional context

I was trying to convert a nix project to using rules_haskell but having problems with setting up rules_haskell myself. I was consistently getting env: python: No such file or directory. I decided to start from scratch and use the instructions in the README.md, but it doesn't seem to work.

I also tried the start script without --use-nix, and that also failed but with different errors about some C stuff for the zlib package.

@aherrmann
Copy link
Member

This looks like the underlying Nix build of GHC fails on macOS on a patch step:

applying patch /nix/store/9kwzs3pplms8sijf55sdryypzvic4x1s-python-3.x-distutils-C++.patch
patching file Lib/_osx_support.py
patching file Lib/distutils/cygwinccompiler.py
patching file Lib/distutils/sysconfig.py
Hunk #1 succeeded at 183 (offset 13 lines).
Hunk #2 succeeded at 202 (offset 13 lines).
Hunk #3 succeeded at 231 (offset 13 lines).
patching file Lib/distutils/unixccompiler.py
Hunk #3 FAILED at 183.

Which macOS version are you using?

The start script generates

nixpkgs_git_repository(
    name = "nixpkgs",
    revision = "19.03",
)
haskell_register_ghc_nixpkgs(
    repository = "@nixpkgs",
    attribute_path = "ghc",
    version = "8.6.4",
)

which should try to perform a Nix build equivalent to

$ nix build -f https://github.com/NixOS/nixpkgs/archive/19.03.tar.gz ghc

Could you check if manually invoking that build passes or fails?

nixpkgs 19.03 is a bit old by now. Could you try on 20.09 instead?

@aherrmann
Copy link
Member

aherrmann commented Jan 27, 2021

I was trying to convert a nix project to using rules_haskell but having problems with setting up rules_haskell myself. I was consistently getting env: python: No such file or directory.

Did your WORKSPACE include lines like the following?

nixpkgs_python_configure(
    repository = "@nixpkgs",
)

And did you enable the flag --host_platform=@io_tweag_rules_nixpkgs//nixpkgs/platforms:host?

@joneshf
Copy link
Contributor Author

joneshf commented Jan 27, 2021

Which macOS version are you using?

macOS Catalina 10.15.7 (19H114)

Could you check if manually invoking that build passes or fails?

$ nix build -f https://github.com/NixOS/nixpkgs/archive/19.03.tar.gz ghc
builder for '/nix/store/q325bf3n7y33nszmsn9pgcnxbp3dpava-python3-3.7.3.drv' failed with exit code 1; last 10 log lines:
  patching file Lib/distutils/cygwinccompiler.py
  patching file Lib/distutils/sysconfig.py
  Hunk #1 succeeded at 183 (offset 13 lines).
  Hunk #2 succeeded at 202 (offset 13 lines).
  Hunk #3 succeeded at 231 (offset 13 lines).
  patching file Lib/distutils/unixccompiler.py
  Hunk #3 FAILED at 183.
  1 out of 3 hunks FAILED -- saving rejects to file Lib/distutils/unixccompiler.py.rej
  patching file Makefile.pre.in
  Hunk #1 succeeded at 615 (offset 31 lines).
cannot build derivation '/nix/store/26rq8gd6dh6vzn9rzz56ljqdr1sq90wi-ghc-8.6.4.drv': 1 dependencies couldn't be built
[0 built (1 failed), 15.6 MiB DL]
error: build of '/nix/store/26rq8gd6dh6vzn9rzz56ljqdr1sq90wi-ghc-8.6.4.drv' failed

Well, that looks to be the issue! Thanks for the diagnosis.

nixpkgs 19.03 is a bit old by now. Could you try on 20.09 instead?

$ nix build -f https://github.com/NixOS/nixpkgs/archive/20.09.tar.gz ghc
[17 copied (2243.8 MiB), 284.3 MiB DL]

Looks like it pulled everything from the cache and succeeded. So maybe the start script should be updated?

After changing nixpkgs_git_repository.revision to "20.09" and haskell_register_ghc_nixpkgs.version to "8.8.4" (since that's the version of ghc on 20.09), I get further but start running into the python error from above:

$ BAZEL_USE_CPP_ONLY_TOOLCHAIN=1 bazel run //:example
DEBUG: /private/var/tmp/_bazel_joneshf/30fb5317f87f7a635a57a271880251db/external/rules_haskell/haskell/private/versions.bzl:60:10: WARNING: bazel version is too recent. Supported versions range from 2.1.0 to 3.3.1, but found: 3.7.2
these derivations will be built:
  /nix/store/r7s3j21fgqcm5a1apn9w5dgxgsqxxv7r-posix-toolchain.drv
  /nix/store/bgmyq1r3fnd47f14j96snaribi7i6k7w-bazel-nixpkgs-posix-toolchain.drv
building '/nix/store/r7s3j21fgqcm5a1apn9w5dgxgsqxxv7r-posix-toolchain.drv'...
created 217 symlinks in user environment
building '/nix/store/bgmyq1r3fnd47f14j96snaribi7i6k7w-bazel-nixpkgs-posix-toolchain.drv'...
/nix/store/xyf55227pidai9j9r7dn7mqhsq9i8a6m-bazel-nixpkgs-posix-toolchain
/nix/store/y0i2ki3i32b2rfvmzaaq85k40k5lwqmc-zlib-1.2.11-dev
these derivations will be built:
  /nix/store/i0qxrw8ca6hkixk7wyial6vx6dkvd9w4-bazel-nixpkgs-python-toolchain.drv
building '/nix/store/i0qxrw8ca6hkixk7wyial6vx6dkvd9w4-bazel-nixpkgs-python-toolchain.drv'...
/nix/store/j0rlhx76vjj9r6m8m7qzm1nzrbidmkrr-bazel-nixpkgs-python-toolchain
/nix/store/74slwpsd5xdvy2g2kvzsyrrxhf58js8n-zlib-1.2.11
WARNING: /private/var/tmp/_bazel_joneshf/30fb5317f87f7a635a57a271880251db/external/zlib.dev/BUILD:8:11: in linkstatic attribute of cc_library rule @zlib.dev//:zlib: setting 'linkstatic=1' is recommended if there are no object files. Since this rule was created by the macro 'cc_library', the error might have been caused by the macro implementation
INFO: Analyzed target //:example (22 packages loaded, 925 targets configured).
INFO: Found 1 target...
ERROR: /private/var/tmp/_bazel_joneshf/30fb5317f87f7a635a57a271880251db/external/stackage/BUILD.bazel:12:22: HaskellCabalLibrary @stackage//:zlib failed (Exit 127): cabal_wrapper failed: error executing command bazel-out/host/bin/external/rules_haskell/haskell/cabal_wrapper lib:zlib zlib-0.6.2.1 true external/stackage/zlib-0.6.2.1/Setup.hs external/stackage/zlib-0.6.2.1 ... (remaining 12 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox cabal_wrapper failed: error executing command bazel-out/host/bin/external/rules_haskell/haskell/cabal_wrapper lib:zlib zlib-0.6.2.1 true external/stackage/zlib-0.6.2.1/Setup.hs external/stackage/zlib-0.6.2.1 ... (remaining 12 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
env: python: No such file or directory
Target //:example failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: /Users/joneshf/programming/joneshf/purs-compile-single/BUILD.bazel:29:15 HaskellCabalLibrary @stackage//:zlib failed (Exit 127): cabal_wrapper failed: error executing command bazel-out/host/bin/external/rules_haskell/haskell/cabal_wrapper lib:zlib zlib-0.6.2.1 true external/stackage/zlib-0.6.2.1/Setup.hs external/stackage/zlib-0.6.2.1 ... (remaining 12 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox cabal_wrapper failed: error executing command bazel-out/host/bin/external/rules_haskell/haskell/cabal_wrapper lib:zlib zlib-0.6.2.1 true external/stackage/zlib-0.6.2.1/Setup.hs external/stackage/zlib-0.6.2.1 ... (remaining 12 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
INFO: Elapsed time: 2.909s, Critical Path: 0.25s
INFO: 17 processes: 17 internal.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully

This is still using the start script, so it has the nixpkgs_python_configure and --host_platform set accordingly.

Did your WORKSPACE include lines like the following?

Yes.

And did you enable the flag --host_platform=@io_tweag_rules_nixpkgs//nixpkgs/platforms:host?

Yes.

@aherrmann
Copy link
Member

Looks like it pulled everything from the cache and succeeded. So maybe the start script should be updated?

Glad to hear that fixed the GHC build. Yes, the start script should be updated.

I get further but start running into the python error from above

This looks like what's reported here. Is Bazel itself provided by Nix or installed separately? The Python wrapper in nixpkgs's Bazel includes patches to avoid these kinds of issues. Could you retry running bazel build in a Nix shell that provides Bazel itself? Unfortunately, the Bazel Nix expression is broken on macOS in recent nixpkgs revisions, see NixOS/nixpkgs#105573. So, you will need to pull Bazel from an older nixpkgs revision. E.g. rules_haskell uses 1d80180.

@joneshf
Copy link
Contributor Author

joneshf commented Mar 16, 2021

Sorry, I missed your last message. I also abandoned the project I was working on in the meantime so didn't continue trying to figure this out.

Is Bazel itself provided by Nix or installed separately? The Python wrapper in nixpkgs's Bazel includes patches to avoid these kinds of issues.

Ah, that makes sense. I was using bazelisk in the project. So it was downloading a bazel binary from somewhere else on the internet. I'll try to remember that if I setup a new project. Thanks for the information!

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

Successfully merging a pull request may close this issue.

2 participants