iree icon indicating copy to clipboard operation
iree copied to clipboard

[Bazel] Migrate to bzlmod for LLVM compatibility

Open MaheshRavishankar opened this issue 1 month ago • 4 comments

LLVM has fully migrated to bzlmod (PR #164891) and now requires bzlmod features like protobuf dependencies and new rules_cc APIs. This change migrates IREE's Bazel build to use bzlmod.

Changes:

  • Add MODULE.bazel with dependencies matching LLVM's versions
  • Add build_tools/bazel/extensions.bzl module extension for creating LLVM and IREE submodule repositories
  • Enable bzlmod in iree.bazelrc
  • Update flatcc BUILD.overlay to use includes= instead of hardcoded -Iexternal/... paths
  • Update bitcode library paths for bzlmod repository naming
  • Update llvm-project submodule to include upstream bzlmod changes

🤖 Generated with Claude Code

MaheshRavishankar avatar Nov 25 '25 23:11 MaheshRavishankar

No need to review yet. This is just a draft I am trying to see what CI does. Ill get feeddback when this is ready for review

MaheshRavishankar avatar Nov 25 '25 23:11 MaheshRavishankar

@bjacob if you have sometime, and assuming that you have some info on Bazel, just wanted to see if you have some feedback on whether CLAUDE is just vomiting garbage here, or is this actually OK.

MaheshRavishankar avatar Nov 26 '25 00:11 MaheshRavishankar

@MaheshRavishankar :

  1. Is the WORKSPACE file still needed?
  2. Was either https://bazel.build/external/migration_tool or https://github.com/bazelbuild/bazel-central-registry/tree/main/tools/code-agent used? Just trying to gauge what is bespoke vs standard in this migration.

bjacob avatar Nov 26 '25 02:11 bjacob

No, I just tried something. I didn't know there was a migration tool. I can try that out when I get back if that works better

MaheshRavishankar avatar Nov 26 '25 02:11 MaheshRavishankar