Open SomeoneSerge opened 9 months ago
Possibly related: bazel includes a --override_repository
flag that allows one to override the vendoring of third party code (eg pulled in via http_archive
, local_repository
, etc). This could be a nice alternative to some otherwise pretty hairy patching. A notable caveat being that this requires the source, not build artifacts, meaning that although we could abstract the XLA source out of both the JAX and TF builds, we would repeat the XLA build twice as a constituent of both the JAX and TF builds.
The other issue being that I have yet to get it to work successfully in jaxlib :P
I think we can do this in a sensible way for packages that use bzlmod.
Issue description
From what I see, the way we package jaxlib and tensorflow is unsustainable. One of the symptoms is the deeply nested conditional expressions for the hashes of the vendored dependencies (
fetchAttrs
). Besides,fetchAttrs
is potentially a bootstrap, package set consistency, and security issue.Consider if it's feasible to automatically generate something like "bazel repositories" that ingest pkg-config/cmake exports from
buildInputs
, and if it's possible to substitute bazel's "source builds" of the vendored dependencies with the ingested targets in a generic mannerPossibly a relevant discussion upstream, limited to bzlmod: https://github.com/bazelbuild/bazel/discussions/20581
CC @NixOS/bazel @zeuner @layus @aaronmondal @NixOS/cuda-maintainers