[
https://issues.apache.org/jira/browse/CALCITE-5005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17489777#comment-17489777
]
Julian Hyde commented on CALCITE-5005:
--------------------------------------
On MacOS, after switching from your PR branch to another branch (where the
files had line endings consistent with .gitattributes), the errors persisted.
This indicated that there is some unwanted 'state' in the system. I then killed
all Gradle daemons and the problem went away.
Therefore my hypothesis is that this problem is not due to {{.gitattributes}}
being wrong, or due to {{.kt}} and {{.kts}} files having the wrong line
endings, but due to caching in Gradle. If so, the remedy is to kill all Gradle
daemons on your system.
> Calcite fails to build on Linux due to style check because Kotlin files use
> CR-LF line-endings
> ----------------------------------------------------------------------------------------------
>
> Key: CALCITE-5005
> URL: https://issues.apache.org/jira/browse/CALCITE-5005
> Project: Calcite
> Issue Type: Bug
> Components: build
> Reporter: Gavin Ray
> Priority: Major
> Time Spent: 10m
>
> Every `.kt` file fails with the following error due to the `autoStyleKotlin`
> check.
> {noformat}
> > Task :buildSrc:autostyleKotlinGradleCheck FAILED
> > Task :buildSrc:buildext:autostyleKotlinCheck FAILED
> > Task :buildSrc:fmpp:autostyleKotlinCheck FAILED
> > Task :buildSrc:javacc:autostyleKotlinCheck FAILED
> FAILURE: Build completed with 4 failures.
> Task failed with an exception.
> -----------
> * What went wrong:
> Execution failed for task ':buildSrc:buildext:autostyleKotlinCheck'.
> > The following files have format violations:
>
> subprojects/buildext/src/main/kotlin/org/apache/calcite/buildtools/buildext/BuildExtPlugin.kt
> @@ -1,27 +1,27 @@
> -/*␍␊
> -·*·Licensed·to·the·Apache·Software·Foundation·(ASF)·under·one·or·more␍␊
>
> -·*·contributor·license·agreements.··See·the·NOTICE·file·distributed·with␍␊
>
> -·*·this·work·for·additional·information·regarding·copyright·ownership.␍␊
>
> -·*·The·ASF·licenses·this·file·to·You·under·the·Apache·License,·Version·2.0␍␊
>
> -·*·(the·"License");·you·may·not·use·this·file·except·in·compliance·with␍␊
> -·*·the·License.··You·may·obtain·a·copy·of·the·License·at␍␊
> -·*␍␊
> -·*···http://www.apache.org/licenses/LICENSE-2.0␍␊
> -·*␍␊
>
> -·*·Unless·required·by·applicable·law·or·agreed·to·in·writing,·software␍␊
> -·*·distributed·under·the·License·is·distributed·on·an·"AS·IS"·BASIS,␍␊
>
> -·*·WITHOUT·WARRANTIES·OR·CONDITIONS·OF·ANY·KIND,·either·express·or·implied.␍␊
>
> -·*·See·the·License·for·the·specific·language·governing·permissions·and␍␊
> -·*·limitations·under·the·License.␍␊
> -·*␍␊
> -·*/␍␊
> -␍␊
> -package·org.apache.calcite.buildtools.buildext␍␊
> -␍␊
> -import·org.gradle.api.Plugin␍␊
> -import·org.gradle.api.Project␍␊
> -␍␊
> -class·BuildExtPlugin·:·Plugin<Project>·{␍␊
> -····override·fun·apply(target:·Project)·{␍␊
> -····}␍␊
> -}␍␊
> +/*␊
> +·*·Licensed·to·the·Apache·Software·Foundation·(ASF)·under·one·or·more␊
>
> +·*·contributor·license·agreements.··See·the·NOTICE·file·distributed·with␊
> +·*·this·work·for·additional·information·regarding·copyright·ownership.␊
>
> +·*·The·ASF·licenses·this·file·to·You·under·the·Apache·License,·Version·2.0␊
>
> +·*·(the·"License");·you·may·not·use·this·file·except·in·compliance·with␊
> +·*·the·License.··You·may·obtain·a·copy·of·the·License·at␊
> +·*␊
> +·*···http://www.apache.org/licenses/LICENSE-2.0␊
> +·*␊
> +·*·Unless·required·by·applicable·law·or·agreed·to·in·writing,·software␊
> +·*·distributed·under·the·License·is·distributed·on·an·"AS·IS"·BASIS,␊
>
> +·*·WITHOUT·WARRANTIES·OR·CONDITIONS·OF·ANY·KIND,·either·express·or·implied.␊
> +·*·See·the·License·for·the·specific·language·governing·permissions·and␊
> +·*·limitations·under·the·License.␊
> +·*␊
> +·*/␊
> +␊
> +package·org.apache.calcite.buildtools.buildext␊
> +␊
> +import·org.gradle.api.Plugin␊
> ... (6 more lines that didn't fit)
> Violations also present in:
>
> subprojects/buildext/src/main/kotlin/org/apache/calcite/buildtools/buildext/dsl/ParenthesisBalancer.kt
> Run './gradlew autostyleApply' to fix the violations.
> {noformat}
> The fix to this is to modify the {{.gitattributes}} file to set {{eol=clrf}}
> to {{\*.kt}} and {{\*.kts}}. See attached PR.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)