:wave: I'm trying out KSP from HEAD and running i...
# ksp
j
👋 I'm trying out KSP from HEAD and running into an issue regarding mangled JVM names for internal functions. I don't think they appear to match the 2.1 compiler? For example, if a function
internal fun mangled()
existed in an Android module
:nested:library
within its
debug
sourceset, then the mangled name generated by the compiler is
mangled$nested_library_debug
. However, KSP is returning
mangled$library
. Doing a quick test, the compiler seems generate mangled names differently?
Copy code
// Within src/main for a given JVM library, :nested:library 
// Within src/debug for a given Android library, :nested:library 

package dev.jonamireh 

class MangledClass {
    internal fun mangled(): Boolean = true
}
In a JVM module, the compiler generates
mangled$library
. In an Android module, the compiler generates
mangled$nested_library_debug
. It seems as though KSP is only using the JVM variant of generating mangled names. Is there an open issue for this or how can I report this effectively? I'm not even sure which right 😅
👀 1
@Ting-Yuan Huang Would you like me to open a KSP issue or file a YouTrack issue for the Kotlin compiler?
t
Sounds like a bug in KSP if the mangled name returned by KSP is different from what compiler generates. There might be some Android specific rules that we missed to implement. I'd appreciate if you could file a KSP bug.
j
Will do! Let me create a sample project
t
thank you color
j
Of course, when I create a sample project, it doesn't reproduce as expected. I'm getting
$<module_name>_<sourceset>
in Android libraries instead of what I'm experiencing which is
$<module__path_>_<sourceset>
🫠 I'll keep investigating though Edit: Figured it out, see below!
https://github.com/google/dagger/issues/4493 This is what I experiencing but it was filed in google/dagger
Whoooo I figured out why our Android library module names were our project paths We were applying a workaround for a bug in AGP 8.1 that was patched in AGP 8.3.1, that changed the
archiveName
. Evidently, this is what determines the module name for Android 🙃