Bazel 8 migration - Patch Databinding Resource Processor#205
Merged
edwin-grabtaxi merged 1 commit intomigration/bazel_8_main_branchfrom Feb 21, 2026
Merged
Conversation
arunsampathkumar-grabtaxi
approved these changes
Feb 20, 2026
2bccbfc
into
migration/bazel_8_main_branch
0 of 3 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After migrating to Bazel 8, we received an error like this:
java.lang.IllegalStateException: bazel-out/arm64-fastbuild/bin/.../res is not an absolute pathIn Bazel 7, the GenerateDataBindingBaseClasses action used
Workerspawn 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.