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

Improve error message when Python is missing #1416

Closed
mboes opened this issue Sep 11, 2020 · 1 comment
Closed

Improve error message when Python is missing #1416

mboes opened this issue Sep 11, 2020 · 1 comment

Comments

@mboes
Copy link
Member

mboes commented Sep 11, 2020

Is your feature request related to a problem? Please describe.
Running any bazel build command on a fresh system with no Python, within a workspace that uses rules_haskell, will eventually yield an error of the form:

Repository rule _config_python3_toolchain defined at:
  /root/.cache/bazel/_bazel_root/abad448bf464eefeaf2734c3cc8cdd46/external/rules_haskell/haskell/ghc_bindist.bzl:598:44: in <toplevel>
ERROR: An error occurred during the fetch of repository 'rules_haskell_python_local':
   Traceback (most recent call last):
        File "/root/.cache/bazel/_bazel_root/abad448bf464eefeaf2734c3cc8cdd46/external/rules_haskell/haskell/ghc_bindist.bzl", line 562, column 32, in _configur
e_python3_toolchain_impl
                python3_path = _find_python(repository_ctx)
        File "/root/.cache/bazel/_bazel_root/abad448bf464eefeaf2734c3cc8cdd46/external/rules_haskell/haskell/ghc_bindist.bzl", line 555, column 40, in _find_pyt
hon
                result = repository_ctx.execute([python, "--version"])
Error in execute: Argument 0 of execute is neither a path, label, nor string.

This message is not user-friendly. It does not immediately point to the root cause: that the python command simply does not exist on the current system.

Describe the solution you'd like
We could introduce a fall to fail() explaining that there is no python in the current PATH.

@facundominguez
Copy link
Member

Fixed in #1529

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

No branches or pull requests

3 participants