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

Update Widevine signature_generator to Python 3 #19437

Merged
merged 2 commits into from
Jul 27, 2023

Conversation

mherrmann
Copy link
Collaborator

@mherrmann mherrmann commented Jul 26, 2023

We had to revert #18636 because init failed on Arm64 macOS with the output below.

Error output
17:13:16    writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
17:13:16    /private/var/folders/hz/kc4099jd1czfj03q5t6xltlc0000gp/T/pip-build-env-g46jx2s4/overlay/lib/python3.8/site-packages/setuptools/command/build_py.py:201: _Warning: Package 'cryptography.hazmat.bindings._rust' is absent from the `packages` configuration.
17:13:16    !!
17:13:16    
17:13:16            ********************************************************************************
17:13:16            ############################
17:13:16            # Package would be ignored #
17:13:16            ############################
17:13:16            Python recognizes 'cryptography.hazmat.bindings._rust' as an importable package[^1],
17:13:16            but it is absent from setuptools' `packages` configuration.
17:13:16    
17:13:16            This leads to an ambiguous overall configuration. If you want to distribute this
17:13:16            package, please make sure that 'cryptography.hazmat.bindings._rust' is explicitly added
17:13:16            to the `packages` configuration field.
17:13:16    
17:13:16            Alternatively, you can also rely on setuptools' discovery methods
17:13:16            (for example by using `find_namespace_packages(...)`/`find_namespace:`
17:13:16            instead of `find_packages(...)`/`find:`).
17:13:16    
17:13:16            You can read more about "package discovery" on setuptools documentation page:
17:13:16    
17:13:16            - https://setuptools.pypa.io/en/latest/userguide/package_discovery.html
17:13:16    
17:13:16            If you don't want 'cryptography.hazmat.bindings._rust' to be distributed and are
17:13:16            already explicitly excluding 'cryptography.hazmat.bindings._rust' via
17:13:16            `find_namespace_packages(...)/find_namespace` or `find_packages(...)/find`,
17:13:16            you can try to use `exclude_package_data`, or `include-package-data=False` in
17:13:16            combination with a more fine grained `package-data` configuration.
17:13:16    
17:13:16            You can read more about "package data files" on setuptools documentation page:
17:13:16    
17:13:16            - https://setuptools.pypa.io/en/latest/userguide/datafiles.html
17:13:16    
17:13:16    
17:13:16            [^1]: For Python, any directory (with suitable naming) can be imported,
17:13:16                  even if it does not contain any `.py` files.
17:13:16                  On the other hand, currently there is no concept of package data
17:13:16                  directory, all directories are treated like packages.
17:13:16            ********************************************************************************
17:13:16    
17:13:16    !!
17:13:16      check.warn(importable)
17:13:16    copying src/cryptography/py.typed -> build/lib.macosx-11.0-arm64-cpython-38/cryptography
17:13:16    creating build/lib.macosx-11.0-arm64-cpython-38/cryptography/hazmat/bindings/_rust
17:13:16    copying src/cryptography/hazmat/bindings/_rust/__init__.pyi -> build/lib.macosx-11.0-arm64-cpython-38/cryptography/hazmat/bindings/_rust
17:13:16    copying src/cryptography/hazmat/bindings/_rust/asn1.pyi -> build/lib.macosx-11.0-arm64-cpython-38/cryptography/hazmat/bindings/_rust
17:13:16    copying src/cryptography/hazmat/bindings/_rust/ocsp.pyi -> build/lib.macosx-11.0-arm64-cpython-38/cryptography/hazmat/bindings/_rust
17:13:16    copying src/cryptography/hazmat/bindings/_rust/x509.pyi -> build/lib.macosx-11.0-arm64-cpython-38/cryptography/hazmat/bindings/_rust
17:13:16    warning: build_py: byte-compiling is disabled, skipping.
17:13:16    
17:13:16    running build_ext
17:13:16    generating cffi module 'build/temp.macosx-11.0-arm64-cpython-38/_openssl.c'
17:13:16    creating build/temp.macosx-11.0-arm64-cpython-38
17:13:16    running build_rust
17:13:16    cargo rustc --lib --message-format=json-render-diagnostics --manifest-path src/rust/Cargo.toml --release -v --features pyo3/abi3-py36 pyo3/extension-module --crate-type cdylib -- -C link-args=-undefined dynamic_lookup -Wl,-install_name,@rpath/_rust.abi3.so
17:13:16    error: rustup could not choose a version of cargo to run, because one wasn't specified explicitly, and no default is configured.
17:13:16    help: run 'rustup default stable' to download the latest stable release of Rust and set it as your default toolchain.
17:13:16    
17:13:16        =============================DEBUG ASSISTANCE=============================
17:13:16        If you are seeing a compilation error please try the following steps to
17:13:16        successfully install cryptography:
17:13:16        1) Upgrade to the latest pip and try again. This will fix errors for most
17:13:16           users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
17:13:16        2) Read https://cryptography.io/en/latest/installation/ for specific
17:13:16           instructions for your platform.
17:13:16        3) Check our frequently asked questions for more information:
17:13:16           https://cryptography.io/en/latest/faq/
17:13:16        4) Ensure you have a recent Rust toolchain installed:
17:13:16           https://cryptography.io/en/latest/installation/#rust
17:13:16    
17:13:16        Python: 3.8.10
17:13:16        platform: macOS-13.3-arm64-arm-64bit
17:13:16        pip: n/a
17:13:16        setuptools: 68.0.0
17:13:16        setuptools_rust: 1.6.0
17:13:16        =============================DEBUG ASSISTANCE=============================
17:13:16    
17:13:16    error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path src/rust/Cargo.toml --release -v --features 'pyo3/abi3-py36 pyo3/extension-module' --crate-type cdylib -- -C 'link-args=-undefined dynamic_lookup -Wl,-install_name,@rpath/_rust.abi3.so'` failed with code 1
17:13:16    ----------------------------------------
17:13:16    ERROR: Failed building wheel for cryptography

This PR contains the same changes as #18636, except for improved logic in DEPS.

@github-actions github-actions bot added CI/run-audit-deps Check for known npm/cargo vulnerabilities (audit_deps) potential-layer-violation-fixes This PR touches a BUILD.gn file with check_includes=false labels Jul 26, 2023
@mherrmann mherrmann force-pushed the signature_generator_py3 branch from d98ff1e to d0af371 Compare July 26, 2023 16:50
@mherrmann mherrmann marked this pull request as ready for review July 26, 2023 18:07
@mherrmann mherrmann requested review from fmarier, simonhong, a team and bridiver as code owners July 26, 2023 18:07
@mherrmann
Copy link
Collaborator Author

@fmarier @simonhong can I please ask for your reviews? The only differences to #18636 are in DEPS.

Copy link
Member

@fmarier fmarier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

script/brave_license_helper.py 👍

@mherrmann mherrmann enabled auto-merge (squash) July 27, 2023 13:41
@mherrmann mherrmann merged commit 5dc3dcc into master Jul 27, 2023
@mherrmann mherrmann deleted the signature_generator_py3 branch July 27, 2023 14:55
@github-actions github-actions bot added this to the 1.58.x - Nightly milestone Jul 27, 2023
mherrmann added a commit that referenced this pull request Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI/run-audit-deps Check for known npm/cargo vulnerabilities (audit_deps) needs-security-review potential-layer-violation-fixes This PR touches a BUILD.gn file with check_includes=false
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants