Skip to content

Make MODULE.bazel.lock file have the same contents no matter the platform bazel is executed on #1643

@aignas

Description

@aignas

This is a ticket to tidy up and do feature work to ensure that the pip bzlmod extension can generate a lock file that is os,arch independent. The rough list of steps that we need to take are:

  • Create a host toolchain that can be passed to the python_interpreter_target. We need to ensure that the label that is passed to the whl_library repo rule is the same no matter the platform.
  • Introduce a way to handle multiple requirements files and generate the wheel repositories similar to how it is done in exp: multi-arch whl_library in bzlmod #1625.
  • Remove the requirement file selection based on the host platform and instead generate the repos for all available requirement files. Because the platform specific requirements files may have different versions of packages, we have to go all the way through and go with the approach outlined in exp: multi-arch whl_library in bzlmod #1625 in the general case to be fully correct.

To make the pip extension more maintainable we might also need to have:

  • config_setting values for (pyXY, os, cpu) triples so that we can more easily create the required aliases in the hub repository.
  • Making the dependency resolution aware of the python abi.

The above would make the number of layers of indirection fewer and hopefully make it easier to extend the code in general.

This general work may be related fix some aspects of #310 for bzlmod.

Original issue that spurred a feature on bazel itself: bazelbuild/bazel#19154. The motivation for restarting the effort is the fact that maintaining a lock file that has os,arch specific sections is hard and requires updating the lock file by running bazel on a number of platforms and this just does not scale in the long term.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions