Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reintroduce support for Python 2.6 to python_stub_template
Commit d5012a7 introduced a Python 2.7 dependency into python_stub_template.txt. Unfortunately this stub is non-hermetic, so even if the user has configured Python 2.7 and 3 `py_runtime`s, their builds may fail if the system-provided Python is ancient (ex: CentOS 6.6 provides Python 2.6.6). Accommodate ancient Python by reworking the path deduplication in terms of a `set` and a generator instead of `collections.OrderedDict`. Workaround for #11265. Testing Done: - `bazelisk test //src/test/shell/integration:python_stub_test` - In a CentOS 6.6 env: ```console $ /usr/bin/env python -V Python 2.6.6 $ cat >test.py <<EOF import sys print(sys.executable) EOF $ cat >BUILD <<EOF py_binary(name = "test", srcs = ["test.py"]) EOF $ bazel run :test /path/to/my/hermetic/python3 ``` Closes #11269. PiperOrigin-RevId: 309450777
- Loading branch information