Skip to content

Conversation

alexmv
Copy link

@alexmv alexmv commented Dec 28, 2017

Fixes livegrep/livegrep#136 -- or I believe it should.

@alexmv alexmv requested a review from samertm December 28, 2017 19:26
@alexmv
Copy link
Author

alexmv commented Dec 28, 2017

Noooope, too quick a search/replace, this clearly can't help. Let me dig a little deeper.

@alexmv
Copy link
Author

alexmv commented Dec 28, 2017

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.

@alexmv
Copy link
Author

alexmv commented Dec 28, 2017

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.

@samertm
Copy link
Contributor

samertm commented Dec 28, 2017

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?

@francolamping
Copy link

@alexmv the workaround worked, thanks! Funny that it didn't work before even inside a virtualenv2

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

Successfully merging this pull request may close these issues.

3 participants