Commit Graph

94690 Commits

Author SHA1 Message Date
Pavel Kunyavskiy c279facc28 [K/N] More localized debug info rejection is supported
Sometimes plugins generate code with UNDEFINED_OFFSET debug info.
Probably, we can't control it, and just need to deal with it.

^KT-53667
2022-08-24 10:27:08 +00:00
Yahor Berdnikau 55e1061862 Mark testFixtures dependencies as optional in published pom
Same as Gradle does by default.

^KT-53670 Fixed
2022-08-24 11:19:09 +02:00
Vladimir Sukharev 7f1ab29668 Fix Windows targets has bad addresses in stacktrace
^KT-49240 Fixed

Merge-request: KT-MR-6883
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-08-24 09:05:06 +00:00
Pavel Mikhailovskii 18e61315f4 KT-27936 Generate InnerClasses attributes 2022-08-23 22:06:10 +00:00
soarex 4a8eec8166 Fix test environment setup in atomicfu plugin
Co-authored-by: soarex <soarex16@gmail.com>

Merge-request: KT-MR-6915
Merged-by: Maria Sokolova <maria.sokolova@jetbrains.com>
2022-08-23 20:58:31 +00:00
Svyatoslav Scherbina 0021333b91 [Native][test] Unmute more passing tests
They now pass likely due to better handling of reflection information
when renaming packages when grouping tests (see cee0731).
2022-08-23 17:05:59 +00:00
Alexander Shabalin 58569f2eee Fix pthread to number converstion ^KT-52429
Merge-request: KT-MR-6918
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-08-23 16:36:24 +00:00
konstantin.tskhovrebov 45fc5fb76b [KT-47355] Fix sym link paths in macos fat framework. 2022-08-23 17:06:33 +02:00
Svyatoslav Scherbina 860f99482a Native: prohibit calling suspend functions from autoreleasepool {}
If a suspend function is called from `autoreleasepool {}` block, this
might cause the autoreleasepool frame to be removed earlier than
expected. See https://youtrack.jetbrains.com/issue/KT-50786 for more
details.

^KT-50786 Fixed
2022-08-23 14:30:54 +00:00
Yahor Berdnikau 55cfb3af20 Remove deprecated GFileUtils usage
^KT-53615 Fixed
2022-08-23 12:24:04 +00:00
Alexander Shabalin 94b550b9dc [K/N] Do not make compdb depend on runtime building
Merge-request: KT-MR-6907
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-08-23 07:41:59 +00:00
Sergej Jaskiewicz 5f913b5595 [JS IR] Remove unused CALLABLE_CLOSURE_DECLARATION declaration origin 2022-08-22 23:15:52 +00:00
Sergej Jaskiewicz d57ddc5f83 [JS IR] Generate debug info for JS injections
Also, fix the JS parser to collect the "correct" debug info
(see the note in `translateJsCodeIntoStatementList`)

#KT-53361 Fixed
2022-08-22 23:15:52 +00:00
Sergej Jaskiewicz 746c1b5903 [JS] Add toString() override to JsPropertyInitializer
This doesn't affect js2string, but is convenient for debugging
2022-08-22 23:15:52 +00:00
Sergej Jaskiewicz a152bc2313 [JS IR] Don't parse/print JS code in js() call twice
#KT-51327 Fixed
2022-08-22 23:15:52 +00:00
Steven Schäfer a90c4d5dd5 JVM IR: Optimize equality on class literals 2022-08-23 00:14:11 +02:00
Alexander Likhachev 3a1d83e7c5 [Gradle, K/N] Add test for KT-52303 2022-08-22 21:10:38 +00:00
Alexander Likhachev d7c1f6765e [Gradle, K/N] Compute binaries output dir lazily
#KT-52303 Fixed
2022-08-22 21:10:38 +00:00
Vsevolod Tolstopyatov 5054e301be [stdlib] Improve EnumEntries
* Provide short-circuit methods for contract "EnumEntries contains all
  enum entries"
* Make EnumEntries serializable
* Introduce more convenient overload for other backends

#KT-53152


Merge-request: KT-MR-6867
Merged-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
2022-08-22 16:50:28 +00:00
Dmitriy Novozhilov cc00dcc038 [Serialization] Reorganize module structure 2022-08-22 17:23:18 +03:00
Rick Clephas 0a8cefc8a5 [FIR] Add NativeObjCRefinement checkers 2022-08-22 16:10:44 +02:00
Rick Clephas 203af3afdd [FE 1.0] Add NativeObjCRefinement checkers 2022-08-22 16:10:44 +02:00
Rick Clephas 6ae517a2df [Native] Add HiddenFromObjC and ShouldRefineInSwift annotations 2022-08-22 16:10:44 +02:00
Nikita Bobko a65cb947d6 Check that kotlin-reflect has a correct version during resolution
Review: https://jetbrains.team/p/kt/reviews/6753

After we migrated to the binary reflect in previous commits we want to
make sure that people won't accidentaly depend on wrong reflect in the
future.
2022-08-22 15:44:01 +02:00
Nikita Bobko 62cadde3e6 Drop kotlin-reflect -> kotlin-reflect-api dependency substitution
Review: https://jetbrains.team/p/kt/reviews/6753

This dependency substitution was introduced in
5c99243c10 as a way to fight against
non-incremental compilations. Now it's not needed anymore as the
dependency on kotlin-reflect was changed to binary dependency just a few
commits ago.
2022-08-22 15:43:59 +02:00
Nikita Bobko 8547cb0afd 5/5 Replace source dependency on kotlin-reflect with binary dependency
Review: https://jetbrains.team/p/kt/reviews/6753

Meaningful semantic change was splitted into 5 commits to simplify the
change review. Sinle commit would be too big.

Why replace source to binary: to get rid of kotlin-reflect in Kotlin
plugin artifact KTIJ-22276

Tests that would break if we put reflect from the minimum supported
IDEA into dist:
* Java11ModulesIntegrationTest
* Java17ModulesIntegrationTest

^ Actually, a lot of tests would fail, but I specifically highlight
those two because the "a lot of tests" can be easily fixed by changing
`ForTestCompileRuntime.reflectJarForTests` to:
```
@NotNull
public static File reflectJarForTests() {
    return assertExists(new File("libraries/reflect/build/libs/kotlin-reflect-1.7.255-SNAPSHOT.jar"));
}
```
`Java11ModulesIntegrationTest` & `Java11ModulesIntegrationTest` cannot
be fixed in principle because those tests use reflect from dist with
help of `JvmArgumentsKt.configureStandardLibs` (not with help of
`ForTestCompileRuntime`). `JvmArgumentsKt.configureStandardLibs` is
about `-no-stdlib` & `-no-reflect` compiler flags. That's why we have to
pack SNAPSHOT reflect into dist.
2022-08-22 15:43:55 +02:00
Nikita Bobko 0a6dadd04d 4/5 Replace source dependency on kotlin-reflect with binary dependency
Review: https://jetbrains.team/p/kt/reviews/6753

Meaningful semantic change was splitted into 5 commits to simplify the
change review. Sinle commit would be too big.

Why replace source to binary: to get rid of kotlin-reflect in Kotlin
plugin artifact KTIJ-22276
2022-08-22 15:43:53 +02:00
Nikita Bobko e2cda2a272 3/5 Replace source dependency on kotlin-reflect with binary dependency
Review: https://jetbrains.team/p/kt/reviews/6753

Meaningful semantic change was splitted into 5 commits to simplify the
change review. Sinle commit would be too big.

Why replace source to binary: to get rid of kotlin-reflect in Kotlin
plugin artifact KTIJ-22276

Other pom.xml in libraries/tools:
* libraries/tools/kotlin-bom/pom.xml
    * Used to align user project deps. Should be a SNAPSHOT version
* kotlin-osgi-bundle/pom.xml
    * Used by users for OSGI Java modular system. Should be a SNAPSHOT
      version
* kotlin-maven-plugin-test/pom.xml
    * I don't know what this it but we stopped publishing it to the
      Maven central, so I will skip it
2022-08-22 15:43:52 +02:00
Nikita Bobko 2a4f3f41aa 2/5 Replace source dependency on kotlin-reflect with binary dependency
Review: https://jetbrains.team/p/kt/reviews/6753

Meaningful semantic change was splitted into 5 commits to simplify the
change review. Sinle commit would be too big.

Why replace source to binary: to get rid of kotlin-reflect in Kotlin
plugin artifact KTIJ-22276

Note: Kotlin Maven artifacts (./gradlew publish) changed their
dependency on kotlin-reflect
2022-08-22 15:43:49 +02:00
Nikita Bobko 276923834f 1/5 Replace source dependency on kotlin-reflect with binary dependency
Review: https://jetbrains.team/p/kt/reviews/6753

Meaningful semantic change was splitted into 5 commits to simplify the
change review. Sinle commit would be too big.

Why replace source to binary: to get rid of kotlin-reflect in Kotlin
plugin artifact KTIJ-22276

Technically, versions.kotlin-reflect should be the same as in minimal
supported IDEA (which is 213 IDEA and 1.5.10 version of reflect) but,
unfortunatelly, 1.5.10 is too old for the Kotlin repo.
ScriptCompilerTest.testTypeAliases fails if you try to use such an old
version:

    java.lang.ClassCastException: kotlin.reflect.jvm.internal.impl.serialization.deserialization.descriptors.DeserializedTypeAliasDescriptor cannot be cast to kotlin.reflect.jvm.internal.impl.descriptors.ClassDescriptor
        at kotlin.reflect.jvm.internal.KClassImpl$Data$nestedClasses$2.invoke(KClassImpl.kt:102)
        at kotlin.reflect.jvm.internal.KClassImpl$Data$nestedClasses$2.invoke(KClassImpl.kt:47)
        at kotlin.reflect.jvm.internal.ReflectProperties$LazySoftVal.invoke(ReflectProperties.java:92)
        at kotlin.reflect.jvm.internal.ReflectProperties$Val.getValue(ReflectProperties.java:31)
        at kotlin.reflect.jvm.internal.KClassImpl$Data.getNestedClasses(KClassImpl.kt)
        at kotlin.reflect.jvm.internal.KClassImpl.getNestedClasses(KClassImpl.kt:240)
        at org.jetbrains.kotlin.scripting.compiler.test.ScriptCompilerTest.testTypeAliases(ScriptCompilerTest.kt:46)

Well, let's use 1.6.10 which is kotlin-reflect bundled into 221.
2022-08-22 15:43:30 +02:00
Nikita Bobko 0874fb71c6 Replace all kotlin-reflect-api dependencies with kotlin-reflect
Review: https://jetbrains.team/p/kt/reviews/6753

Why: I'm going to replace source dependency on kotlin-reflect with
binary dependency. Normalize reflect dependency before global
processing.
2022-08-22 15:43:11 +02:00
Nikita Bobko 8f79e833a8 Drop all redundant kotlin-reflect, kotlin-reflect-api dependencies
Review: https://jetbrains.team/p/kt/reviews/6753

All redundant I managed to find, of course.

Why: I'm going to process all reflect dependencies in the next commits.
Cleanup reflect dependency before processing.

They are redundant because:
1. if `compileOnly` then compilation didn't break after dropping the
   dependency
2. if `test*` then tests didn't break after dropping the dependency.
3. `analysis/analysis-api-fir/analysis-api-fir-generator/build.gradle.kts`
   `compiler/fir/checkers/checkers-component-generator/build.gradle.kts`
   Drop `implementation(project(":kotlin-reflect-api"))` because the
   module already depends on
   `implementation(project(":kotlin-reflect"))`
4. `compiler/daemon/daemon-client/build.gradle.kts`. Drop `runtimeOnly`
   because after dropping `compileOnly` compilation didn't break (so
   `runtimeOnly` looks suspicious). Less safe than 1-3
2022-08-22 15:42:57 +02:00
Nikita Bobko 6eb3f1ac05 Refactor: Inline kotlinReflectModule
Review: https://jetbrains.team/p/kt/reviews/6753

In the next commits, source dependency on kotlin-reflect will be
replaced with binary dependency. Thus, it won't be technically be a a
"module" anynmore. So I either have to rename "kotlinReflectModule" or
get rid of it. I decided to get rid of it (inline it) because there is
only one usage.
2022-08-22 15:42:56 +02:00
Nikita Bobko e3bf7698a9 kotlin-scripting-dependencies-maven: fix reflect dependency
Review: https://jetbrains.team/p/kt/reviews/6753

Use the same reflect dependency as in the rest of the project.

Why: I'm going to process all reflect dependencies in the next commits.
Normalize reflect dependency before processing.

This weird reflect dependency style was introduced in
83087291df. I think it was a simple
mistake.
2022-08-22 15:42:45 +02:00
Nikita Bobko 837d100cda Drop settings.gradle.kts from kotlin-native/shared
Review: https://jetbrains.team/p/kt/reviews/6753

I don't know why this settings.gradle.kts is needed. But I think that
it was needed before "kotlin-native merge into kotlin" times. (Pavel
Punegov says the same) I try to remove and if CI doesn't fail then I
will push it.

I need to drop settings.gradle.kts because I'm going to replace
kotlin-reflect dependency from source to binary in the next commits. And
before doing this refactoring I want to normalize all the dependencies
on kotlin-reflect.
2022-08-22 15:42:40 +02:00
Nikita Bobko 70ed76e0bd Drop unused ':dist' dependency in some tests
Review: https://jetbrains.team/p/kt/reviews/6753

This commit doesn't fix any issue except for "cleanup". If you find a
mistake in this commit feel free to revert part of it/the whole commit

I checked every module where I drop ':dist' dependency. Tests still pass
in those modules
2022-08-22 15:42:34 +02:00
Alexander Shabalin 6f844f15e0 [K/N] Worker API improvements ^KT-52429
Merge-request: KT-MR-6898
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-08-22 10:41:14 +00:00
nataliya.valtman 6e2202ad5a Fix repeating custom values in build scan. Refactor build statistic 2022-08-22 09:29:44 +02:00
Igor Chevdar ccb4b5fd7d Revert "[Native][tests] Temporarily disable String codegen/box tests with "-opt" mode"
This reverts commit b210e24b43.
2022-08-22 06:05:53 +00:00
Igor Chevdar 0f9ae605d0 [K/N][codegen] Fixed bug with stack allocated strings
#KT-53667 Fixed
2022-08-22 06:05:53 +00:00
Igor Chevdar 16eaba8f68 [K/N][tests] Added a test on stack allocated string 2022-08-22 06:05:53 +00:00
Aleksandr Kutashov a74f289844 KT-48822: Fixes ConcurrentModificationException in AsmTypes
AsmTypes#getType() could be called from multiple threads, which causes CME sometimes.
Should guard TYPES_MAP modification.
2022-08-20 00:56:52 +02:00
Jinseong Jeon 79686ba242 AA FE1.0: don't return psi for fake overrides 2022-08-20 00:50:10 +02:00
Jinseong Jeon 25f7554a31 AA FIR: constant evaluation for Java field 2022-08-20 00:50:09 +02:00
Leonid Startsev 0869dd9c92 Repair bootstrapping for wasm-ir module by removing class referencing
from constructor of kotlinx.serialization ir generator.

Such references may be null if plugin was applied to the module, but no
runtime was provided in current compile configuration (see added test).
2022-08-19 14:42:36 +00:00
Leonid Startsev 0b3d9ffa71 Replace ad-hoc .newRef() with .toFirResolvedTypeRef() 2022-08-19 14:42:35 +00:00
Leonid Startsev dc7ba5d22b Remove module-wide ObsoleteDescriptorApi opt-in
and remove access to .descriptor whenever possible
2022-08-19 14:42:34 +00:00
Leonid Startsev 783087a551 Add tests for value classes serialization
apparently they're already working in FIR
2022-08-19 14:42:33 +00:00
Leonid Startsev 89a8bdc0f6 Support enum serialization in FIR
for all runtime versions, re-enable optimization in IR backend
by correctly determining presence of functions in runtime.
2022-08-19 14:42:32 +00:00
Leonid Startsev 472aca1491 Tests for sealed & abstract serializable classes in FIR 2022-08-19 14:42:31 +00:00