kotlin2 in Debian -- 2025W19 update

Julien Plissonneau Duquène <[email protected]> Fri, 09 May 2025 22:12:32 +0200
Newsgroups gmane.linux.debian.devel.java
Message-ID <[email protected]>
Good evening,

After hitting a new, more serious case of module resolution failure I 
had to engage in several sessions of debugger-driven development, where 
I discovered that my logic that replaces remote artifact repositories 
with local ones needed to be reworked.

Le 2025-05-02 19:39, Julien Plissonneau Duquène a écrit :
> as I think I'm more than halfway done on that front.

I'm not much further right now: the configuration progress bar only 
reaches a meager 13%, still better than the 0% of last week. I had to 
spend some time fighting IDEA's debugger again (is there any efficient 
GUI or TUI java debugger out there that isn't finicky?) that didn't want 
to stop at my breakpoints, didn't recognize my custom exception class 
and has no known way AFAICT [1] to write a breakpoint condition testing 
the raised exception, so I ended up adding patterns to the breakpoint 
class filters until I could get where I wanted to and found out that the 
issue was caused by the use of exclusiveContent on the bootstrap 
repository added by Kotlin build scripts. When this feature is used, a 
corresponding set of exclude patterns is automatically applied to all 
other repositories, including those added later, even after the 
exclusiveContent repository is removed as this is done through a 
DomainObjectCollection.all() closure.

I could then test a few ways to get around that. Patching that part out 
of the upstream buildscripts was among the possibilities as it's not 
necessary for the packaging build, but I wanted to avoid that as that 
would mean a dedicated patch to maintain on the long term on a part of 
the build script that so far changed several times a year. Unfortunately 
Gradle exposes no public API that makes it possible to inspect and 
change the filters applied to repositories (you can only add new ones), 
and there is no convenient way to reset a repository list or remove an 
exclusiveContent repository including its effects applied to other 
repositories. I settled for a call to an internal, package-private 
method of a package-private class to clear the exclude filters using 
reflection. This is not really satisfying in terms of future-proofing 
but it does the job for now and I may submit later a Gradle feature 
request for this use case.

Hoping again to clear that configuration phase by next week.

Cheers,


[1]: https://youtrack.jetbrains.com/issue/IDEA-206580