-
Notifications
You must be signed in to change notification settings - Fork 81
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
rules_haskell requires python2 on Ubuntu when not using Nix #1173
Comments
I have what looks like a similar issue using Ubuntu18.04, with python2 installed:
Version of the rules: 8f7d759, bazel version: 2.0.0 |
Here are more details (version of the rules: 9a52a45). One of the nix environment built when running tests without being in a
In this context:
yields nothing. |
Yes, that is expected. The POSIX toolchain does not include Python.
I'm not sure I understand what that means. Can you give instructions how to reproduce this setup?
That's the part that's concerning. Both in bindist mode and nixpkgs mode we're using a Python toolchain ( The |
Yes I didn't intend to highlight the posix-toolchain part, but instead wanted to point out that this path is the only element of PATH and that python is indeed not there.
Here it is (running Ubuntu 18.04): > git clone https://github.com/tweag/rules_haskell
> cd rules_haskell
> bazel test //... # bazel version is 2.0.0
Here it is: https://gist.github.com/smelc/90e399481f4638f7255393cd9b59f94d |
For the record, I'm observing that The python3 path is correctly found by |
Ah, indeed the This specific issue is probably caused by us overwriting |
Thank you, yes it's picking the right Python toolchain. Regarding the failure in the bottom of that log. That's because Bazel ends up using the Nix provided C toolchain despite using non-Nix toolchains for everything else. That's a consequence of tweag/rules_nixpkgs#88. I.e. for the C toolchain we're not making use of Bazel's toolchain selection mechanism. Instead, if
The correct solution is to resolve tweag/rules_nixpkgs#88. |
Ultimately my issue is that I was trying to have too many tests pass. Some tests in a no Nix environment (no NixOS, Ubuntu without Make sure
Then remove
In this state, you should observe that
To circumvent that:
Now |
Describe the bug
rules_haskell in GHC bindist mode (not Nix shell) requires the
python
package on Ubuntu which provides Python 2.To Reproduce
Try to run rules_haskell test suite on Ubuntu image without Python 2 installed. See https://buildkite.com/tweag-1/rules-haskell/builds/667#a3798e34-7be3-433f-bfa3-0aca1b0a303f/36-2757.
Expected behavior
Python 3 alone (
python3
on Ubuntu) should be sufficient.Environment
Additional context
The
cc_wrapper
script that raises the error is apy_binary
target. The source file specifies#!/usr/bin/env python3
, however, it seems that Bazel generates a Python script requiring/usr/bin/env python
anyway.cc @flokli
The text was updated successfully, but these errors were encountered: