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

[Cherry-pick] Fix builds from source and pip tar.gz on s390x systems #5986

Merged
merged 3 commits into from
Mar 5, 2024

Commits on Mar 2, 2024

  1. [Cherry-pick] Fix builds from source and pip tar.gz on s390x systems

    ### Description
    * Cherry-pick (#5984) - Fix builds from source and pip tar.gz on s390x systems
    * Revert (#5195) and replace with fix from [this comment](#5194 (comment)) from the original issue (#5194)
    
    ### Motivation and Context
    * Building on s390x (and other environments depending on python setup) fails
        * The issue also can also appear when installing `1.16.0rc1` from TestPyPI for environments where we don't have pre-built wheels
        * Failures include not being able to find pacakges despite them being installed
            ```
            pip3 install -e . ...
            -- Could NOT find pybind11 (missing: pybind11_DIR)
            ...
            Traceback (most recent call last): File "/onnx/.setuptools-cmake-build/tools/protoc-gen-mypy.py", line 28, in <module>
            import google.protobuf.descriptor_pb2 as d_typed
            ```
    * The issue is cased by (#5195) which was to fix (#5194)
        * The original fix bypasses the pip venv PYTHONPATH and attempts to rely on sys.path. However without the pip venv PYTHONPATH, some modules may not be found even if they are installed.
            * For reference, the pip venv PYTHONPATH gets set to  `/tmp/pip-build-env-bn_o_cjc/site` which contains `sitecustomize.py` which comes from https://github.com/pypa/pip/blob/main/tests/lib/venv.py#L171-L189
        *  Instead of bypassing the pip venv PYTHONPATH, [this comment](#5194 (comment)) from the original issue shows how to address the issue using pyproject.toml's `[build-system]`
     * I replicated the origial issue and confirmed this fix resolves it.
     * I confirmed the builds work on s390x with this fix
    
    Signed-off-by: Charles Volzka <cjvolzka@us.ibm.com>
    cjvolzka committed Mar 2, 2024
    Configuration menu
    Copy the full SHA
    75d76b6 View commit details
    Browse the repository at this point in the history

Commits on Mar 4, 2024

  1. Configuration menu
    Copy the full SHA
    dab66df View commit details
    Browse the repository at this point in the history

Commits on Mar 5, 2024

  1. Configuration menu
    Copy the full SHA
    fb26fe3 View commit details
    Browse the repository at this point in the history