bazelbuild / examples

Examples for Bazel
http://bazel.build
Apache License 2.0
800 stars 497 forks source link

Update jetpack-compose example #455

Open ted-xie opened 1 month ago

ted-xie commented 1 month ago

Fixes https://github.com/bazelbuild/bazel/issues/20970

ted-xie commented 1 month ago

All of the failures in this PR were caused by missing native aar_import in the latest version of Bazel.

alexeagle commented 1 month ago

those failures are blocking other PRs like https://github.com/bazelbuild/examples/pull/453 - @meteorcloudy do you know if anyone is buildcop for this repo?

meteorcloudy commented 1 month ago

Unfortunately, there is no buildcop for this repo, we basically try to identify the owner for specific example code.

However, @sgowroji is helping reporting breakages: https://github.com/bazelbuild/examples/issues/454

This looks like to be caused by some changes at Bazel HEAD. Like https://github.com/bazelbuild/bazel/commit/947c72d699321c97518dbebe0e8ca59621b5da21, @ahumesky can you help fix the example in this repo?

ted-xie commented 1 month ago

The root cause of the problem is that we deleted the native aar_import() rule in Bazel, but rules_jvm_external instantiates a native aar_import rule in all previous versions. In the latest rules_jvm_external release, the problem is fixed after adding 2 new attributes to the maven.install() call that basically tell rules_jvm_external to use the rules_android starlark version of aar_import.

To completely fix, we'll have to update the rules_jvm_external version of every project in bazelbuild/examples, and then add those extra attributes. Or, we'll have to update rules_jvm_external to use the Starlark aar_import by default.

ahumesky commented 1 month ago

We're working on updating the downstream repos

alexeagle commented 1 month ago

Is there a good reason this repo should use Bazel @HEAD? As an example for end-users it would be more appropriate to use the latest LTS as the primary CI. I could imagine you'd still like to see test coverage against the latest Bazel changes, but couldn't you do that with the Bazel+Downstream pipeline rather than introduce instability for maintenance here?

ahumesky commented 1 month ago

The repo here uses last_green for the firebase example (https://github.com/bazelbuild/examples/blob/4679b3915ebdec89b319c4da376b339484c7bf81/.bazelci/android.yml#L5), we could move that to stable(r) version of bazel, but we also the "bazel@HEAD" suite of tests (https://buildkite.com/bazel/bazel-at-head-plus-downstream/)

is also failing so we'll need to fix this for bazel@HEAD anyway

ahumesky commented 1 month ago

This was switched to last_green to update platforms: https://github.com/bazelbuild/examples/commit/5e37d3c0041dc8e4750f6dfbd7508782cdc3c610

I wonder if whatever changes were needed in bazel near head are in 7.x by now