Commit Graph

112 Commits

Author SHA1 Message Date
Alexander.Likhachev 2c8501eb10 [Daemon] Add unit tests for LastDaemonCliOutputsTest 2023-12-05 13:51:14 +00:00
Alexander.Likhachev 3ca1249926 [Daemon] Add unit tests for LimitedLinkedList 2023-12-05 13:51:14 +00:00
Alexander.Likhachev f7b139466d [Build] Move the daemon client sources into the default directory 2023-12-05 13:51:14 +00:00
Alexander.Likhachev b000b66ef7 [Daemon] Improve some daemon log messages
A few messages were improved:
  * If the daemon process died at the startup, add its last 10 lines of the output to the log and report to the EXCEPTION (ERROR in the case of Gradle) level
  * If some exception occurs during connection attempt, add its stacktrace and report to the EXCEPTION (ERROR in the case of Gradle) level
  * Added more DEBUG level messages
  * Some important messages are moved to the INFO level
  * Added a suggestion to report issue to kotl.in/issue
^KT-55322 Fixed
2023-12-05 13:51:14 +00:00
Alexander.Likhachev 8ceee3e8b9 [Daemon] Improve daemon connection algorithm
Before this change, the logic was to find the most suitable daemon and try connecting to it in a loop, ignoring the fact that it could be dying. Now, instead of trying to connect to the daemon dying daemon in a loop, we will make only 1 attemp and then skip if it's already dying.
^KT-55322 In Progress
2023-12-05 13:51:14 +00:00
Alexander.Likhachev 44d6807aba [Daemon] Fix deprecation warning in KotlinCompilerClient.kt 2023-12-05 13:51:14 +00:00
Alexander.Likhachev 02b1f9854f [Daemon] Apply autoformatting to KotlinCompilerClient.kt 2023-12-05 13:51:14 +00:00
Aleksei.Cherepanov 68af705664 Add import tracker
This tracker reports import directives to IJ's JPS to track changes and detectwehen it is needed to adjust compilation scope.

#KT-44835 Fixed
2023-08-30 12:42:39 +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
nataliya.valtman 70fb18e160 KT-54941: Use Debug level for process launch fallback reason 2022-12-02 17:42:23 +01:00
nataliya.valtman 2379185398 Log daemon exception for In process compilation into error.log 2022-10-14 15:41:48 +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
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
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
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
Alexander Udalov 11902c7f8f Fix warnings in daemon-related modules 2021-08-06 22:36:59 +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
Andrey Uskov 92b08dfcfb Revert "Unify the way to set compiler options using System.properties"
This reverts commit 28e4e775
2021-06-23 11:34:04 +03:00
Andrey Uskov 28e4e77542 Unify the way to set compiler options using System.properties
Now compiler flags with boolean values which are controlled by system
properties could be set in similar way. The following syntax is
appropriate. For setting flag:
'-DflagName,'-DflagName=[y|Y|true|TRUE|yes|YES|on|ON]'
for unsetting flag:
'-DflagName=[n|N|false|FALSE|no|NO|off|OFF]'
2021-06-22 19:35:28 +03:00
Yahor Berdnikau 1bb64ffa22 Revert "Print path to java executable Kotlin daemon was started with."
This reverts commit 3e69bcba474d498c74a0e9827aa833f2381d43d8.
2021-06-18 10:50:22 +00:00
Yahor Berdnikau f9ec6bb66a Revert "Optionally make java executable path contribute to the daemon id."
This reverts commit ac86ad252f.
2021-06-18 10:50:21 +00:00
Yahor Berdnikau 201b6dfa60 Print path to java executable Kotlin daemon was started with.
Useful for tests to validate toolchain correct behaviour.

^KT-45611 In Progress
2021-04-29 20:43:57 +03:00
Yahor Berdnikau ac86ad252f Optionally make java executable path contribute to the daemon id.
This change will allow to start Kotlin daemon instances using different
from the current user JDK version and use it to compile Kotlin files.
Old behaviour, when java executable path is not set, is still working
 and still,by default, using current user JDK version.

For example, user for some reason wants to use JDK 1.8 as active one,
 but compile current project using JDK 16.

Main goal is to support Gradle toolchains.

^KT-45611 In Progress
2021-04-24 11:12:47 +03:00
Alexander Likhachev 16dc0a7d29 [Gradle] Read more system properties through Gradle providers
Related to #KT-43605
2021-04-08 14:28:05 +03:00
Alexander Likhachev 3537c699b5 [Gradle] Read system properties at configuration time using Gradle providers
The change is a step to fully support Gradle configuration cache.
Relates to #KT-43605
Relates to #KT-44611
2021-03-04 19:36:11 +03:00
Alexander Udalov 80daf120e6 Apply illegal-access=permit workaround for JDK 16+
Apparently, the openjdk commit that enabled JEP 396 (encapsulated JDK
defaults) is effective since jdk-16+28:

https://github.com/openjdk/jdk/commit/ed4c4ee7
2021-02-11 12:12:39 +01:00
Alexander Udalov e7cf34a2a9 Workaround illegal access problem in daemon for JDK 17-ea
Otherwise Kotlin cannot be used in Gradle since
https://github.com/openjdk/jdk/commit/ed4c4ee7 where JDK internals
started to be encapsulated by default.

For some reason, using

    listOf("--add-opens", "java.base/java.util=ALL-UNNAMED")

doesn't help, so use the more general `--illegal-access=permit`.

 #KT-43704
2021-01-29 21:29:08 +01:00
Ilya Gorbunov 090b562db7 Use NIO Files for creating temp files: scripting, daemon, main-kts 2020-11-20 06:09:37 +03:00
Alexander Udalov 425b192a5f Fix warnings in build-common/daemon code 2020-08-20 14:58:11 +02:00
Ilya Muradyan 9db9e2ad57 Fix build error messages 2020-06-16 13:34:40 +02:00
Ilya Chernikov c2eaa3d955 Fix ThreadDeath exception on stopping daemon thread
#KT-30086 fixed
2020-04-21 16:49:10 +02:00
Anton Bannykh c3170d1908 JS: cache metadata, grouped by package FQN 2019-05-28 23:33:17 +03:00
Vadim Brilyantov ced973b707 Introduce new Kotlin Daemon without RMI abstraction 2019-05-17 15:51:51 +03:00
Anton Bannykh 4b39e2df12 JS: (review fix) Header -> InlineData 2019-02-14 15:14:28 +03:00
Anton Bannykh 6d26bf9622 JS: don't load binary AST unless required by the inliner 2019-02-14 15:14:28 +03:00
Alexey Tsvetkov 12e481192a Don't use project root as working directory for Kotlin daemon
On windows using a project's root
as a working directory for the daemon
seems to prevent removing the directory
when the daemon runs.

Different projects may share an instance of the daemon,
so the issue will be present only in a project
which started the daemon.
2019-01-21 22:42:55 +03:00
Alexander Udalov 4122021090 Add BinaryVersion to DeserializationContext
This will be useful to implement version-dependent deserialization,
which is needed for gradual fixes of issues in metadata

 #KT-25120 In Progress
2018-07-18 17:58:46 +02:00
Sergey Rostov ce96c1b9a8 jps, daemon: fix javascript inline functions tracking
inline function hash should computed after compilation
2018-06-08 09:46:50 +03:00
Sergey Rostov 1cbef873ec jps: implement mpp and js daemon compiler services
#KT-24635 fixed
2018-06-08 09:46:41 +03:00
Alexey Tsvetkov d1d786dffa Fix lookup tracking in JPS with enabled daemon
#KT-21962 fixed
2018-01-16 21:09:57 +03:00
Ilya Chernikov 6f135e89d7 Make daemon starting more tolerant to the failures - retry
(cherry picked from commit 386cfec)
2018-01-10 13:38:20 +01:00
Ilya Chernikov 775eeb75c9 Treat daemon startup timeout/error exceptions the same way as RMI errors
will result on regular retry cycle on them, hopefully eliminating or
reducing appropriate exception reports
2017-12-15 15:24:38 +01:00
Nikolay Krasko 97c1e58149 Minor: reformat too long lines 2017-11-15 16:12:37 +03:00
Mikhail Glukhikh 3623f581b8 Eliminate a set of warnings, mostly nullability ones 2017-08-18 15:10:27 +03:00
Alexey Tsvetkov bb2fab5b5d Extract LookupTracker service from IncrementalCompilationComponents
We don't need a `TargetId` to `IncrementalCache` mapping in JS
2017-08-10 21:19:42 +03:00
Alexey Tsvetkov 62fdd91947 Remove old IC: remove unnecessary caches 2017-07-31 19:34:58 +03:00
Ilya Chernikov fc12f37105 Rolling back commits related to Unit -> Void? confersion in RMI interface
since it breaks the compatibility and doesn't actually help - the problem
with NoClassDef Unit is apparently elsewhere.
2017-07-11 15:06:38 +02:00
Ilya Chernikov 21eed9ee78 Get rid of kotlin.Unit usage in RMI interfaces
attempt to fight mysterous "Cannot instantiate kotlin.Unit" exception.
2017-07-08 18:16:29 +02:00
Ilya Chernikov 06d27a9efa Fix failing tests on TC on Windows by falling back to standard launcher
...in one more case
Plus some minor test tweaks, diagnostics improvement and important comments
2017-07-08 18:16:28 +02:00