kotlin2 in Debian -- 2025W22 update
- To: debian-java@lists.debian.org
- Subject: kotlin2 in Debian -- 2025W22 update
- From: Julien Plissonneau Duquène <sre4ever@free.fr>
- Date: Fri, 30 May 2025 20:44:52 +0200
- Message-id: <[🔎] a8d2bf91eea2a1a37a09a7abf0119ef2@free.fr>
- In-reply-to: <[🔎] ccd77a2e7c35c5685c2ab3c3edf7b093@free.fr>
- References: <c447006d-7f97-72ec-1980-2425466a196b@free.fr> <Zyjt3RNsLhKA91au@laptop-t.office.oeko.net> <c36c79556d74aaccbc6608f8ba99efae@free.fr> <5284bacb294ba1ff08f32a5a0b175dd4@free.fr> <b71605fcbe384879c0238f9413c23735@free.fr> <8497785db64c2691266dc8269486d7c2@free.fr> <2ec4a44b89889611d1dfa2ee19129e86@free.fr> <6f53f62c9f3bff92fa66c714d62da6d1@free.fr> <c766c257fb3305889b628c769373b766@free.fr> <965acdffa651fe10e90e6f26728e4af7@free.fr> <edc8e50ba3b2ae1f219f1180512870b7@free.fr> <b9acefda-d2fb-4f4e-99b1-1ea9753e3028@at.or.at> <2e2ac5f7efc8ae401863382517249ce9@free.fr> <fd7bed1065756d6755c922929c201585@free.fr> <7e2a9e1b7fda03ad83d664582fb89c8d@free.fr> <ce6d7fbffa95bc534b1fc569e4471cab@free.fr> <5650baeeec5223dfb5affa4aa42f1b56@free.fr> <fab2fe12-991d-4fd3-a17f-28483bae3cf9@debian.org> <7053663db379b063042e99eb31bdadcd@free.fr> <80615ea609e5fab28e354a494d83e59d@free.fr> <572b182be1c0f0e013ce95cbf563f223@free.fr> <ac7cff49d09a4ee5e48254d7aabcbc00@free.fr> <7a6e787cb9984825628a1a365ac6e8a3@free.fr> <c0add46a68772eb1de3e916d23ca6f86@free.fr> <07f185f4d07c5acd3e458b01e354be41@free.fr> <3ebae8b9869459ef719d6366190fa5f0@free.fr> <e7d2987d54f803a4ae8bb889e0a13ac1@free.fr> <[🔎] c88ba99ac7ce198a5368270f80ea65de@free.fr> <[🔎] e84f052b22a3d8ee3703f17480a09f28@free.fr> <[🔎] 3570bd5d462de5034469dccd60a9130b@free.fr> <[🔎] ccd77a2e7c35c5685c2ab3c3edf7b093@free.fr>
Good evening,
This week was mostly spent debugging. Fortunately I could finally figure
out what the issue was with transitive dependencies.
Le 2025-05-23 20:04, Julien Plissonneau Duquène a écrit :
despite my custom dependency rewriting logic (that is not even executed
in this case)
It was in fact "because of", not "despite". Part of that logic works by
creating new dependencies and remove existing ones, as in some places
the gradle documented API doesn't offer a way to replace group and
artifact names. There were several defects in that logic that are now
fixed:
- I use null as a return value that means "do not rewrite replace the
dependency" (because it's actually the same, or some other issue
happened). But I also implemented a cache that doesn't allow the storage
of null values, and at some point forgot to implement the null value
thing when the value was obtained from the cache. As a result, the
dependency would still be replaced, but only starting from the second
call to the function. This made finding the root cause a bit more
challenging ^ ^
- the replacement dependency did not retain all the properties of the
initial target, and among these transitivity and exclusion rules. They
were not needed in gradle's build, and DependencyHandler.create()
returns an object of the Dependency type, which is actually an interface
that doesn't expose these properties, so I didn't go further at that
time. This is what caused the issue: the dependency was properly
declared as being non-transitive in build scripts, but the custom plugin
replaced it with the same dependency, without setting the replacement as
non-transitive.
- while I was at it I investigated a previous issue I had with equals()
between Dependency objects, and found that it's probably a bug in
Gradle's implementation.
I also discovered that there is an interesting `resolveDependencies`
task implemented in Kotlin build scripts. It has some issues, but it
will help with mapping the full dependency set.
After shedding some more Android dependencies the build now fails a bit
closer to the point where Gradle would start actually building the
project, but it's still not there yet.
Cheers,
--
Julien Plissonneau Duquène
Reply to: