Has anyone encountered this issue with native targ...
# ksp
n
Has anyone encountered this issue with native targets?
Copy code
> Task :an-sample:kspTestKotlinAndroidNativeArm64 FAILED
e: Could not find "/Users/natario/Projects/ccc/ppp/an-sample/build/generated/ksp/androidNativeArm64Main/classes" in [/Users/natario/Projects/ccc/ppp, /Users/natario/.konan/klib, /Users/natario/.konan/kotlin-native-prebuilt-macos-x86_64-1.5.30/klib/common, /Users/natario/.konan/kotlin-native-prebuilt-macos-x86_64-1.5.30/klib/platform/android_arm64]
Trying to run processor on the
test
compilation, gives the error above about missing class file in the
main
compilation path. Indeed that "generated/ksp/classes" directory is empty, not sure what it's expecting to find there. The error wording also seems suspicious, in
Could not find "XXX" in [list of paths]
I'd expect XXX to be a filename, not a resolved path.
t
Could you share the stacktrace?
a
This is a branch that only enabled native builds from my main branch that buidls fine.
t
Thanks, the repro really helps a lot 🙏 So the issue is that KSP and K/N are a little bit inconsistent in registering / linking libraries. Assuming not too many people are generating klib directly, I disabled that ability (processor generated library / binary) on KSP + K/N for now as a workaround. Otherwise it'd always fail whenever a test source set exists for K/N.
a
Great, thanks! I'm curious though, do you mean by that I could still build my library if I could somehow disable testNative or building klib, even at beta09? I tried commenting out
binaries...
section (sounds like the other way around though), commenting out
nativeTest by getting
, combination of those, but nativeTest still tries to build. (Not too seriously, but I want my libraries integrated into my C++ app in that repo too.)
n
After https://github.com/google/ksp/pull/609 I think we could workaround this by not applying ksp to the test compilation.
t
With beta09, I expect the error happens with
kspTestKotlin...
, which are created (via
compileTestKotlin...
) when the test source sets exist. Could you check whether the
kspTestKotlin...
task still exist? Or could you share the error message if the X in the "Could not find X..." is different now? @atsushieno This is the workaround btw: https://github.com/google/ksp/pull/608/files
a
@Ting-Yuan Huang
kspTestKotlinNative
is still there. It's fine that it fails to build when it exists, but I have no idea how to disable that (whatever triggers
compileTestKotlinNative
) in
build.gradle.kts
. If I run
./gradlew build -x compileTestKotlinNative
it passes for sure, but that would not be great for daily development on IDEA... I have encountered another native build issue but will start a new thread.
t
Next release is on the way. The test task won't be a blocker soon.
❤️ 1