Skip to content

Drop WORKSPACE support - #164

Draft
hartikainen wants to merge 6 commits into
google-deepmind:masterfrom
hartikainen:kristian/bzlmod-only
Draft

hartikainen wants to merge 6 commits into
google-deepmind:masterfrom
hartikainen:kristian/bzlmod-only

Conversation

@hartikainen

@hartikainen hartikainen commented Sep 16, 2026 •

Copy link
Copy Markdown

As a follow-up to #163, this PR replaces WORKSPACE-based builds with Bzlmod.

Depends on #163.

@hartikainen hartikainen changed the title Build Reverb with Bzlmod on Bazel 9.2.0 Enable Bzlmod on Bazel 9.2.0 Sep 17, 2026
Currently, Reverb passes `py::call_guard` directly to the
`episode_steps` property declaration. As explained in [pybind11's
upstream change](pybind/pybind11#5533), property
declarations silently ignored these guards, and the added compile-time
check rejects that usage, preventing the binding from compiling.

This PR wraps the `episode_steps` getter in `py::cpp_function` and
applies the call guard to that function so that reading the property
releases the GIL as intended.
Currently, an op wrapper with no `ops_lib` drops its kernel dependency
because operator precedence makes the conditional apply to the entire
dependency list. This PR adds parentheses around the optional `ops_lib`
dependency so that the generated shared library always links its kernel.
The build helpers currently have two issues: they rely on native rules
and pass `depset` values directly to attributes that expect lists of
labels. The rule references fail when their built-in or automatically
loaded definitions are unavailable, while the dependency arguments cause
attribute type errors.

This PR addresses both issues by explicitly loading `cc_library`, using
the already-loaded `py_library`, and converting the dependency sets to
lists.
Currently, downstream Bazel builds do not inherit Reverb's `.bazelrc`
flags, which can cause unresolved-symbol linker errors when building
macOS shared libraries that depend on symbols supplied at runtime. This
PR moves the dynamic symbol lookup setting from the global linker flags
to the shared-library targets so that downstream builds receive the
required linker configuration.
This PR adds Bzlmod support to the build system.

Depends on google-deepmind#162.
As a follow-up to google-deepmind#163, this PR replaces `WORKSPACE`-based builds with
Bzlmod.

Depends on google-deepmind#163.
@hartikainen
hartikainen force-pushed the kristian/bzlmod-only branch 3 times, most recently from e7364eb to 1e42b1f Compare September 19, 2026 17:44
hartikainen added a commit to hartikainen/reverb that referenced this pull request Sep 19, 2026
With builds using Bzlmod as of google-deepmind#163 and google-deepmind#164, this change upgrades Bazel
from `7.7.0` to `9.2.0` and updates the dependency rules and
configuration for that version.

The Bazel rules use Protobuf `35.1`, while a separate native Protobuf
dependency stays at `31.1` for TensorFlow compatibility. Keeping these
dependencies separate allows the build rules to advance without changing
the native runtime linked with TensorFlow. The dependency patches use
the corresponding rule providers and native libraries.
@hartikainen hartikainen changed the title Enable Bzlmod on Bazel 9.2.0 Drop WORKSPACE support Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant