Add Android 17 (build-tools 37.0.0) support#1
Merged
Conversation
Android 17's bundled protobuf makes parse_context.h (a public header reached from every generated *.pb.h) include "utf8_validity.h", which lives in protobuf's vendored utf8_range copy rather than under src/. libaapt2 hand-compiles the generated .pb.cc files without linking protobuf, so it doesn't inherit protobuf's include dirs — same propagation gap already worked around for abseil just above. Add the utf8_range source dir directly. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Android 17 reworked android::Asset to back its buffer with using Data = std::variant<base::MappedFile, ...>; but Asset.h doesn't include <variant>. AOSP's bionic/libc++ build pulls it in transitively; under glibc + libstdc++ 12 it doesn't, so the header fails with "'variant' in namespace 'std' does not name a template type", cascading into every TU that includes Asset.h (libandroidfw, libaapt, aapt2's SymbolTable). Add the missing include. Verified: full linux-arm64 build of aapt2/aidl/zipalign/split-select goes green against android-17.0.0_r1 and the binaries run on arm64. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Android 17 adds a new content-res feature flag that AssetsProvider.cpp references (xml_file_size_limit()). Our aconfig stub didn't define it, so the build failed with "not declared in this scope". Force-disabled like every other flag in the stub, keeping the legacy code path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
AOSP has now tagged android-17.0.0_r1 and a full linux-arm64 build of all four tools succeeds against it (verified on arm64 hardware + CI), so promote the (37,0,0) resolution from the heuristic to an explicit, verified KNOWN_MAPPINGS entry. Drop the stale note claiming android-17 isn't tagged yet, and the docstring's now-wrong "37.0.0 is no-source" example. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A patch can carry an `# Optional: true` header, meaning it's expected to apply only to some source revisions. When such a patch doesn't apply, fetch_sources now skips it quietly instead of printing the "STALE / refresh the patch" warning meant for genuinely-broken patches. Mark protobuf-include-config.patch Optional: it fixes a missing config.h include path that only exists through protobuf ~25.x (Android 16). Android 17 ships protobuf 33.5.0, which dropped the generated config.h / config dir entirely, so the patch correctly no longer applies and was noisily flagged STALE on every 17 build. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
Gets the
upstream-watchpipeline building the linux-arm64 build-tools against Android 17 (android-17.0.0_r1, sdkmanagerbuild-tools;37.0.0). The nightly watcher already detected 37.0.0 but the build failed on three Android-17 source changes; this gets it green.Build fixes
Android 17 bumped protobuf to 33.5.0 and reworked some androidfw internals. With ninja
-k 0surfacing everything in one pass, three root causes:983cf1fprotobuf utf8_range include — protobuf 33.5.0'sparse_context.h(reached from every generated*.pb.h) includesutf8_validity.h, which lives in protobuf's vendoredthird_party/utf8_range/.libaapt2hand-compiles the.pb.ccfiles without linking protobuf, so it needs that dir on its include path explicitly — same pattern as the existing abseil workaround just above it.eb730ebandroidfw<variant>include — Android 17 madeandroid::Assetback its buffer with astd::variant, butAsset.hnever#include <variant>. bionic/libc++ pulls it in transitively; glibc + libstdc++ 12 doesn't, so the header fails and cascades into libandroidfw/libaapt/aapt2. New patch.e44d59dnew aconfig flag —AssetsProvider.cppreferencesandroid_content_res_xml_file_size_limit(), a new content-res flag absent from our aconfig stub. Force-disabled like the rest, keeping the legacy path.Plumbing
0421d29version mapping — promote build-tools 37.0.0 →android-17.0.0_r1from the heuristic to a verifiedKNOWN_MAPPINGSentry; drop the now-false "android-17 isn't tagged yet" note + docstring example.75654a7optional patches — protobuf 33.5.0 dropped theconfig/dir, soprotobuf-include-config.patch(needed only through ~25.x / Android 16) no longer applies and was noisily flaggedSTALEon every 17 build. Add an# Optional:patch header so expected-not-applicable patches skip quietly, and mark that patch optional. Android 16 still gets it applied normally.Validation
docker/linux-arm64.Dockerfile): full build of all four tools green; each is a valid aarch64 glibc ELF and runs (aapt2 version,aidl --help,zipalign,split-select --help).detect+buildgreen (26m), artifactlinux-arm64-platform-tools-37.0.0uploaded,releasecorrectly skipped. Build validated ate44d59d; commits 4–5 are detection/log-only and were validated locally (resolver unit call) and on the Pi (apply_patchesrun). A fresh dry-run on the branch HEAD is running as the final check.Once merged, the nightly
upstream-watchwill build & publishplatform-tools-37.0.0(linux-arm64) automatically.🤖 Generated with Claude Code