Skip to content

Commit

Permalink
bazelrc: set java_runtime_version for builds too (#5836)
Browse files Browse the repository at this point in the history
Otherwse, if the default Java version on the host is "lower" (in my
case, 11), the following happens:

```
$ bazel build //base:integration_tests --define=ij_product=intellij-2023.3
ERROR: /home/motiejus/code/intellij/base/BUILD:535:32: Building base/integration_tests.jar (72 source files) failed: (Exit 1): java failed: error executing Javac command (from target //base:integration_tests) external/remotejdk17_linux/bin/java '--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED' '--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED' ... (remaining 19 arguments skipped)
base/tests/integrationtests/com/google/idea/blaze/base/lang/buildfile/search/GlobalWordIndexTest.java:81: warning: [removal] SERVICE in CacheManager has been deprecated and marked for removal
          CacheManager.SERVICE
                      ^
base/tests/integrationtests/com/google/idea/blaze/base/lang/buildfile/references/BuildReferenceManagerTest.java:47: error: cannot find symbol
            .toList();
            ^
  symbol:   method toList()
  location: interface Stream<String>
base/tests/integrationtests/com/google/idea/blaze/base/lang/buildfile/references/BuildReferenceManagerTest.java:68: error: cannot find symbol
            .toList();
            ^
  symbol:   method toList()
  location: interface Stream<String>
Use --verbose_failures to see the command lines of failed build steps.
```

However, `bazel test` with the same arguments succeeds.

The current behaviour is "technically" correct, but is a confusing: we
should be able to build our tests, not only run them.

Fixes #5835
  • Loading branch information
motiejus-wix authored Dec 19, 2023
1 parent dcd8152 commit 38e355a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
build --java_language_version=17
test --java_language_version=17 --java_runtime_version=17
build --java_language_version=17 --java_runtime_version=17

# delete testdata package needed for bazel integration tests
build --deleted_packages=//aspect/testing/tests/src/com/google/idea/blaze/aspect/integration/testdata
Expand Down

0 comments on commit 38e355a

Please sign in to comment.