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

Provide a good error message when python3 is a script on MacOS #1721

Open
facundominguez opened this issue Mar 25, 2022 · 0 comments
Open

Provide a good error message when python3 is a script on MacOS #1721

facundominguez opened this issue Mar 25, 2022 · 0 comments
Labels
P2 major: an upcoming release type: bug

Comments

@facundominguez
Copy link
Member

facundominguez commented Mar 25, 2022

If python3 is a script, running cabal_wrapper fails on MacOS because the shebang in cabal_wrapper is ignored. e.g.

Use --sandbox_debug to see verbose messages from the sandbox
from: can't read /var/mail/__future__
from: can't read /var/mail/__future__
from: can't read /var/mail/__future__
bazel-out/host/bin/external/rules_haskell/haskell/cabal_wrapper: line 13: import: command not found
bazel-out/host/bin/external/rules_haskell/haskell/cabal_wrapper: line 19: del: command not found

rules_haskell could check this when generating the shebang and produce an error message that points the user to the cause of the problem. Additionally, maybe it could check that python3 has executable permissions.

Here's more context tweag/rules_nixpkgs#186. And here's were the python3 executable is searched for

def find_python(repository_ctx):
.

I've noticed also that the shebang works when cabal_wrapper is run from the terminal, but it doesn't work when called from another script like

$ cat test.sh
#!/bin/bash
bazel-out/host/bin/external/rules_haskell/haskell/cabal_wrapper
@aherrmann aherrmann added the P2 major: an upcoming release label Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 major: an upcoming release type: bug
Projects
None yet
Development

No branches or pull requests

2 participants