Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Saving Kotlin classfiles properly #392

Merged
merged 4 commits into from
Oct 15, 2024

Conversation

Hello-zoka
Copy link
Collaborator

@Hello-zoka Hello-zoka commented Oct 11, 2024

Description of changes made

kotlinc saves .class files in the same place they were called from, but we expect them to be in the same directory as source files.

Probably, coverage collection for Kotlin in headless mode works now(has to be tested)

Closes #391

@Hello-zoka Hello-zoka added bug Something isn't working In progress PR is in progress Urgent Urgant PR labels Oct 11, 2024
@Hello-zoka Hello-zoka self-assigned this Oct 11, 2024
@Hello-zoka Hello-zoka added Ready for review PR redy for review and removed In progress PR is in progress labels Oct 14, 2024
Copy link
Collaborator

@pderakhshanfar pderakhshanfar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it on IDEA 2024.2.3, and the problem seems to be resolved.

@Vladislav0Art
Copy link
Collaborator

Vladislav0Art commented Oct 15, 2024

I got a compilation error but I think it is a local issue with my IntelliJ (version: IDEA 2024.2.3):

2024-10-15 11:23:09,907 [  82397]   INFO - STDOUT - 11:23:09.907 [ApplicationImpl pooled thread 6] INFO org.jetbrains.research.testspark.core.test.kotlin.KotlinTestCompiler - Error message: 'exception: java.lang.OutOfMemoryError: Java heap space	at java.base/java.util.zip.ZipFile$Source.initCEN(ZipFile.java:1678)	at java.base/java.util.zip.ZipFile$Source.<init>(ZipFile.java:1495)	at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1458)	at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:724)	at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:251)	at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:180)	at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:194)	at com.intellij.openapi.vfs.impl.ZipHandler$1.createAccessor(ZipHandler.java:22)	at com.intellij.openapi.vfs.impl.ZipHandler$1.createAccessor(ZipHandler.java:15)	at com.intellij.util.io.FileAccessorCache.createHandle(FileAccessorCache.java:45)	at com.intellij.util.io.FileAccessorCache.get(FileAccessorCache.java:39)	at com.intellij.openapi.vfs.impl.ZipHandler.acquireZipHandle(ZipHandler.java:46)	at com.intellij.openapi.vfs.impl.ZipHandlerBase.contentsToByteArray(ZipHandlerBase.java:100)	at com.intellij.openapi.vfs.impl.jar.CoreJarVirtualFile.contentsToByteArray(CoreJarVirtualFile.java:111)	at org.jetbrains.kotlin.cli.jvm.compiler.JvmPackagePartProvider$addRoots$1.invoke(JvmPackagePartProvider.kt:56)	at org.jetbrains.kotlin.cli.jvm.compiler.JvmPackagePartProvider$addRoots$1.invoke(JvmPackagePartProvider.kt:55)	at org.jetbrains.kotlin.cli.jvm.compiler.JvmPackagePartProviderKt.tryLoadModuleMapping(JvmPackagePartProvider.kt:73)	at org.jetbrains.kotlin.cli.jvm.compiler.JvmPackagePartProvider.addRoots(JvmPackagePartProvider.kt:55)	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.createPackagePartProvider(KotlinCoreEnvironment.kt:303)	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1$1.invoke(KotlinToJVMBytecodeCompiler.kt:261)	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1$1.invoke(KotlinToJVMBytecodeCompiler.kt:261)	at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.createContainer(TopDownAnalyzerFacadeForJVM.kt:187)	at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.createContainer$default(TopDownAnalyzerFacadeForJVM.kt:126)	at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:90)	at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:77)	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:256)	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:247)	at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:115)	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:247)	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:87)	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:43)	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:165)'

Having java.lang.OutOfMemoryError: Java heap space is weird.

Copy link
Collaborator

@Vladislav0Art Vladislav0Art left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Vladislav0Art Vladislav0Art removed the Ready for review PR redy for review label Oct 15, 2024
@Vladislav0Art
Copy link
Collaborator

Requires publishing a new version of the core.

I see several PRs need a new major version of the core. How about merging the PRs and creating a separate PR specifically to publish a major core version at the end (for the sake of having a smaller number)?

CC: @pderakhshanfar @arksap2002 @Hello-zoka

@pderakhshanfar pderakhshanfar merged commit 298662a into development Oct 15, 2024
3 checks passed
@arksap2002 arksap2002 deleted the izaitsev/bugs/kotlin-classfiles branch October 15, 2024 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Urgent Urgant PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kotlin compilation fails if TestSpark installed locally: permission denied when kotlinc writes .class-files
3 participants