backport the whole scripting plugin from Kotlin 1.3.50 into our
FrankenKotlin and see how it goes
incorrectly generated code in Kotlin plugins
* Exception is:
java.lang.AssertionError: Undefined parameter referenced: class Settings::this
owner=class Settings_gradle; [class Settings_gradle::this]
at org.jetbrains.kotlin.ir.util.SymbolTable.referenceValueParameter(SymbolTable.kt:420)
at org.jetbrains.kotlin.psi2ir.generators.ArgumentsGenerationUtilsKt$generateReceiver$$inlined$generateDelegatedValue$1$1.invoke(OnceExpressionValue.kt:63)
at org.jetbrains.kotlin.psi2ir.generators.ArgumentsGenerationUtilsKt$generateReceiver$$inlined$generateDelegatedValue$1$1.invoke(OnceExpressionValue.kt:32)
at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
Good evening,
The FrankenKotlin experiment is now over, and it failed.
This wasn't as bad as it looked like actually: it was caused by the
Kotlin compiler using the default JDK (21) as its target for API compatibility, so while the bytecode was compatible with Java 8 it used
some API calls that were introduced in later JDKs instead of
reimplementing them as inline code. Using the JDK 11 again solved that
for the purpose of using that compiler for building Gradle.
This outcome is a bit frustrating but it was the most likely one, and I learned a few valuable things in the process.
My plan is now to update the Kotlin package to 2.0.21 (renaming it
kotlin2.0) and use it to build Gradle 8. I'm not sure that both package
(and dependencies) will be in a releasable shape in time for Trixie, but
if they miss the deadline they can still be made available later through backports.
Did you consider rebuilding the packages with Java 8 since we still
have openjdk-8 in sid? We may even clone the gradle package to make a
Java 8 compatible version if that helps. Same thing with kotlin.
The simple fact you didn't end in the local hospital after banging your
head on the wall for so long is quite an achievement!
update the Kotlin package to 2.0.21 (renaming it kotlin2.0)
in time for Trixie
some classes normally compiled from generated Kotlin sources were
missing
Expect to see a few new branches including `kotlin2-wip` on my fork of
the package repository fairly soon.
I was hoping to be done sooner with this but then some COVID replica hit
me which did no good to my productivity.
A not too pleasant surprise was to discover that the upstream project
decided to use LFS to store a few JPEG images used in the documentation (which is way overkill). Fortunately this is supported by Salsa and
uscan, but it slows down significantly some remote operations. These
images only appeared in 2.1.0 so the 2.0.21 branch should not be impacted.
A not too pleasant surprise was to discover that the upstream project
decided to use LFS to store a few JPEG images used in the
documentation (which is way overkill). Fortunately this is supported
by Salsa and uscan, but it slows down significantly some remote
operations. These images only appeared in 2.1.0 so the 2.0.21 branch
should not be impacted.
I think you can safely skip the documentation stuff and filter out the
JPEG images.
start combing through the dependencies
BSP in Wien
I'm going to take advantage of the DDs on site to upload fixes
I have to figure out why it fails to resolve
Done! Could you please update the Salsa repo with your changes?
as I think I'm more than halfway done on that front.
the configuration progress bar only reaches a meager 13%
getting the "zipCompiler" task to actually start building things
despite my custom dependency rewriting logic (that is not even executed
in this case)
an interesting `resolveDependencies` task
review the list of dependencies
A significant difference with the current Kotlin package is that I'm
planning to remove (if possible) all embedded copies of libraries. This
will require to patch some of them that were forked by JetBrains to fix
or add features.
On 07/06/2025 19:14, Julien Plissonneau Duquène wrote:
A significant difference with the current Kotlin package is that I'm
planning to remove (if possible) all embedded copies of libraries.
This will require to patch some of them that were forked by JetBrains
to fix or add features.
I'm not sure this is a good idea, because it diverges from upstream, increases the maintenance burden, and could potentially break kotlin if
such a dependency gets broken and can no longer compile (due to kotlin
being broken). For kotlin I'd recommend keeping it simple and sticking
to the upstream layout as much as possible. Saving a few kilobytes
isn't important here.
Hoping to do better next week!
take care under these heat domes,
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 06:10:15 |
Calls: | 10,386 |
Calls today: | 1 |
Files: | 14,058 |
Messages: | 6,416,633 |