Skip to content

Bazel 8 migration - Patch Databinding Resource Processor#205

Merged
edwin-grabtaxi merged 1 commit intomigration/bazel_8_main_branchfrom
migration/bazel_8_resource_processor_patch
Feb 21, 2026
Merged

Bazel 8 migration - Patch Databinding Resource Processor#205
edwin-grabtaxi merged 1 commit intomigration/bazel_8_main_branchfrom
migration/bazel_8_resource_processor_patch

Conversation

@edwin-grabtaxi
Copy link
Collaborator

After migrating to Bazel 8, we received an error like this:
java.lang.IllegalStateException: bazel-out/arm64-fastbuild/bin/.../res is not an absolute path

In Bazel 7, the GenerateDataBindingBaseClasses action used Worker spawn strategy, which was implemented natively inside Bazel's C++ Android rules (bazelbuild/bazel#16067). When Bazel 8 externalized Android rules into rules_android, this worker support was not ported over yet.

As the result, the new rules_android 0.7.1 Starlark-based pipeline now constructs resource paths as relative Bazel execution paths (e.g. bazel-out/arm64-fastbuild/bin/.../res), where the old native rules passed them as absolute paths. AGP 8.x's databinding library validates that these paths as absolute, which causes the error.

We patched the AndroidResourceProcessor.java to call .getAbsoluteFile() before passing the resource path to the databinding processor. This solved the relative Bazel execution path against the JVM's working directory (the execroot), producing a real absolute path that satisfies the validation.

@edwin-grabtaxi edwin-grabtaxi merged commit 2bccbfc into migration/bazel_8_main_branch Feb 21, 2026
0 of 3 checks passed
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.

2 participants