Skip to content

Force /usr/bin/python2.7 on macOS #12072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

keith
Copy link
Member

@keith keith commented Sep 9, 2020

Because of this issue #12049
this call to python doesn't respect the PATH users invoke bazel with.
Because the default shell path contains /usr/local/bin, this python
could end up being from homebrew. Homebrew's python installations are
easily borked which leads to hashlib being unusable:

https://discuss.bitrise.io/t/broken-python-2-7-hashlib-in-new-xcode-10-3-x-mojave-stack/11401/7

This changes this use case to a path that always exists (at least for
now) on macOS, and only falls back to the bare executable if it doesn't.
Ideally this would utilize the python version from the toolchain
instead.

Because of this issue bazelbuild#12049
this call to python doesn't respect the PATH users invoke bazel with.
Because the default shell path contains /usr/local/bin, this `python`
could end up being from homebrew. Homebrew's python installations are
easily borked which leads to hashlib being unusable:

https://discuss.bitrise.io/t/broken-python-2-7-hashlib-in-new-xcode-10-3-x-mojave-stack/11401/7

This changes this use case to a path that always exists (at least for
now) on macOS, and only falls back to the bare executable if it doesn't.
Ideally this would utilize the python version from the toolchain
instead.
@keith keith force-pushed the ks/force-python27-on-macos branch from cbebe9b to 8306d24 Compare September 9, 2020 22:01
@bazel-io bazel-io closed this in abc2211 Oct 2, 2020
Yannic pushed a commit to Yannic/bazel that referenced this pull request Oct 5, 2020
Because of this issue bazelbuild#12049
this call to python doesn't respect the PATH users invoke bazel with.
Because the default shell path contains /usr/local/bin, this `python`
could end up being from homebrew. Homebrew's python installations are
easily borked which leads to hashlib being unusable:

https://discuss.bitrise.io/t/broken-python-2-7-hashlib-in-new-xcode-10-3-x-mojave-stack/11401/7

This changes this use case to a path that always exists (at least for
now) on macOS, and only falls back to the bare executable if it doesn't.
Ideally this would utilize the python version from the toolchain
instead.

Closes bazelbuild#12072.

PiperOrigin-RevId: 335109991
@keith keith deleted the ks/force-python27-on-macos branch October 22, 2020 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants