Skip to content

Commit

Permalink
Merge pull request #10305 from EricCousineau-TRI/issue/10304
Browse files Browse the repository at this point in the history
bazelrc: Add platform-specific --action_env=PATH
  • Loading branch information
EricCousineau-TRI authored Jan 2, 2019
2 parents e1f9389 + 2d97b78 commit 972825e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/macos.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ build --action_env=DRAKE_PYTHON_BIN_PATH=/usr/local/bin/python2
# Explicit configuration for Python 3.
build:python3 --python_path=/usr/local/bin/python3
build:python3 --action_env=DRAKE_PYTHON_BIN_PATH=/usr/local/bin/python3

# Configure ${PATH} for actions.
# N.B. Ensure this is consistent with `execute.bzl`.
build --action_env=PATH=/usr/local/bin:/usr/bin:/bin
4 changes: 4 additions & 0 deletions tools/ubuntu-bionic.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ build --action_env=DRAKE_PYTHON_BIN_PATH=/usr/bin/python2
# Explicit configuration for Python 3.
build:python3 --python_path=/usr/bin/python3
build:python3 --action_env=DRAKE_PYTHON_BIN_PATH=/usr/bin/python3

# Configure ${PATH} for actions.
# N.B. Ensure this is consistent with `execute.bzl`.
build --action_env=PATH=/usr/bin:/bin
4 changes: 4 additions & 0 deletions tools/ubuntu-xenial.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ build --action_env=DRAKE_PYTHON_BIN_PATH=/usr/bin/python2
# Explicit configuration for Python 3.
build:python3 --python_path=/usr/bin/python3
build:python3 --action_env=DRAKE_PYTHON_BIN_PATH=/usr/bin/python3

# Configure ${PATH} for actions.
# N.B. Ensure this is consistent with `execute.bzl`.
build --action_env=PATH=/usr/bin:/bin
3 changes: 3 additions & 0 deletions tools/workspace/execute.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ def path(repo_ctx, additional_search_paths = []):
"""Return the value of the PATH environment variable that would be used by
the which() command."""
search_paths = additional_search_paths

# N.B. Ensure ${PATH} in each platform `tools/*.bazelrc` matches these
# paths.
if repo_ctx.os.name == "mac os x":
search_paths = search_paths + ["/usr/local/bin"]
search_paths = search_paths + ["/usr/bin", "/bin"]
Expand Down

0 comments on commit 972825e

Please sign in to comment.