Skip to content

compile_pip_requirements should be robust against upstream wheel breakages #2763

Closed
@brandonchinn178

Description

@brandonchinn178

🐞 bug report

Yesterday around 2p PDT, bazel test //:requirements_test inexplicably started failing with an unhelpful error:

==================== Test output for //:requirements_test:
Backend subprocess exited when trying to invoke prepare_metadata_for_build_wheel
Failed to parse /.../pyproject.toml
pip-compile exited with code 2. This means that pip-compile found incompatible requirements or could not find a version that matches the install requirement in one of ['pyproject.toml'].
Checking requirements.txt
================================================================================

The first source of friction was debugging the underlying error. After finding the underlying dependency_resolver.py command, running it manually with --verbose shows a more helpful message:

error: invalid command 'bdist_wheel'

But this still remains perplexing, as we saw the wheel package being installed earlier in the output. Then it started inexplicably working again this morning, which led me to pypa/wheel#662. wheel released a version that broke here and they yanked it, causing it to work again.

Overall, this was very confusing because we don't expect to encounter these types of issues anymore with a hermetic build system.

Requests:

  1. Expose a mechanism to run pip-compile with --verbose
  2. If pip-compile exits with anything other than "incompatible dependencies", suggest rerunning with --verbose
  3. Pin the version of wheel/setuptools that are being installed

Affected Rule

Is this a regression?

Description

🔬 Minimal Reproduction

🔥 Exception or Error

🌍 Your Environment

Operating System:

  

  

Output of bazel version:

  

  

Rules_python version:

  

  

Anything else relevant?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions