Hello, thank you, Vladimir Sitnikov, for the hint with the javaccGeneratedPatterns in build.gradle.kts. I discovered the cause for the generated files. I forgot that I had activated the option "build and run [tests] using Intellij IDEA". Exclusion rules to be added by CALCITE-4947 <https://issues.apache.org/jira/browse/CALCITE-4947>.
About the failing :linq4j:jandexMain, I've additionally extended the PATH env variable, still the same error. Here my java version: $ PATH="/usr/lib/jvm/java-11-openjdk-amd64/bin/:$PATH" JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64 java -version openjdk version "11.0.13" 2021-10-19 OpenJDK Runtime Environment (build 11.0.13+8-post-Debian-1deb11u1) OpenJDK 64-Bit Server VM (build 11.0.13+8-post-Debian-1deb11u1, mixed mode, sharing) Interestingly, there's no problem when executing the failing task on its own: $ PATH="/usr/lib/jvm/java-11-openjdk-amd64/bin/:$PATH" JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64 ./gradlew :linq4j:jandexMain > Configure project : Building Apache Calcite 1.29.0-SNAPSHOT > Task :linq4j:compileJava Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. BUILD SUCCESSFUL in 13s 32 actionable tasks: 1 executed, 1 from cache, 30 up-to-date S3 cache 762ms wasted on misses, reads: 1, elapsed: 762ms But it fails when executed with other tasks: $ PATH="/usr/lib/jvm/java-11-openjdk-amd64/bin/:$PATH" JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64 ./gradlew build -x test -PenableCheckerframework > Configure project : Building Apache Calcite 1.29.0-SNAPSHOT > Task :linq4j:jandexMain FAILED ... Cordialement / Best Regards, *Thomas Rebele, PhD* | R&D Developer | Germany | www.tibco.com On Thu, Dec 16, 2021 at 5:48 PM Vladimir Sitnikov < [email protected]> wrote: > >First some annoying :core:checkstyleTest that interferes with files > generated by Intellij IDEA, with hundreds of error messages similar to the > following: > > We exclude generated files from the style checks via the following > patterns: > > https://github.com/apache/calcite/blob/a6293a37dd4166e6fe69ae0c5ef7a89e6677b6ab/build.gradle.kts#L259-L276 > > Please add the relevant pattern and file the PR. > However, it is really strange that you get the generated files into > generated/sources/version/generated and javacc/javaCCTest/generated_tests > folders. > I don't understand why IDEA would generate files into those folders. > It does not sound like your ImmutableMyProjectFilterRuleConfig is connected > with javaCCTest. > I would try to understand why do you get files into /javaCCTest/ and > /version/ folders. > > A side note: Kotlin does have the official coding style, so there's a > formatter that yields nice results and that is consistent with IDEs. > So moving to Kotlin makes many Checkstyle rules obsolete. No joking. > > >Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 0 out of bounds > for length 0 > > It is very likely you are using an outdated version of javac which produced > invalid bytecode. > Please upgrade javac (e.g. to the recent patchset). > Note: GitHub CI uses recent patchet updates, so you might fail to reproduce > the issue. > > We do know javac versions 1.8 before u202 are extremely buggy, so we fail > the build for those versions. > It might be time to add the same verification for 11, and require 11.0.5 or > later (in case of 11). > > >Is there an easy way to fix the problem? > > The easy fix is to bump the javac version. > The funny coincidence is that Kotlin solves this issue as well: null safety > is integrated into the regular compilation, > so there's no need for a separate (and time-consuming!) checker framework > compilation. > > Vladimir >
