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

Reintroduce support for Python 2.6 to python_stub_template #11269

Closed
wants to merge 1 commit into from
Closed

Reintroduce support for Python 2.6 to python_stub_template #11269

wants to merge 1 commit into from

Commits on Apr 30, 2020

  1. 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
    ```
    rbeasley committed Apr 30, 2020
    Configuration menu
    Copy the full SHA
    897400a View commit details
    Browse the repository at this point in the history