p4c
p4c copied to clipboard
Upgrade to Bzlmod
Bazel finally added a external dependency management system, called "Bzlmod", a while back: https://bazel.build/external/overview By now, Bzlmod is mature and the old system (WORKSPACE.bazel files) have been deprecated as of Bazel 8 and will be removed in Bazel 9: https://bazel.build/external/migration
It is time to migrate to future proof our code base. This issue is tracking that effort.
There is a related issue that tracks upgrading to Bazel 8: https://github.com/p4lang/p4c/issues/5065
I created the same issue for p4runtime and p4-constraints:
- https://github.com/p4lang/p4runtime/issues/515
- https://github.com/p4lang/p4-constraints/issues/153
Could this help resolve some diamond dependency problems we have? (e.g., p4runtime vs p4-constraints vs p4c dependency conflicts)
Or fix https://github.com/p4lang/p4c/pull/4640 where we can not export some feature flags?
Could this help resolve some diamond dependency problems we have? (e.g., p4runtime vs p4-constraints vs p4c dependency conflicts)
Yes, in the sense that it will make sure that exactly one version of each common dependency will be picked.
Though that should already be true for the legacy dependency definition scheme (using WORKSPACE and *_deps.bzl files) we use today. Just in a much more adhoc fashion.
Or fix #4640 where we can not export some feature flags?
Not that I know off, no. I took a quick look at the issue to remind myself, but could not quite figure out what we're trying to achieve, and especially why. If this is still an important issue, I'd be open to discussing this via GVC more in depth some time.
The issue is effectively: https://github.com/abseil/abseil-cpp/issues/740
We are working around it by setting some options in CMake, but it would be nice to be consistent. Abseil is the only third-party system dependency in the compiler that requires quote includes.
First implementing https://github.com/p4lang/p4c/issues/5141 should make this easier.
Quick status update, here are the remaining blockers I am aware of. Basically, we need to port the libraries we depend on to Bzlmod & the BCR first.
- [x] Add Z3 to BCR (done: https://github.com/bazelbuild/bazel-central-registry/pull/5073)
- [ ] Add inja to BCR
- [ ] Figure out how to support p4c extensions (or maybe we can drop support for them if nobody is using them?)
cc @matthewtlam @jonathan-dilorenzo @bocon13