TreeTide / haskell-bazel-nix-template

Minimal template repo for hermetic Haskell development using Bazel/rules_haskell and Nix.
Apache License 2.0
7 stars 2 forks source link

could not find python binary error building master #1

Open codygman opened 3 years ago

codygman commented 3 years ago
[cody@nixos:~/code/haskell-bazel-nix-template]$ git log --oneline -n1 && nix-shell --pure --run "bazel build -c opt //treetide/..."
09853e2 (HEAD -> master, origin/master, origin/HEAD) Fix some vim command mode typing mess.
Loading: 
Loading: 0 packages loaded
Analyzing: 38 targets (0 packages loaded, 0 targets configured)
INFO: Analyzed 38 targets (0 packages loaded, 0 targets configured).
INFO: Found 38 targets...
[0 / 22] [Prepa] HaskellBuildLibrary //treetide/haskell/extended/xml-conduit:extended
ERROR: /home/cody/code/haskell-bazel-nix-template/treetide/haskell/extended/optparse-applicative/BUILD:12:1: HaskellBuildLibrary //treetide/haskell/extended/optparse-applicative:extended failed (Exit 1) ghc_wrapper failed: error executing command bazel-out/host/bin/external/rules_haskell/haskell/ghc_wrapper bazel-out/k8-opt/bin/treetide/haskell/extended/optparse-applicative/compile_flags_extended_HaskellBuildLibrary ... (remaining 1 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox

<no location info>: error:
    Warning: Couldn't figure out C compiler information!
             Make sure you're using GNU gcc, or clang
Traceback (most recent call last):
  File "bazel-out/host/bin/external/rules_haskell/haskell/cc_wrapper-python", line 349, in <module>
    Main()
  File "bazel-out/host/bin/external/rules_haskell/haskell/cc_wrapper-python", line 309, in Main
    raise AssertionError('Could not find python binary: ' + PYTHON_BINARY)
AssertionError: Could not find python binary: python
`cc_wrapper-python' failed in phase `Assembler'. (Exit code: 1)
INFO: Elapsed time: 0.509s, Critical Path: 0.42s
INFO: 0 processes.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully
avdv commented 3 years ago

Hi.

Just try to enable the use python toolchains setting in .bazelrc, ie. change

--noincompatible_use_python_toolchains

to

--incompatible_use_python_toolchains