Skip to content

bazel: set PATH automatically on macOS#17467

Merged
mattklein123 merged 1 commit intoenvoyproxy:mainfrom
keith:ks/bazel-set-path-automatically-on-macos
Jul 23, 2021
Merged

bazel: set PATH automatically on macOS#17467
mattklein123 merged 1 commit intoenvoyproxy:mainfrom
keith:ks/bazel-set-path-automatically-on-macos

Conversation

@keith
Copy link
Copy Markdown
Member

@keith keith commented Jul 23, 2021

Previously there was a docs recommendation to set the path manually when
building on macOS. Since we can use the build:macos config we can do
this automatically. This also allows us to transparently solve PATH
differences with Apple Silicon homebrew and intel homebrew, for the host
configuration as well.

This fixes this issue
bazel-contrib/rules_foreign_cc#672 that intel
homebrew didn't have because --incompatible_strict_action_env contains
/usr/local/bin but not /opt/homebrew/bin

This also reorders these so that we prefer pre-installed tools for
stability.

Signed-off-by: Keith Smiley keithbsmiley@gmail.com

Previously there was a docs recommendation to set the path manually when
building on macOS. Since we can use the `build:macos` config we can do
this automatically. This also allows us to transparently solve PATH
differences with Apple Silicon homebrew and intel homebrew, for the host
configuration as well.

This fixes this issue
bazel-contrib/rules_foreign_cc#672 that intel
homebrew didn't have because `--incompatible_strict_action_env` contains
`/usr/local/bin` but not `/opt/homebrew/bin`

This also reorders these so that we prefer pre-installed tools for
stability.

Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
@keith keith force-pushed the ks/bazel-set-path-automatically-on-macos branch from 73c7707 to d9ec25d Compare July 23, 2021 17:14
@htuch htuch self-assigned this Jul 23, 2021
@mattklein123 mattklein123 merged commit 6834081 into envoyproxy:main Jul 23, 2021
@keith keith deleted the ks/bazel-set-path-automatically-on-macos branch July 23, 2021 20:17
@codefromthecrypt
Copy link
Copy Markdown
Contributor

looking better already, right @carlocab!

@carlocab
Copy link
Copy Markdown

Better -- however it doesn't work for users who want to build Envoy from source and have a Homebrew-installation in a non-default prefix...

@htuch
Copy link
Copy Markdown
Member

htuch commented Jul 26, 2021

I think there are limits on what we can do automagically. Best to address non-default installations with explicit instructions on how to set PATH via .bazelrc override.

leyao-daily pushed a commit to leyao-daily/envoy that referenced this pull request Sep 30, 2021
Previously there was a docs recommendation to set the path manually when
building on macOS. Since we can use the `build:macos` config we can do
this automatically. This also allows us to transparently solve PATH
differences with Apple Silicon homebrew and intel homebrew, for the host
configuration as well.

This fixes this issue
bazel-contrib/rules_foreign_cc#672 that intel
homebrew didn't have because `--incompatible_strict_action_env` contains
`/usr/local/bin` but not `/opt/homebrew/bin`

This also reorders these so that we prefer pre-installed tools for
stability.

Signed-off-by: Keith Smiley <keithbsmiley@gmail.com>
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.

5 participants