examples icon indicating copy to clipboard operation
examples copied to clipboard

Update jetpack-compose example

Open ted-xie opened this issue 1 year ago • 8 comments

  • Use a more recent rules_kotlin version (1.9.5)
  • Use a more recent compose compiler version (1.9.22)
  • Add android_ndk_repository dependency

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

ted-xie avatar May 16 '24 22:05 ted-xie

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

ted-xie avatar May 17 '24 14:05 ted-xie

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?

alexeagle avatar May 21 '24 14:05 alexeagle

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?

meteorcloudy avatar May 21 '24 15:05 meteorcloudy

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.

ted-xie avatar May 21 '24 15:05 ted-xie

We're working on updating the downstream repos

ahumesky avatar May 21 '24 16:05 ahumesky

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?

alexeagle avatar May 21 '24 17:05 alexeagle

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 avatar May 21 '24 20:05 ahumesky

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

ahumesky avatar May 21 '24 20:05 ahumesky