tree: bc4f77e1e40099fe19271f3d944e12db182a9257
  1. BUILD
  2. extensions.bzl
  3. README.md
  4. workspace.bzl
enzyme/third_party/hedron_compile_commands/README.md

Using the Hedron helper from Enzyme-JAX

Enzyme owns the Hedron Compile Commands Extractor revision in third_party/hedron_compile_commands/workspace.bzl. Upstream dependencies should import that helper instead of keeping a second Hedron commit in its own repository.

WORKSPACE

The @enzyme repository must exist before its helper can be loaded. In the upstream WORKSPACE, replace the local Hedron helper and invocation with the following ordering:

load("//third_party/enzyme:workspace.bzl", enzyme_workspace = "repo")

enzyme_workspace()

load(
    "@enzyme//third_party/hedron_compile_commands:workspace.bzl",
    hedron_compile_commands_workspace = "repo",
)

hedron_compile_commands_workspace()

load("@hedron_compile_commands//:workspace_setup.bzl", "hedron_compile_commands_setup")
load("@hedron_compile_commands//:workspace_setup_transitive.bzl", "hedron_compile_commands_setup_transitive")
load("@hedron_compile_commands//:workspace_setup_transitive_transitive.bzl", "hedron_compile_commands_setup_transitive_transitive")
load("@hedron_compile_commands//:workspace_setup_transitive_transitive_transitive.bzl", "hedron_compile_commands_setup_transitive_transitive_transitive")

hedron_compile_commands_setup()
hedron_compile_commands_setup_transitive()
hedron_compile_commands_setup_transitive_transitive()
hedron_compile_commands_setup_transitive_transitive_transitive()

MODULE.bazel

If upstream uses bzlmod, expose the repository generated by Enzyme's module extension in the upstream repository mapping:

bazel_dep(name = "enzyme")

hedron_compile_commands = use_extension(
    "@enzyme//third_party/hedron_compile_commands:extensions.bzl",
    "hedron_compile_commands",
)
use_repo(hedron_compile_commands, "hedron_compile_commands")

After either migration, bump Hedron only in Enzyme's third_party/hedron_compile_commands/workspace.bzl and then update the Enzyme revision used by the upstream repo.