Skip to content

Commit

Permalink
[C++] Use python3 instead of python in bazel build (#1297)
Browse files Browse the repository at this point in the history
Some linux distributions do not have `python` by default, and some make
`python` point to python2 instead of python3.
  • Loading branch information
PragmaTwice committed Jan 3, 2024
1 parent 9e87851 commit c0a28d1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bazel/arrow/pyarrow_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ def _symlink_genrule_for_dir(
)
return genrule

def _get_pyarrow_include(repository_ctx, python_bin="python"):
def _get_pyarrow_include(repository_ctx, python_bin="python3"):
"""Gets the pyarrow include path."""
result = _execute(
repository_ctx, [
Expand All @@ -183,7 +183,7 @@ def _get_pyarrow_include(repository_ctx, python_bin="python"):
+ python_bin + ".) " + "Is distutils installed?"))
return result.stdout.splitlines()[0]

def _get_pyarrow_shared_library(repository_ctx, library_name, python_bin="python"):
def _get_pyarrow_shared_library(repository_ctx, library_name, python_bin="python3"):
"""Gets the pyarrow shared library path."""
code = """import pyarrow, os, glob;print(glob.glob(os.path.join(""" +\
"""os.path.dirname(pyarrow.__file__), 'lib{}.*'))[0])""".format(library_name)
Expand All @@ -198,7 +198,7 @@ def _get_pyarrow_shared_library(repository_ctx, library_name, python_bin="python
return result.stdout.splitlines()[0]

#python numpy include
def _get_python_numpy_include(repository_ctx, python_bin="python"):
def _get_python_numpy_include(repository_ctx, python_bin="python3"):
"""Gets the python numpy include path."""
result = _execute(
repository_ctx, [
Expand Down

0 comments on commit c0a28d1

Please sign in to comment.