Commit Graph

377 Commits

Author SHA1 Message Date
Yahor Berdnikau 0cad069522 [Build] Pin api and language level to 1.8 in Kotlin compiler modules used by KGP
This is required to be able to compile KGP and it's dependencies which
set LV to 1.4 when repo will use LV 1.9. This caused by the change how
enums are compiled (KT-48872).
2023-02-18 13:26:54 +00:00
Alexander.Likhachev 06fb658887 [Build] Remove remaining obsolete files of the new daemon
KT-50846 Related
2023-02-07 14:45:35 +00:00
Dmitriy Novozhilov 88efa6bfb6 Update tests after switching to LV 1.9 2023-01-30 09:29:57 +00:00
Alexander Likhachev 20ed029ba5 [Gradle, IC] Add gradle property to control precise compilation outputs backup
#KT-49785 In Progress
2023-01-17 22:15:52 +00:00
Denis.Zharkov d3549c2c5b Optimize CoreJrtFileSystem
Do not recompute children on each file request
At the same time, we should clear the roots after each compilation
just the same way as we do for common jars
2022-12-29 09:59:16 +00:00
Andrey Uskov 1550a37b17 Cleanup: remove deprecated methods from Kotlin daemon 2022-12-05 16:02:04 +00:00
Andrey Uskov c9e0100214 Remove experimental implementation of Kotlin Compiler Daemon
#KT-50846 Fixed
2022-12-05 16:02:03 +00:00
Andrey Uskov 41ff283856 Don't call File.getCanonicalPath in KGP
Relates to KT-54579.
2022-12-04 18:49:30 +00:00
nataliya.valtman 70fb18e160 KT-54941: Use Debug level for process launch fallback reason 2022-12-02 17:42:23 +01:00
Ilya Chernikov 23144b92d8 Fix FastJarFS caches cleaning
- add FastJarFS cache cleaning to the daemon implementation, so
the behavior is now the same as for CoreJarFS
- clear not only mappings but also handlers cache: this may result some
slowdown on comparison with the previous cleaning implementation,
but should avoid unreliable behavior on heavy parallel build usages.
2022-10-31 16:02:50 +00:00
nataliya.valtman 2379185398 Log daemon exception for In process compilation into error.log 2022-10-14 15:41:48 +00:00
Hung Nguyen def886cd31 Clean up fall-back logic in IncrementalCompilerRunner
Make it clear that there 3 distinct cases:
   1. Incremental compilation completed with an ExitCode.
   2. Incremental compilation was not possible for some valid reason
      (e.g., for a clean build), and we will perform non-incremental
      compilation.
   3. Incremental compilation failed with an exception.
      In this case, we will:
        - Print a warning with a stack trace
        - Ask the user to file a bug
        - Collect rebuild reason enum for analytics
           + TODO: Collect the stack trace too
        - Fall back to non-incremental compilation

Test: Existing BaseIncrementalCompilationMultiProjectIT.testFailureHandling_UserError,
      Updated BaseIncrementalCompilationMultiProjectIT.testFailureHandling_ToolError

^KT-53015: In progress
2022-09-19 07:33:16 +03:00
Abduqodiri Qurbonzoda dce62275c6 Fix daemon-common-new compile 2022-09-17 01:06:56 +00: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 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
Aleksei.Cherepanov df017ea187 Clean JavaClassesTracker and LookupTracker on call RetryWithAdditionalRoots
#KT-38576 Fixed
2022-08-16 14:38:01 +00:00
Hung Nguyen 5b6afef67d Rename ICReporter.report/reportVerbose to info/debug
to make it clear what severity levels they are mapped to.

^KT-52839 Fixed
2022-07-15 10:48:34 +00:00
Hung Nguyen e01c2bc651 Warn in Gradle log when incremental compilation fails
When incremental compilation fails, we currently log it at the `debug`
level (and fall back to non-incremental compilation). This commit will
change it to `warning` so that we can get more user reports, which will
allow us to fix the root cause.

Also make sure the warning includes a stack trace.

Additionally, let ReportSeverity.fromCode() return a non-null value
or throw an exception otherwise as that case is not expected.

^KT-52839 In Progress
2022-07-15 10:48:34 +00:00
Dmitriy Novozhilov 1a8496757e [Compiler] Mark all entrypoints to compiler API as experimental 2022-06-29 12:00:01 +00:00
Dmitriy Novozhilov f587c02d38 [FE] Move ServiceLoaderLite to :compiler:frontend.common
This is needed to be able to use this class inside FIR part of IDE plugin
2022-06-29 12:00:00 +00:00
Dmitriy Novozhilov c979e1edcf [Plugins] Deprecate ComponentRegistrar
^KT-52665 In Progress
2022-06-29 11:59:58 +00:00
Dmitriy Novozhilov 8b42638afa [Plugins] Introduce new API for registering compiler plugins
Original `ComponentRegistrar` exposes Project to its registration method,
  so plugins should manually register extensions to it. To prepare for
  possible unbound compiler from Project API in future new  `K2ComponentRegistrar`
  introduced which provides registration method without Project at all
2022-06-29 11:59:58 +00:00
Nikita Bobko 69cf454747 Drop org.jline and org.fusesource.jansi redundant dependencies
Reasons:
1. Those modules don't use this dependency
2. Unbundled JPS feature in IDE downloads all transitive dependencies of
   kotlin-dist-for-jps-meta => downloads org.jline and puts it into dist
   which is not needed
2022-05-30 17:09:28 +02:00
Aleksei.Cherepanov 3d8f140d6b [JPS] Fix incremental build after changing Java enum used in Kotlin when
EnumWhenTracker implemented for tracking changed java enum class items, that used in kotlin when expression.

#KT-47824 Fixed
2022-04-19 18:39:41 +00:00
Ilya Chernikov f89765eb33 Make JDK classpath roots configuration explicit...
instead of relying on the "configuration files" parameter.
(in the process of migration from KotlinCoreEnvironment).
2022-03-30 08:32:56 +00:00
Hung Nguyen d70dbf3146 KT-45777: Add debug log messages for classpath snapshot feature
Also clean up classpath snapshot shrinking a bit to make it clearer.

^KT-45777 In Progress
2022-03-29 11:36:40 +00:00
nataliya.valtman c38dd1c004 Fix unstable testIncrementalCompilationAfterCacheHit test 2022-03-14 20:08:14 +03:00
Andrey Uskov 2adc851f1b Don't use global state for keeping incremental compilation state
Previously IC state was stored in System properties. As result parallel
compilation might cause incorrect state of IC, what led to corruption
of kotlin_module files. Now IC state is stored via CompilerArguments
and CompilerConfiguration
#KT-46038 Fixed
2022-01-12 13:37:46 +03:00
Andrey Uskov e37ab3dfda Fix calculation of Kotlin Daemon alive timeout
#KT-48779 Fixed
2022-01-10 11:29:26 +03:00
Vyacheslav Gerasimov f7a9065b75 Build: Use intellij maven repo instead of downloaded IDEA
#KTI-82
2021-12-16 21:48:23 +03:00
Vyacheslav Gerasimov bc2f0936bd Build: Rename commonDep -> commonDependency 2021-12-16 21:48:19 +03:00
Vyacheslav Gerasimov f91d6958a8 Build: Rework runtimeJar helper and drop redundant configuration
#KTI-559
2021-09-26 20:10:29 +03:00
Vyacheslav Gerasimov ab146bd6d4 Build: Fix deprecated Gradle configurations usages
for migration to Gradle 7+ #KTI-559
2021-09-26 18:28:44 +03:00
Aleksei.Cherepanov 47a1dd27dd Fix after review KT-CR-4441 of cc5382b3
Simplify API of InlineConstTracker
In ConstLowering: Move transformer logic to another class to avoid mutable state. Avoid marking all files in module as module. Support of inner classes.

#KT-46506 Fixed
2021-09-22 01:55:18 +03:00
Alexander Likhachev 612b96bd54 [Daemon] Introduce the way to get Kotlin daemon compiler version
#KT-48294 In Progress
2021-09-16 13:25:18 +00:00
Aleksei.Cherepanov cc5382b37e [JPS] Fix incremental build after changing Java constant
InlineConstantTracker implemented for tracking changed java static final constants, that used in kotlin.

#KT-46506 Fixed
2021-09-11 13:00:00 +03:00
Mikhail Glukhikh ed035d99ab Migrate -Xopt-in to -opt-in in Gradle Kotlin scripts 2021-09-03 15:40:47 +03:00
Dmitriy Novozhilov d46e2dd749 Fix OVERRIDE_DEPRECATION warnings in project code 2021-09-02 15:04:07 +03:00
nataliya.valtman 260d301100 Report compiler performance data to ES 2021-08-24 16:33:13 +03:00
Stanislav Erokhin 9becb2c468 Add compiler performance metrics
WIP
2021-08-24 16:33:12 +03:00
nataliya.valtman 64da19cb2d Add Artifact Transform stat into ES 2021-08-24 16:33:11 +03:00
Alexander Udalov 11902c7f8f Fix warnings in daemon-related modules 2021-08-06 22:36:59 +02:00
Mikhael Bogdanov 228100ef09 Upgrade toolchain to api/lv 1.4 2021-07-29 19:45:53 +02:00
Alexander Udalov 698c0bb2a9 Replace --illegal-access workaround with --add-exports
--illegal-access=permit doesn't work since JDK 17.

 #KT-47152 Fixed
2021-07-26 19:27:09 +02:00
Denis.Zharkov d6adac8dd0 Move FastJarFileSystem to ProjectEnvironment and link to the root disposable 2021-07-23 21:38:45 +03:00
Denis.Zharkov c6525974d0 Move handlers cache from static field to the instance of FastJarFileSystem 2021-07-23 21:38:43 +03:00
Denis.Zharkov 4e11c670c6 Clear cleanFileAccessorsCache for FastJarFileSystem 2021-07-23 21:38:41 +03:00
Hung Nguyen 41345b2c50 Pass classpath changes from KotlinCompile task to Kotlin compiler
This commit wires necessary components only. The actual classpath
changes will be provided later.

Bug: KT-45777
Test: Existing IncrementalCompilationClasspathSnapshotJvmMultiProjectIT
      and IncrementalJavaChangeClasspathSnapshotIT
2021-07-20 04:04:43 +03:00
Alexander Udalov e7b37d99cb Fix new compiler warnings in daemon and build-common 2021-07-06 13:31:21 +02:00
Roman Artemev b8e5185b61 [KLIB] Add extra debug information for Local signatures 2021-07-01 17:40:37 +03:00