rules_node
rules_node copied to clipboard
Be specific about the major version of python
Fixes livegrep/livegrep#136 -- or I believe it should.
Noooope, too quick a search/replace, this clearly can't help. Let me dig a little deeper.
AFAICT py_binary
should always get a python2 unless one asks otherwise, and the command is invoked by Bazel itself.
But bazel build //node/tools/npm:install
indeed produces a bazel-bin/node/tools/npm/install
which starts with #!/usr/bin/env python
which assumes straddling code. Color me confused.
Ah -- it's not the shebang line on that, it's the PYTHON_BINARY = 'python'
line that Bazel generates.
@francolamping, a workaround would be to pass --python_path=$(which python2.7)
to your Bazel invocation.
An alternative fix could be to update tools/npm/install so that it's python 2 and 3 compatible. What do you think about that?
@alexmv the workaround worked, thanks! Funny that it didn't work before even inside a virtualenv2