atsushieno / augene-ng

MML + MIDI + Tracktion Engine XML manipulation tool for real production
GNU General Public License v3.0
9 stars 2 forks source link

native: kotractive PropertyInfo() is always passed null propertyMetaType #16

Open atsushieno opened 2 years ago

atsushieno commented 2 years ago

If we enable nativeMain etc. in kotractive/build.gradle and run ./gradlew build, it results in weird failure at nativeTest, particularly at EditModelReaderTest.readTemplate(). The test failure log does not really tell anything (K/N does not give us a stacktrace), and due to https://github.com/atsushieno/augene-ng/issues/10 we cannot really debug the test on IDEA. I got lost.

I actually went beyond and inserted some debug println()s around, and figured out that PropertyInfo constructor does not receive valid propertyMetaType parameter. They were often passed from typeBoolean, typeInt, typeString etc. (defined in EditModelMetadata.kt). I suspect that those vals are not appropriately initialized on (and only on) Kotlin/Native. The constructor parameter is non-null, and those vals are NOT null, but what is actually passed to PropertyInfo() IS null.

It is most likely a bug in Kotlin/Native runtime, but we may be able to workaround the issue by changing the code structures (place those referent vals elsewhere e.g. inside some object).

atsushieno commented 2 years ago

https://youtrack.jetbrains.com/issues/KT?q=native%20variable%20null this kind of issue might have been already fixed in 1.6.0-RC2, but it is incompatible with ksp 1.5.31-1.0.1...

atsushieno commented 2 years ago

Still not fixed at 1.6.0-1.0.1.

atsushieno commented 2 years ago

^ was wrong; the problem that is still not fixed is #10, not this one. Gradle sync still fails due to #10, but running ./gradlew build succeeds now, meaning that this issue is fixed.

atsushieno commented 2 years ago

hrm, it is weird, I could get it working locally, but Actions build shows regression. There seems some inconsistency. https://github.com/atsushieno/augene-ng/actions/runs/1484468850