Skip to content
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

Cleanup flags and code paths for legacy runtime resolution #8169

Closed
brandjon opened this issue Apr 26, 2019 · 2 comments
Closed

Cleanup flags and code paths for legacy runtime resolution #8169

brandjon opened this issue Apr 26, 2019 · 2 comments
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-Rules-Python Native rules for Python type: process

Comments

@brandjon
Copy link
Member

Tracking bug for deleting --incompatible_use_python_toolchains, --python_top, --python_path, --python2_path, --python3_path, and the legacy code supporting these flags. --python_path is also tracked by #7901.

We actually still depend on a variant of the legacy mechanism within Google, so this cleanup won't be completed anytime soon.

@brandjon brandjon added P3 We're not considering working on this, but happy to review a PR. (No assignee) type: process team-Rules-Python Native rules for Python labels Apr 26, 2019
@Warchant
Copy link
Contributor

Any news?

copybara-service bot pushed a commit that referenced this issue Feb 6, 2023
This fixes the failures on MacOS after the recent upgrade to CI.

When `//src/test/py/baze:runfiles_test` sets
`--incompatible_use_python_toolchains=false`, it eventuallys tries to search
`PATH` for `python`. This is because it falls back to the `--python_path`
flag, which has a computed default of "python". Since new Mac versions no
longer provide Python 2, this doesn't work.

To fix, enable Python toolchains. Comments indicate they were only disabled
because Python 3 wasn't available on the Mac CI machines at the time.

For pywrapper_test: this was failing because it copies system utilities (e.g
`/usr/bin/which`) to another location and tries to run them. For newer MacOS
versions, this results in a failure due AMFI (a security mechanism, see
https://theevilbit.github.io/posts/amfi_launch_constraints/)

To fix, instead of copying the binary, write a wrapper that re-execs the
original binary.

Work towards #16526, #8169

PiperOrigin-RevId: 507526814
Change-Id: Ifaacc30cb155af30af606254eb7ffcd9304478f6
hvadehra pushed a commit that referenced this issue Feb 14, 2023
This fixes the failures on MacOS after the recent upgrade to CI.

When `//src/test/py/baze:runfiles_test` sets
`--incompatible_use_python_toolchains=false`, it eventuallys tries to search
`PATH` for `python`. This is because it falls back to the `--python_path`
flag, which has a computed default of "python". Since new Mac versions no
longer provide Python 2, this doesn't work.

To fix, enable Python toolchains. Comments indicate they were only disabled
because Python 3 wasn't available on the Mac CI machines at the time.

For pywrapper_test: this was failing because it copies system utilities (e.g
`/usr/bin/which`) to another location and tries to run them. For newer MacOS
versions, this results in a failure due AMFI (a security mechanism, see
https://theevilbit.github.io/posts/amfi_launch_constraints/)

To fix, instead of copying the binary, write a wrapper that re-execs the
original binary.

Work towards #16526, #8169

PiperOrigin-RevId: 507526814
Change-Id: Ifaacc30cb155af30af606254eb7ffcd9304478f6
@sgowroji sgowroji added the stale Issues or PRs that are stale (no activity for 30 days) label Feb 15, 2023
@sgowroji
Copy link
Member

Hi there! We're doing a clean up of old issues and will be closing this one. Please reopen if you’d like to discuss anything further. We’ll respond as soon as we have the bandwidth/resources to do so.

@sgowroji sgowroji closed this as not planned Won't fix, can't repro, duplicate, stale Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) stale Issues or PRs that are stale (no activity for 30 days) team-Rules-Python Native rules for Python type: process
Projects
None yet
Development

No branches or pull requests

3 participants