salesforce / salesforce/rules_spring
Bazel 9.0.0 build issue: rules_spring+/springboot/springboot.bzl:41:43: name 'JavaInfo' is not defined
Nobody has claimed this yet.
- Dominant language
- Starlark
- Stars
- 257
- Forks
- 58
- PR merge metrics
- No merged PRs in 30d
Description
With the upgrade to Bazel 9.0.0, projects using rules_spring previously failed during analysis due to missing Java symbols in .bzl files, most notably in springboot.bzl.
Specifically, building a project that uses the springboot rule would produce the following error:
springboot.bzl:41:43: name 'JavaInfo' is not defined
This was caused by changes in Bazel 9 / Bzlmod where library-specific Starlark symbols are no longer implicitly available and must be explicitly provided via module dependencies. In this case, JavaInfo and other Java symbols were not available unless rules_java was declared as a dependency of rules_spring.
This has now been resolved in PR #282 by:
- Adding
rules_javato theMODULE.bazelofrules_springso that Java toolchains and symbols are available project-wide. - Updating
.bzlfiles (includingspringboot.bzl) to explicitly load the required symbols, for example:
load("@rules_java//java:defs.bzl", "java_binary", "JavaInfo")
java_binary is included where needed because it is also referenced in the same rule files.
Expected behavior: projects using rules_spring now build successfully under Bazel 9 without requiring downstream users to manually add rules_java or patch .bzl files.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review PR #282 alongside MODULE.bazel and the .bzl files mentioned in the issue, especially springboot/springboot.bzl. Start by reproducing the analysis failure with Bazel 9.0.0, then verify that the updated dependency and explicit symbol loads allow a project using the springboot rule to build without downstream rules_java changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 20/100