Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Bazel incompatible changes #239

Closed
laurentlb opened this issue Jan 8, 2019 · 14 comments · Fixed by #274
Closed

Fix Bazel incompatible changes #239

laurentlb opened this issue Jan 8, 2019 · 14 comments · Fixed by #274
Assignees

Comments

@laurentlb
Copy link

This repository isn't compatible with Bazel with the flag --all_incompatible_changes.

e.g. it fails with --incompatible_no_transitive_loads (https://buildkite.com/bazel/bazel-at-release-plus-incompatible-flags/builds/56#48b4d6c0-6ef6-4a1a-858c-7a68229fc715):

ERROR: /var/lib/buildkite-agent/.cache/bazel/_bazel_buildkite-agent/cc704b3d6f5c2a733329351f1fd5d404/external/android_test_support/tools/android/emulated_devices/macro/make_device.bzl:29:1: file '//tools/android/emulated_devices:macro/emulator_info.bzl' does not contain symbol 'emulator_is_qemu2'

Fixing the issues will ensure the code remains compatible with the future changes in Bazel. Let me know if you need any help.

cc @jin

@jin
Copy link
Collaborator

jin commented Jan 8, 2019

This is blocked on android-test (https://github.com/android/android-test) pushing out the patch to fix the IC.

Internal context: cl/226047055

@jin jin self-assigned this Jan 17, 2019
@jin
Copy link
Collaborator

jin commented Jan 17, 2019

android-test is unblocked, but I discovered more issues.

Also two blockers that require a new Protobuf release:

bazelbuild/bazel#5825 (comment)
bazelbuild/bazel#5818 (comment)

copybara-androidxtest pushed a commit to android/android-test that referenced this issue Jan 17, 2019
…mpatible changes around Starlark APIs

Work towards android/testing-samples#239

PiperOrigin-RevId: 229790580
copybara-androidxtest pushed a commit to android/android-test that referenced this issue Jan 17, 2019
…mpatible changes around Starlark APIs

Work towards android/testing-samples#239

PiperOrigin-RevId: 229790580
copybara-androidxtest pushed a commit to android/android-test that referenced this issue Jan 17, 2019
…mpatible changes around Starlark APIs

Work towards android/testing-samples#239

PiperOrigin-RevId: 229790580
copybara-androidxtest pushed a commit to android/android-test that referenced this issue Jan 18, 2019
…mpatible changes around Starlark APIs

Work towards android/testing-samples#239

PiperOrigin-RevId: 229790580
copybara-androidxtest pushed a commit to android/android-test that referenced this issue Jan 18, 2019
…mpatible changes around Starlark APIs

Work towards android/testing-samples#239

PiperOrigin-RevId: 229838054
@laurentlb
Copy link
Author

I still see failures with:

  • --incompatible_new_actions_api
  • --incompatible_no_transitive_loads
  • --incompatible_disable_deprecated_attr_params

@jin
Copy link
Collaborator

jin commented Feb 7, 2019

Looks like there's a new Protobuf release 3.7.0, let me test it out..

@jin
Copy link
Collaborator

jin commented Feb 7, 2019

android-testing itself is fine -- the incompatible changes come from android/android-test and its deps.

Tried to bump android-test's protobuf version to 3.7.0-rc2, but failed: protocolbuffers/protobuf#5696

We also need to bump its usage of rules_kotlin to a commit later than https://github.com/bazelbuild/rules_kotlin/tree/cab5eaffc2012dfe46260c03d6419c0d2fa10be0

@laurentlb
Copy link
Author

Is it possible to fix at least --incompatible_no_transitive_loads?
(Protobuf issue is affecting lots of rules, thanks for filing the bug)

@jin
Copy link
Collaborator

jin commented Feb 20, 2019

Thanks for the ping! This dropped off my radar. #246

@laurentlb
Copy link
Author

@jin Can you try to update to Protobuf 3.7.1?

@jin
Copy link
Collaborator

jin commented Apr 17, 2019

So this is turning out to be more complicated than expected. Protobuf 3.7.1 introduces a dependency on a bind //external:zlib target, which is switched to a regular external repository in protocolbuffers/protobuf@f313b9c, which is not in 3.7.1 yet. I'll bump it to use Protobuf HEAD for today.

@jin
Copy link
Collaborator

jin commented Apr 17, 2019

ERROR: /usr/local/google/home/jingwen/.cache/bazel/_bazel_jingwen/c0b8e7c3fe9b878a4633a5ff9d0fc340/external/com_google_protobuf_javalite/protobuf.bzl:127:19: Traceback (most recent call last):
	File "/usr/local/google/home/jingwen/.cache/bazel/_bazel_jingwen/c0b8e7c3fe9b878a4633a5ff9d0fc340/external/com_google_protobuf_javalite/protobuf.bzl", line 122
		rule(attrs = {"srcs": attr.label_list...()}, <2 more arguments>)
	File "/usr/local/google/home/jingwen/.cache/bazel/_bazel_jingwen/c0b8e7c3fe9b878a4633a5ff9d0fc340/external/com_google_protobuf_javalite/protobuf.bzl", line 127, in rule
		attr.label(cfg = "host", executable = True, sin..., ...)
'single_file' is no longer supported. use allow_single_file instead. You can use --incompatible_disable_deprecated_attr_params=false to temporarily disable this check.
ERROR: /usr/local/google/home/jingwen/code/android-test/espresso/web/java/androidx/test/espresso/web/model/BUILD.bazel:13:1: error loading package '@com_google_protobuf_javalite//': Extension file 'protobuf.bzl' has errors and referenced by '//espresso/web/java/androidx/test/espresso/web/model:model'
ERROR: Analysis of target '//:axt_m2repository' failed; build aborted: error loading package '@com_google_protobuf_javalite//': Extension file 'protobuf.bzl' has errors

The javalite branch for protobuf hasn't been updated. https://github.com/protocolbuffers/protobuf/tree/javalite

@jin
Copy link
Collaborator

jin commented Apr 17, 2019

Blocked on protocolbuffers/protobuf#6048

Once that's in, we need to bump the version and sha256 of javalite.zip in android/android-test#304, and merge that in.

Once that's done, we can then update this repository to use the new android-test release.

@laurentlb
Copy link
Author

If it helps, rules_closure was updated: https://github.com/bazelbuild/rules_closure/pull/344/files

@jin
Copy link
Collaborator

jin commented Apr 18, 2019

That's the main protobuf version. android-test (and transitively this project) has a dependency on protobuf's javalite rules which is released separately from 3.7.1, and the javalite branch hasn't been updated with the incompatible changes.

@laurentlb
Copy link
Author

Any update?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants