Tools use the root's protobuf_java, which can be too old for aapt2-proto

Offen
#602 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 6 Tagen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
42/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
java
Bereich
build-system

Rechercherichtung

Start in src/tools/java/com/google/devtools/build/android/BUILD and find the ResourceProcessorBusyBox target plus the two others that depend on @com_google_protobuf//:protobuf_java. Check how the aapt2-proto classes from @rules_android_maven get their GeneratedMessageV3 dependency. Done means those deps point at @rules_android_maven//:com_google_protobuf_protobuf_java and the tools build and run. The maintainer has not yet confirmed this change, so check with them before opening a PR.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

In src/tools/java/com/google/devtools/build/android/BUILD, ResourceProcessorBusyBox and two other targets depend on @com_google_protobuf//:protobuf_java, i.e. whatever protobuf the root module picks. The prebuilt aapt2-proto classes from @rules_android_maven need GeneratedMessageV3, so a root on an older protobuf (4.27) gets a protobuf-java without it and the tools fail at runtime.

Pointing those deps at @rules_android_maven//:com_google_protobuf_protobuf_java (already resolved, 4.28.2) fixes it for us. Same on main and 0.7.3.

Would you take a PR making that the default? Not sure if anything compiled against @com_google_protobuf in the tools would then mismatch, so asking first.

Vorherrschende Sprache
Java
Sterne
205
Forks
113
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus bazelbuild/rules_android

Alle Issues in bazelbuild/rules_android

Ähnliche Issues

Weitere Issues zu Java

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.