Hmm... My local K/N build fails consistently when ...
# kotlin-native
s
Hmm... My local K/N build fails consistently when using Gradle 6.4.1, but not when using the Gradle wrapper. Should I file an issue? (I'm building K/N itself)
This happens with both 1.3.72 and 1.4.0-M2 in my testing, and it fails on a line of Kotlin code in
dependencies:update
.
g
dependencies:update?
What is version of the wrapper?
s
The wrapper version is 6.0.1 iirc, the package version is 6.4.1
g
I would anyway always recommend to use wrapper (any version which works for you)
but looks that you have issue with Gradle 6.4.1, what kind error you have with 6.4.1?
s
This is for a Linux distribution, in which the download time and bandwidth required for the wrapper on every single build (due to sandboxing) actually matters
And again, this is for building Kotlin/Native itself, not a project that uses it
g
ah, i see, so in this case you definitely should use wrapper
k/n is a huge project with a lot of custom build logic and it’s definitely good idea to use exactly the same version of build tools as developers of K/N
otherwise you will get any kind build issues, like you experienced
ownload time and bandwidth required for the wrapper on every single build (due to sandboxing) actually matters
It’s better to cache wrapper and and other caches (such as dependencies) to avoid it, instead of using hardcoded gradle version
s
If I can use Gradle itself and not a wrapper, I'd much rather do that. Regardless, let me share the error, because it's a lot weirder than I'd expect from using a different Gradle version
g
I got it, dependencies:update is custom task of Kotlin project
s
Yeah,
dependencies
is the subproject and
update
is the task
g
so apparently it’s not tested and doesn’t work with 6.4.1, I would just keep using version which is used for project by default
Or you may of course try to fix it and send PR to update Gradle on Kotlin repo but it probably not so simple task
s
e: /home/build/YPKG/root/kotlin-native/build/kotlin-native-1.3.72/build-tools/src/main/kotlin/org/jetbrains/kotlin/benchmark/CompileBenchmarkingPlugin.kt: (73, 57): Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type ExecResult?
This is a Kotlin compiler error, and not just that, it's a JVM one
g
Custom Gradle plugin is broken, probably because some Gradle API markes as non-nullable
you have to fix it
This is a Kotlin compiler error, and not just that, it’s a JVM one
Yes, this Kotlin compiler error in custom Gradle plugin
s
Oh, if that's what it is then I can patch it. Thanks
g
this Gradle plugin just not compatible with never Gradle versions, probably because some Gradle API marked as nullable
You can, but I don’t understand why would you do this, you may get any amount of other strange errors or just bugs if you do that
If you goal is not update Gradle version on upstream Kotlin and Kotlin Native repos, I wouldn’t do this
s
Actually, that's literally the one thing required to make K/N compatible with the current version of Gradle
Gradle doesn't generally have breaking changes, and if it does, I can patch them. This isn't as big of a deal as you seem to think
Regardless, it's fixed, so thank you for the help
g
Gradle doesn’t generally have breaking changes
It’s not completely true, especially for plugin authors