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

rules_jvm_external is failing with Bazel@HEAD #931

Closed
sgowroji opened this issue Jul 14, 2023 · 9 comments
Closed

rules_jvm_external is failing with Bazel@HEAD #931

sgowroji opened this issue Jul 14, 2023 · 9 comments

Comments

@sgowroji
Copy link

https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/3165#01895294-907c-4278-ba53-0049bc4ea142
Platform : Ubuntu, MacOs, Windows

Logs:

ERROR: /Users/buildkite/builds/bk-imacpro-6/bazel-downstream-projects/rules_jvm_external/tests/integration/kt_jvm_export/BUILD:3:14: in maven_project_jar rule //tests/integration/kt_jvm_export:test-project:
Traceback (most recent call last):
	File "/Users/buildkite/builds/bk-imacpro-6/bazel-downstream-projects/rules_jvm_external/private/rules/maven_project_jar.bzl", line 99, column 32, in _maven_project_jar_impl
		ijar = java_common.run_ijar(
	File "/virtual_builtins_bzl/common/java/java_common.bzl", line 86, column 68, in _run_ijar
Error in _check_java_toolchain_is_declared_on_rule: Rule 'maven_project_jar' in '/Users/buildkite/builds/bk-imacpro-6/bazel-downstream-projects/rules_jvm_external/tests/integration/kt_jvm_export/BUILD:3:14' must declare '@bazel_tools//tools/jdk:toolchain_type' toolchain in order to use java_common.
ERROR: /Users/buildkite/builds/bk-imacpro-6/bazel-downstream-projects/rules_jvm_external/tests/integration/kt_jvm_export/BUILD:3:14: Analysis of target '//tests/integration/kt_jvm_export:test-project' failed
ERROR: Analysis of target '//tests/integration/kt_jvm_export:test.publish' failed; build aborted: Analysis failed

Steps :

git clone https://github.com/bazelbuild/rules_jvm_external.git
git reset 39dcd72d72769acee2f02b869843259683f346c3 --hard
export USE_BAZEL_VERSION=53914865fc26850a1f282a83f3846c6103af217e
 shell_commands:
      - bazel run @unpinned_regression_testing//:pin
      - bazel run @unpinned_maven_install_in_custom_location//:pin
      - tests/bazel_run_tests.sh

Culprit bazelbuild/bazel@403564a

CC Greenteam @SalmaSamy

@fmeum
Copy link
Member

fmeum commented Jul 18, 2023

Pretty sure the real culprit is bazelbuild/bazel@d0e2958. This is a breaking change for Bazel.

CC @kotlaja @hvadehra

@meteorcloudy
Copy link
Contributor

I guess this should be fixed by some change like bazelbuild/rules_scala#1505?

@fmeum
Copy link
Member

fmeum commented Jul 18, 2023

Fixing this forward looks reasonable to me and the same kind of change should fix this for rules_jvm_external.

This should be prominently listed as an incompatible change in Bazel 7 though.

@meteorcloudy
Copy link
Contributor

meteorcloudy commented Jul 18, 2023

@kotlaja I think we should try to follow https://bazel.build/release/backward-compatibility to guard this breaking change behind a flag (--incompatible_*).

@kotlaja
Copy link
Contributor

kotlaja commented Jul 18, 2023

I've added a github issue: bazelbuild/bazel#18970 and I would argue that we don't need an incompatible change because:

  1. This is a temporary failure since it's just a preparation for the Automatic Exec Groups. Once AEGs are enabled, they will have similar error regarding this and AEGs already have their own incompatible flag. In other words, adding one more incompatible flag which will be soon deleted seems unnecessary.
  2. The fix is super simple and it's rule-related, not target-related.

@kotlaja
Copy link
Contributor

kotlaja commented Jul 18, 2023

I've added a fix inside: #933, please have a look.

@fmeum
Copy link
Member

fmeum commented Jul 18, 2023

Thanks for sending the fix!

  1. The fix is super simple and it's rule-related, not target-related.

From the perspective of a Bazel user, rule-related breakages are typically more difficult to fix than target-related breakages since rulesets live in external repos and are third-party dependencies.

@fmeum
Copy link
Member

fmeum commented Aug 24, 2023

Fixed by #933

@sgowroji
Copy link
Author

Thanks @fmeum. We can close this issue.

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

No branches or pull requests

4 participants