Commit Graph

1782 Commits

Author SHA1 Message Date
Mikhail Glukhikh 834bd1a71c K1/K2: split incremental JPS tests properly (relates to KT-59171) 2023-07-20 10:57:45 +00:00
Ilya Goncharov 8c014baa28 [JS] Fix JPS tests with js part 2023-06-29 14:25:45 +00:00
Ilya Goncharov a0f86d8dd6 [JS] Remove JS legacy lookup tracker tests 2023-06-29 14:25:45 +00:00
Troels Bjerre Lund 111bb461a9 CLI: Change kotlin reflection to java reflection
The command line argument parser is using between 0.25s and 0.5s
(depending on platform) on finding annotated properties. This fix
replaces the slow kotlin reflection with java reflection, which is an
order of magnitude faster.

 #KT-58183 Fixed
2023-06-27 08:34:40 +00:00
Alexander.Likhachev 1005d0244a [BT] Move KotlinLogger to the bt-api package
#KT-57398 In Progress
2023-06-23 12:34:23 +00:00
Alexander Udalov 60016d3e5b Remove obsolete compiler flag -Xuse-ir 2023-05-30 14:46:09 +00:00
Ilya Goncharov bcefa1cd66 [Gradle, Wasm] Add wasm platform kind
KTIJ-25583
2023-05-17 13:28:20 +00:00
Kirill Rakhman a50ae9db9d [FIR] Revert workaround for IC issue surfaced by KT-58335
#KT-28233
2023-05-16 09:20:57 +00:00
Nataliya.Valtman 2a391f7330 Move kotlin-build-statistic project to :compiler 2023-04-25 11:29:09 +00:00
nataliya.valtman e34dd043da Add minimal statistic report for JPS build
Fix build stat for gradle 8

#KT-56438 Fixed
2023-04-25 11:29:09 +00:00
Nikolay Krasko 0aaaa5b4fa [213] Fix 1.5.10-release-949 jdk 8 stdlib requirement in :jps-common:test
ERROR:
:jps:jps-common:test: Could not find org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.10-release-949.

The problem is in dependency:
com.jetbrains.intellij.platform:jps-model-serialization:213.7172.25 -- (runtime) ->
com.jetbrains.intellij.platform:util:213.7172.25 -- (runtime) ->
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.10-release-949

Provide a jdk 8 stdlib that should make the resolution of the dependency
redundant.

KTI-1114
2023-04-24 21:58:31 +00:00
Aleksei.Cherepanov ae8428e8d0 Refactor Infrastructure of IC tests
1) Move root util functions to separate CompileRunnerUtils file from IncrementalJvmCompileRunner to leave the only class instance there and to separate util functions
2) Move TestLookupTracker from the abstract parent class location to a separate file as an implementation class
3) Small change naming of building functions just to clarify what they do
4) Some small code-style refactorings
2023-04-24 14:54:45 +00:00
Yahor Berdnikau eb4e96a113 Add kotlin-build-tools-enum-compat workaround
It acts as a workaround for the case when build tools or dependencies
are compiled with latest 'kotlin-stdlib' version, but at a runtime older
 'kotlin-stdlib' is provided, which does not know about new
 `EnumEntries`.

 ^KT-57317 Fixed
2023-04-21 14:57:17 +00:00
Roman Golyshev ac388010b1 [213] Add missing test runtime dependencies
KTI-1114
2023-04-21 13:19:04 +00:00
Roman Golyshev d4cffb8a5a [213] Switch to 213 platform
KTI-1114
2023-04-21 13:19:04 +00:00
Sebastian Sellmair 5d0bf2de24 [CLI] Restore K2JVMCompilerArguments.classpath and javaModulePath
to support IDEs < 2023.2

Reverts:
- 9dcd40d7b7
- fb66764c4d

KTIJ-25227
2023-04-18 09:18:10 +00:00
Sebastian Sellmair 7fe3c5c423 [Gradle] Demote FakeK2NativeCompilerArguments deprecation to 'WARNING'
KTIJ-25227
2023-04-18 09:18:10 +00:00
Sebastian Sellmair 9dcd40d7b7 [CLI] K2JVMCompilerArguments: Model classpath as Array<String>
to allow interning individual file-path arguments on the IDE

KTIJ-24976
2023-04-06 16:03:03 +00:00
Sebastian Sellmair 2b893365aa [Gradle] Replace FakeK2NativeCompilerArguments with K2NativeCompilerArguments
KTIJ-24976
2023-04-06 16:03:02 +00:00
Leonid Shalupov 7480befe32 Replace reflection-based compiler arguments copying with generated code
Using of Kotlin reflection for simple operations like bean management is very slow

First time initialization time: 261 ms for `copyBean(K2JVMCompilerArguments())`
Subsequent calls of `copyBean(K2JVMCompilerArguments())` take 1.7 ms per call

Unfortunately compiler argument handling is also used in Kotlin IntelliJ plugin
to parse facet settings. Big projects may have thousands of Kotlin facets

The same `ArgumentUtilsKt.copyProperties` frame is seen across various freezes:
IDEA-252440 2-3 minutes freeze on Kotlin project reimporting in last 203 eap
IDEA-253107 A lot of short freezes (1-3 sec) during Kotlin project development
KTIJ-23501 Make main run configuration detection lighter
KTIJ-22435 Unresponsive UI with 100% cpu

Reflection issue:
KT-56358 KClasses.getMemberProperties takes too much time

This commit replaces all reflection stuff with a simple code generation
Now `K2JVMCompilerArguments().clone()` goes to hard-to-measure time
2023-04-03 15:47:35 +02:00
Aleksei.Cherepanov 5c039e25fc Pin API and language version to 1.8 for Kotlin facet serialization used by IJ
Facet serialization is located in Kotlin repo, and it uses new(1.9.*) stdlib in compile dependencies. But when it is used by IJ it has previous runtime stdlib dependency (looks like 1.8.0). So here is workaround, that specifies apiVersion and languageVersion, that does not produce such problematic outputs.

#KTIJ-24903 Fixed

Merge-request: KT-MR-9333
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
2023-04-03 09:24:21 +00:00
hungvietnguyen 4f3244fb78 IC: Compute symbols impacted by classpath changes (#5111)
IC: Compute symbols impacted by classpath changes

Incremental compilation has 4 key steps:
  1. Compile changed/impacted files
  2. Detect symbols that have changed after compiling
  3. Detect symbols that are impacted by the changed symbols
  4. Based on the changed-or-impacted symbols, identify files that need
     to be recompiled. Go back to step 1.

Normally, step 2 and 3 are done together when the changed symbols
and impacted symbols are in the same module.

However, if the changed symbols and impacted symbols are in different
modules (e.g., a `Subclass` in lib1 extends a `Superclass` in lib2),
we currently do not compute symbols in the current module that are
impacted by changes in another module (step 3 above).

This is the case for both the new IC and the old IC.

In this commit, we will compute impacted symbols for the new IC. We can
fix the old IC later if necessary (they can't be fixed together easily).

Test: Added BaseIncrementalCompilationMultiProjectIT.testChangeInterfaceInLib
^KT-56197 Fixed
2023-03-21 13:12:15 +01:00
Artem Kobzar 4da81b2b6e [K/JS] Remove an internal system property and replace it with the new compiler flag 2023-03-17 12:38:34 +00:00
Aleksei.Cherepanov 6471624d0c [Gradle] Disable usePreciseJavaTracking flag for K2
Historically flag was enabled for Gradle projects, but we don't have fir-based JavaTracker for the K2 compiler for now, so we need to use a fallback strategy.
Note: it was disabled for tests with K2
Note2: after adding a fir-based java classes tracker this value should be set to true (KT-57147)

#KT-56886 Fixed

Merge-request: KT-MR-9053
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
2023-03-09 13:41:25 +00:00
Alexander.Likhachev 493da2a8b4 [IC] Rename DummyCompilationTransaction -> NonRecoverableCompilationTransaction 2023-03-07 16:19:21 +00:00
Aleksei.Cherepanov 57da858810 [JPS] Don't use non-optimal Files.exist() in JPS context check on dry start-up
After moving JPS from the IJ repo back to the Kotlin repo, some file operations were accidentally changed to non-optimal ones.

#KTIJ-21161 Fixed
2023-02-17 09:58:00 +00:00
Aleksei.Cherepanov 772745b0ad [JPS] Don't compute compiler args on start-up of the build process
Initialization of compiler arguments takes a long time because of its copying, but for initial context check, there is no need to do it at all for all targets except Common.

#KTIJ-21161 In Progress
2023-02-17 09:58:00 +00:00
Konstantin Tskhovrebov aae0cf9e30 Restore a Kotlin facet version to keep serialized settings compatibility
And add a fallback for ExternalSystemTestRunTask serialization.
2023-02-13 16:07:56 +00:00
Konstantin Tskhovrebov bb0ddcbeba Add kotlin platform ID to imported gradle run tasks
It is necessary to determine a platform for the run tasks, for example, to hide run configurations for a some specific target.
2023-02-13 10:20:41 +00:00
Anna Kozlova f784628ebf [CLI] reduce memory usage for compiler settings
make write protection directly in properties
it creates no additional wrapper with the link to the containing class
for ij project, this reduces memory usage for ~15 mb

^KT-56351
2023-02-06 07:57:53 +00:00
Aleksei.Cherepanov 090a58ccc4 Change allConstants test
Currently, FIR compilation of `const val b: Byte = 50 + 50` shows an error, but old compiler doesn't (it shows only warning). Since this is an incremental test, it should not be affected by compiler errors, but should only test for .kt usage without recompilation.

#KT-54991 In Progress
2023-01-30 13:45:39 +00:00
Aleksei.Cherepanov a0fa438735 Revert "FIR IC: fix test with behavior different from non-tight cycle variants"
This reverts commit c4a29651 as it is no longer needed after IC fix: `5ba3053e` "[IC] Do not report recompilation of non-existing files", because now fix-ic-build.log duplicates the main build.log

#KT-54991 In Progress
2023-01-30 13:45:38 +00:00
Aleksei.Cherepanov 67f308dbdb Add dummy test data
Gradle IC with enabled FIR compilation adds some extra files to the compilation scope compared to the previous compiler(KT-55576). Adding dummy files to such tests with expanded compilation scope will prevent green Aggregate build if some changes in IC will lead to full module compilation as there were such precedents with JS IC because otherwise, all files in the module are present in the build log.

#KT-54991 In Progress
2023-01-30 13:45:38 +00:00
Aleksei.Cherepanov 848e1001f8 Add test for IC issue with typealias
If typealias is defined in a separate file, then after changing some base types, an incremental compilation of Kotlin could not find all affected files, because of lack of information, which it can not get on the class file analyzing phase. FIR provides a new approach to IC compilation: now we can run the frontend several times, which allows us to obtain all necessary information and use it to mark all affected files for recompilation.
Relates to KT-54991

#KT-28233 Fixed
2023-01-30 13:45:37 +00:00
Ilya Chernikov e4529f38ac Revert unmuting unfixed test - companionConstantChanged
incorrectly unmuted i the commit "FIR: fix use-site file in supertypes
resolution"
related to #KT-56242
2023-01-30 08:07:24 +00:00
Ilya Goncharov 1150ec6882 [JS] Implementation dependencies for JS klibs
^KT-56158 fixed
2023-01-27 13:31:59 +00:00
Ilya Chernikov 62f2a09d70 FIR: fix use-site file in supertypes resolution
manifested in the IC tests by a seemingly redundant lookup,
although theoretically may lead to more severe issues.
Also fixes lookup recording ignoring logic, since the old
one may break with the new us-site file calculation.
#KT-55195 fixed
2023-01-26 11:56:21 +00:00
Ilya Chernikov dcbcc8b684 minor: restoring proper functioning of non-LT tests 2023-01-26 11:56:21 +00:00
Alexander.Likhachev 581bc89849 [IC] Introduce ICContext to simplify configuration propagation to caches
#KT-49785 In Progress
2023-01-17 22:15:56 +00:00
Alexander Likhachev 274c9b6294 [IC] Register JS IC header file and lookup counter in transaction
#KT-49785 In Progress
2023-01-17 22:15:53 +00:00
Artem Kobzar 71486a321c [K/JS] Add support of compilation with ES-classes 2023-01-17 18:14:17 +00:00
Mikhail Glukhikh 0c4a0360ac Deserialization/class reading: pass chosen JvmMetadataVersion whenever possible 2023-01-16 18:16:07 +01:00
Mikhail Glukhikh 3dc05f4ec5 Introduce language version 2.0 and associate K2 compiler with it 2023-01-16 18:12:55 +01:00
Aleksei.Cherepanov c120b185af Regenerate and mute JPS+K2 Tests
#KT-55195 Related
2023-01-11 15:35:16 +01:00
Pavel Mikhailovskii bec76db7b3 Update year in autogenerated test files 2023-01-11 11:26:23 +00:00
Aleksei.Cherepanov 671aa68ad6 Add K2 tests for JPS with different configuration (K2, LightTree and Fir-IC)
*Enable JPS tests for K2
*Exclude compiler messages from the comparison of output logs, as they can vary depending on the compiler
*Mute failing tests:
  1) Sam conversions - Unmute after updating IntelliJ core up to 212, as they should pass after updating IntelliJ JPS dependency
  2) Failing IC tests with Java-interop, that are needed to be fixed during KT-55696
  3) Failing IC tests with recording different sets of lookups by the compiler, that are needed to be fixed during KT-55195
  4) Failing AllConstants, will be changed in KT-54991
*Fix test data:
  1) Add cleaned outputs for JPS, because Gradle skips error messages at all
  2) Rename gradle-fir-build.log to fir-build.log, because JPS also can use it and there is no need to duplicate files
  3) Add some k2-specific logs, that changed the set of files in different rounds in comparison with the old compiler, but the scope stays the same
  4) Remove useless logs and obsolete directives.txt files as they have no impact on test results
  5) Replace fir-build.log files with gradle-fir-build.log because Gradle build with FIR is correct, but not optimal. JPS with K2 is now tested with fir-build.log files
  6) Remove useless fir-log, as it duplicates the main build log, and Remove empty directives file

#KT-54991 In Progress

Merge-request: KT-MR-8174
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
2023-01-10 14:31:55 +00:00
Alexander Udalov 3c4b5529af Update year to 2023 in COPYRIGHT_HEADER.txt
This commit is the result of changing the year to 2023 in
COPYRIGHT_HEADER.txt and running all `generate*` tasks in
`generators/build.gradle.kts`.
2023-01-02 22:52:15 +01:00
Alexander Udalov 7a9c59aeb5 JVM IR: do not serialize metadata for actualized optional expectations
Optional-expectation annotations which have an actual counterpart should
have never been serialized to the kotlin_module's proto. See for example
the original (correct) implementation in the old JVM backend in
`PackageCodegenImpl.addDescriptorToOptionalAnnotationsIfNeeded`.

 #KT-55611 Fixed
2023-01-02 15:30:27 +00:00
Alexander Udalov 3f2b51151f Remove -Xexclude-from-dumping
Apparently the underlying logic was removed in b07690fccf and no one
noticed.
2023-01-02 15:26:07 +00:00
Artem Kobzar fbf06b5495 [K/JS] Add a secret system property to enable the old Kotlin/JS compiler only for tests until it will be removed from the sources 2022-12-29 13:32:01 +00:00