Commit Graph

106202 Commits

Author SHA1 Message Date
Nataliya.Valtman c332e1beb5 Remove BuildStatsService.applyIfInitialized outside BuildFlowService
#KT-58768 In Progress
2023-11-16 15:22:01 +00:00
Svyatoslav Kuzmich 62ebb9932f [Wasm] Port external declaration checker to K2 (KT-56849)
Share common code with FirJsExternalChecker using
FirWebCommonExternalChecker
2023-11-16 14:27:49 +00:00
Svyatoslav Kuzmich 83aa014d81 [FIR] Fix default message test failing with NPE
Return early. Otherwise, if map doesn't contain the key,
`get(factory)!!` in the next statement fails with an NPE.
2023-11-16 14:27:49 +00:00
Ilya Kirillov 531e4fb86e [Analysis API Standalone] add comment about KT-63493 to StandaloneSessionBuilderAgainstStdlibTest 2023-11-16 13:31:54 +00:00
Ilya Kirillov fca04d4143 [LL FIR] run low-level-fir Kotlin/Native tests on TC
It's a part of KT-62910
2023-11-16 13:31:54 +00:00
Ilya Kirillov fee7d63975 [Analysis API Standalone] add tests for resolution against native KLib
^KT-63126
2023-11-16 13:31:53 +00:00
Ilya Kirillov 63c807f7bd [Analysis API Standalone] extract test logic for a test against the stdlib to a base classes
It will be reused in a Kotlin/Native resolution test in the following commit

^KT-63126
2023-11-16 13:31:53 +00:00
Ilya Kirillov 6aeabc83ea [kotlin] fix "IllegalStateException: Could not find stdlib"
The commit removes all the KLib resolution logic,
now Analysis API Standalone clients need to provide all the KLib
list directly.

The resolution logic was removed as too error-prone and requiring compiler configurations.

Kotlin Gradle plugin can provide a full set of required KLibs,
so if a client is a Gradle plugin, this should not be an issue.

Probably, some fancy API which will explicitly perform all KLib dependency searches
should be introduced in the future (KT-63395)

^KT-63126 fixed
2023-11-16 13:31:53 +00:00
Ilya Kirillov 1c17f4a835 [Analysis API Standalone] extract a assertIsCallOf test utility to reused in other test modules
^KT-63126
2023-11-16 13:31:53 +00:00
Artem Kobzar 890fbd6b0b [K/JS] Process JS-specific returnable blocks before the state machine building
^KT-60785 Fixed
^KT-63207 Fixed
2023-11-16 13:25:51 +00:00
Igor Chevdar 36452b5db7 [K/N] IR version of isObjCObjectType 2023-11-16 12:17:46 +00:00
Ivan Kylchik af716b2e3e [IR] Add KDoc for PhaserState, CompilerPhase and PhaseConfig classes 2023-11-16 12:03:41 +00:00
Ivan Kylchik 48a0274989 [WASM] Reuse common makeIrModulePhase to create lowerings
#KT-63074
2023-11-16 12:03:41 +00:00
Ivan Kylchik b3e485c649 [JS_IR] Try to find generated default stub fun before creating a new one
This change is required to support a new approach to lowering
execution. There will be no more guarantee that every module
will execute `JsDefaultArgumentStubGenerator` lowering before
moving on.

#KT-63073
2023-11-16 12:03:41 +00:00
Ivan Kylchik 917b9481c1 [JS_IR] Drop old comment from loweringList
This comment is not needed anymore after
64158a8a2f
2023-11-16 12:03:41 +00:00
Ivan Kylchik 1db595c676 [JS_IR] Reuse common makeIrModulePhase to create lowerings
#KT-63073
2023-11-16 12:03:41 +00:00
Ivan Kylchik 0a6f711a41 [JS_IR] Use IrModuleFragment as input to lowering instead of iterable
This way we will be able to reuse existing utils
to create a lowering.

#KT-63073
2023-11-16 12:03:41 +00:00
Mikhail Glukhikh 1eacd5efc2 K1/K2: support org.jspecify.annotations.NonNull in Java interop
#KT-62352 Fixed
2023-11-16 11:13:44 +00:00
Dmitriy Novozhilov dcbc1e6a04 [Build] Update system properties for tests in JPS mode
Property `jps.kotlin.home` in test run configuration template pointed
  to wrong kotlinc dist location
2023-11-16 09:04:06 +00:00
Aleksei.Cherepanov 6f3204da0a Stop using IJ's maps in graph implementation of JPS 2023-11-16 08:53:13 +00:00
Yahor Berdnikau 55f6614b66 [Gradle] Increase max Kotlin daemon heap size to 2g for all kapt tests
Apparently, they all require more than 1g of heap size to run kapt.
2023-11-16 08:01:33 +00:00
Dmitriy Dolovov 1183244455 [tests] Use full paths with the proper extensions to KLIBs in LibraryProvider
^KT-61098
2023-11-15 19:38:25 +00:00
Dmitriy Dolovov 82b08a813b [Native] Fix scripts for computing dependencies in platform DEF files
Now, the scripts are able to compute and record full dependencies
(i.e. direct + transitive) to DEF files.

^KT-61098
2023-11-15 19:38:25 +00:00
Dmitriy Dolovov 2fe49f2e5a [Native][tests] Don't use KLIB repositories in new test infrastructure
Don't pass KLIB repositories via '-repo' or '-r' compiler parameters.

^KT-61098
2023-11-15 19:38:25 +00:00
Dmitriy Dolovov f4617f405c [Native] Don't use KLIB repositories in generation of platform libs
Don't pass KLIB repositories via '-repo' or '-r' compiler parameters.

^KT-61098
2023-11-15 19:38:25 +00:00
Dmitriy Dolovov c13c917a8a [Native] Don't use KLIB repositories in K/N build infra
Don't pass KLIB repositories via '-repo' or '-r' compiler parameters.

^KT-61098
2023-11-15 19:38:25 +00:00
Dmitriy Dolovov 4f1f06c24f [Native][tests] Use full paths to dependencies in K/N test in old infra
Affected tests:
- fake_override_0
- split_compilation_pipeline
- library_ir_provider_mismatch (reworked)
- objs tests (resolve of exported klib in framework)

^KT-61098
2023-11-15 19:38:25 +00:00
Dmitriy Dolovov 97f1a23f8b [Native][tests] Handle errors in individual compiler invocations 2023-11-15 19:38:25 +00:00
Dmitriy Dolovov 60c88b010d [Native] Add missing dependencies to platform lib DEF files
There are a lot of cases when a DEF file for a K/N platform library
has incomplete set of dependencies in 'depends=' property in
the manifest file. This leads to use of "KLIB resolver" - the
component inside the compiler that is responsible for finding the
missing libraries and implicitly (i.e. invisibly for the end user)
adding them to the set of dependencies of the compiler invocation.

The goal of this commit is to fix 'depends=' in manifest files so that
they should reflect the REAL set of dependencies, and as a result don't
trigger use of "KLIB resolver". This way we could be more prepared to
removed in the "KLIB resolver" in the future.

^KT-61098
2023-11-15 19:38:25 +00:00
Dmitriy Dolovov c3da16a1d8 [Native] Use library paths instead of library names in K/N build infra
Use library paths instead of library names in K/N build infra when
passing a library through `-library` compiler argument.

^KT-61098
2023-11-15 19:38:25 +00:00
Dmitriy Dolovov e7b8f3ecde [Native] Deprecate KLIB repositories in Kotlin/Native compiler
1. Log warnings on usage of KLIB repositories.
2. Don't block using repositories for now.

^KT-61098
2023-11-15 19:38:24 +00:00
Vladimir Sukharev c38a0e10af [K/N] Implement a concept of conditional ignore of K/N blackbox tests
^KT-59288 Fixed
2023-11-15 19:03:07 +00:00
Svyatoslav Scherbina 6ce33e80a5 Native: fix ConcurrentModificationException in test infra
Synchronously copy system properties before iterating over them, because
other thread sometimes tries to modify them in the meantime, which leads
to ConcurrentModificationException otherwise.
2023-11-15 18:52:12 +00:00
Pavel Kirpichenkov cf849835ba [K2, IDE] Don't filter declarations from built-ins in K2 decompiler
Intercept decompiler calls to process files that belong to classpath
builtins from K2 IDE differently. Their content won't be filtered w.r.t.
JVM logic during decompilation.

Split stub versions for .kotlin_builtins with K1 and K2 IDE.

K2 currently uses a single shared symbol provider for builtins of all
platforms. KotlinBuiltInDecompiler filters out duplicated declarations
contained in JVM classfiles as required for K1. For K2 this logic
doesn't fit: non-JVM modules (common, in particular) rely on
.kotlin_builtins, because kotlin-stdlib-common doesn't contain
.kotlin_builtins or .knm files for some of the built-in declarations
(e.g., kotlin.Unit). IDE has to restore the missing declarations using
built-ins from classloader. Filtering declarations from there using K1
logic breaks resolution of these declarations inside common modules in
IDE. The change shouldn't affect JVM modules as are able to resolve
all builtin symbols from the standard library before falling back to
built-ins.

KT-61757
2023-11-15 18:04:58 +00:00
Ivan Kochurkin c38887ae68 [FIR2IR] Add fields to Fir2IrLazyClass.declarations for Java classes
^KT-61362 Fixed
2023-11-15 17:56:03 +00:00
Ivan Kochurkin 7ce0284e81 [FIR] Introduce isRealOwnerOf utility function 2023-11-15 17:56:03 +00:00
Dmitriy Novozhilov bfc0126105 Advance bootstrap to 2.0.0-dev-7674 2023-11-15 17:05:33 +00:00
Alexander.Likhachev 11e0edc124 [Gradle, K/N] Remove the enableEndorsedLibs flag
This is the last stage of the flag's deprecation cycle.
^KT-56455 Fixed
2023-11-15 17:01:40 +00:00
Roman Efremov 722d901d69 [Tests] Decline bug KT-62886 and change comment accordingly
^KT-62886
2023-11-15 16:47:04 +00:00
Pavel Punegov 9f9b4d1981 [K/N][publish] Publish kotlin-native-compiler-embeddable.jar
Add an ability to publish kotlin-native-compiler-embeddable.jar and
sources to maven. Adds necessary for that sourcesJar and javadocJar
tasks. Note that Native distribution uses this jar without a version postfix.
Also cleaned up the obsolete backend.native publication and renamed 
project to match its name.


Merge-request: KT-MR-12974
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-11-15 14:54:04 +00:00
Hung Nguyen 5562c95155 [IC] Refactor IC maps to reuse code and ensure consistency - Part 2
In commit 4e89dcf, we have prepared the API for IC maps in top
interfaces and provide the implementation in abstract classes.

In this commit, we refactor IC maps so that they directly inherit/reuse
the implementation from the superclasses without having to reimplement
the APIs for a map.

Test: Existing tests (refactoring change)
^KT-63456: In progress

Authored-by: Hung Nguyen <hungnv@google.com>

Merge-request: KOTLIN-MR-801
Merged-by: Evgenii Mazhukin <evgenii.mazhukin@jetbrains.com>
2023-11-15 12:22:40 +00:00
Egor Kulikov c0a05e435c [FIR] Correctly process invalid implicit invoke
^KT-60170 fixed


Merge-request: KT-MR-12926
Merged-by: Egor Kulikov <Egor.Kulikov@jetbrains.com>
2023-11-15 11:43:48 +00:00
Dmitrii Gridin 061b1238fc [FIR] PsiRawFirBuilder: add explicit conversion from KtTypeReference to FirTypeRef
^KT-63042
2023-11-15 11:41:05 +00:00
Dmitrii Gridin 41998ae8ae [FIR] PsiRawFirBuilder: cleanup code
^KT-63042
2023-11-15 11:41:05 +00:00
Yahor Berdnikau 580c2a490d [Gradle] Apply attribute disambiguation rules conditionally
Not all Kotlin disambiguation rules are required for non-MPP projects.
On the other hand, they lead to increased memory consumption in Gradle
daemon especially notable on big multimodule projects.

To address this memory increase, we start to apply these rules
conditionally based on the applied plugin.

^KT-63005 Fixed
2023-11-15 11:18:41 +00:00
Ilya Gorbunov 26183237ab Make :core:builtins:serialize more remote build cache friendly
On CI when populating build cache, the build runs
with --info logging level causing an additional jvm argument
provided to the task.
This argument is usually not provided in local builds.
The argument only affects task printout and not its outputs.
2023-11-15 10:32:09 +00:00
Yahor Berdnikau 6eca282e9a [Gradle] Bump minimal supported AGP version to 7.1.3
^KT-62939 Fixed
2023-11-15 10:31:03 +00:00
Artem Kobzar f4d088a886 [K/JS] Don't add nested classes generated by plugins into ExportModel for interfaces ^KT-63184 Fixed 2023-11-15 10:21:22 +00:00
Artem Kobzar 82bca7a04f [K/JS] Rework member-exportability check in a right way ^KT-61957 Fixed 2023-11-15 10:18:05 +00:00
Mikhail Glukhikh 9279aab97f K2: simplify getOwnSinceKotlin version
Related to KT-59824, KT-59825
2023-11-15 09:36:06 +00:00