Commit Graph

45 Commits

Author SHA1 Message Date
Nataliya.Valtman 5885514c3d Add JSON output type for build reports
#KT-65792 Fixed
2024-02-27 08:32:36 +00:00
Nataliya.Valtman 090407b7e3 Add compiler IRMeasurement to build reports
#KT-65091: Fixed
2024-02-15 07:51:51 +00:00
Alexander.Likhachev 5d98758645 [BTA] Add KDoc for CompilationService.calculateClasspathSnapshot 2024-02-09 18:33:30 +00:00
Alexander.Likhachev 10cedd495d [BTA] Add Kotlin version getter into CompilationService
^KT-62921 In Progress
2024-02-08 19:11:26 +00:00
Evgenii Mazhukin de4953adf6 [IC] Baseline fix for common sources getting access to platform declarations
K2-only issue. In an incremental build, sourceSet boundary isn't
preserved in certain conditions:

SourceSet A depends on SourceSet B
A and B overload a function, for example:

A -> fun foo(p: Parent) // (1)
B -> fun foo(c: Child) // (2)

If some source file in A is calling foo(..), only (1) is supposed to be visible
for that call site.

However, if

a) it is an incremental build,
b) the declaration of (1) is not a part of the compilation set, and
c) call to foo(c: Child) is applicable,

then (2) would be called from the generated code. So, the build result is not
consistent between the full build and an incremental build.

As a workaround, we fallback to a non-incremental build, if any source from A
needs to be compiled.

To enable "risky" incremental builds, use Gradle property
kotlin.internal.incremental.enableUnsafeOptimizationsForMultiplatform=true

^KT-62686
^KT-63837 Fixed


Merge-request: KT-MR-13695
Merged-by: Evgenii Mazhukin <evgenii.mazhukin@jetbrains.com>
2024-01-08 20:03:08 +00:00
Evgenii Mazhukin ee3119e9d2 [KGP] Introduce Incremental Compilation Feature Toggles
Makes it easier to introduce a Gradle property for configuring
IncrementalCompilerRunner.

^KT-64513 Fixed
^KT-63837 In Progress


Merge-request: KT-MR-13671
Merged-by: Evgenii Mazhukin <evgenii.mazhukin@jetbrains.com>
2023-12-27 13:43:54 +00:00
Alexander.Likhachev 95bc49054f [BT] Release daemon compile session right after compilation is finished
^KT-55322 In Progress
2023-12-05 13:51:14 +00:00
Nataliya.Valtman 4294c7bab7 Add limitation for changed files list for JPS build report
#KT-63549
2023-12-04 18:19:15 +00:00
Nataliya.Valtman 6bbf5b83c8 Add compiler metrics to JPS build report
#KT-63549: Fixed
2023-11-22 11:30:08 +00:00
Alexander.Likhachev 3eaaed8e7f [BT] Add debug logging for compilation iterations 2023-10-23 13:04:17 +00:00
Alexander.Likhachev ad4f4cbd28 [BT] Clear jar caches after project compilation 2023-10-23 13:04:17 +00:00
Alexander.Likhachev b460c06907 [BT] Add support for in-process incremental compilation
#KT-61865 Fixed
2023-10-23 13:04:17 +00:00
Alexander.Likhachev 6eaccc997f [Build] Fix the typo junit jupyter -> jupiter 2023-09-06 22:47:34 +00:00
Alexander.Likhachev 6f96be0b76 [Build] Get rid of the testApiJUnit5 method
#KTI-1349 In Progress
2023-09-06 22:47:34 +00:00
Alexander.Likhachev 2570be129f [Gradle, BT] Move script definitions scanning into the build tools API
#KT-61449 In Progress
2023-08-29 13:00:15 +00:00
Alexander.Likhachev 6cfa165ddb [Gradle, Build] Publish an artifact with unpublished compiler modules for KGP
#KT-61449 In Progress
2023-08-29 13:00:15 +00:00
Alexander.Likhachev 3fb1f7bf42 [Gradle] Migrate from ChangesFiles to SourcesChanges
It allows getting rid of the dependency on `:compiler:incremental-compilation-impl`
#KT-61449 In Progress
2023-08-29 13:00:15 +00:00
Alexander.Likhachev 797ca34a34 [BT] Use bootstrap classloader as a fallback instead of system classloader
Using system classloader may lead to unwanted leakage of classes from the application classpath (like Gradle's ones).
#KT-61206 Fixed
2023-08-21 18:09:49 +00:00
Alexander.Likhachev 4705f13b39 [BT] Add a test for KT-61206 2023-08-21 18:09:49 +00:00
Hung Nguyen 894ba9ab80 [IC] Relocatable IC caches for projects with custom buildDir
IC caches often contain file paths. To make them relocatable, we need
to convert these file paths into relative paths, relative to a base
directory.
  - If the file paths are source files, we can use the root project
    directory as base.
  - If the file paths are class files, we should use the classes
    directory as base (before this commit, we used the root project
    directory in both cases, that's why we hit KT-58547).

The key changes in this commit include:
  - RelocatableFileToPathConverter: converts paths to relative paths
  - IncrementalCompilationContext: contains 2 different path converters,
    one for source files and one for class files
  - SourceToOutputFilesMap: maps source files to class files using the
    above path converters
  - IncrementalCompilerRunner: creates the path converters based on file
    locations

Test: RelocatableFileToPathConverterTest unit test
      SourceToOutputFilesMapTest unit test
      BuildCacheRelocationIT.testCustomBuildDirectory integration test
^KT-58547 Fixed
2023-08-16 13:40:19 +00:00
Nataliya.Valtman 2719dd188f Added build metrics for Kotlin/Native tasks
#KT-58315 Fixed

Co-authored-by: Nataliya Valtman <Nataliya.Valtman@jetbrains.com>


Merge-request: KT-MR-11343
Merged-by: Dmitrii Krasnov <Dmitrii.Krasnov@jetbrains.com>
2023-08-08 07:43:18 +00:00
Alexander.Likhachev 83c53b7ce3 [BT] Implement classpath snapshotting in the Build Tools API
#KT-57565 In Progress
2023-08-03 08:55:32 +00:00
Alexander.Likhachev 329fd6be45 [BT] Move ClassSnapshotGranularity to the Build Tools API module
#KT-57565 In Progress
2023-08-03 08:55:32 +00:00
Alexander.Likhachev 61f404e493 [BT] Implement incremental compilation within the daemon
#KT-57398 In Progress
2023-08-01 16:24:37 +00:00
Alexander.Likhachev 18aa7f4d4b [BT] Implement non-incremental compilation within the daemon
#KT-57398 In Progress
2023-07-31 10:38:35 +00:00
Nataliya.Valtman fb04356829 Add JPS iteration metric
#KT-58026 In progress


Co-authored-by: Nataliya Valtman <Nataliya.Valtman@jetbrains.com>


Merge-request: KT-MR-11365
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
2023-07-31 09:15:28 +00:00
Alexander.Likhachev 175c00e5c7 [BT] Introduce the project build uuid
This allows to perform some cleanups after the entire project build finished.
#KT-57398 In Progress
2023-07-28 15:48:28 +00:00
Alexander.Likhachev 28c059f25b [BT] Implement basic non-incremental in-process JVM compilation 2023-07-28 15:48:28 +00:00
Alexander.Likhachev 6356a40fe8 [BT] Introduce KotlinBuildToolsException
#KT-57398 In Progress
2023-07-28 15:48:28 +00:00
Alexander.Likhachev b3fbe4c484 [BT] Introduce CompilationResult
#KT-57398 In Progress
2023-07-28 15:48:28 +00:00
Nataliya.Valtman ed2dd4b2ae Split Gradle and JPS metrics
#KT-58026 In progress
2023-07-27 11:18:54 +00:00
Alexander.Likhachev bfb314adcb [BT] Mark the Build Tools API as experimental 2023-06-23 12:34:23 +00:00
Alexander.Likhachev 5993e4bce4 [BT] Introduce JVM compilation API 2023-06-23 12:34:23 +00:00
Alexander.Likhachev 2412693ef0 [BT] Move KotlinLogger to the bt-api module
#KT-57398 In Progress
2023-06-23 12:34:23 +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
Nataliya.Valtman f87fdb43fa KT-57224: Add kotlin language version to file report 2023-05-15 16:23:59 +00:00
Yahor Berdnikau 1860683a71 Fix explicit api issues in kotlin-build-tools-api
Explicit api mode was not working due to the bug.

^KT-57653
2023-05-08 19:43:43 +00:00
Nataliya.Valtman 71e81aa30e Fix build reports when no kotlin task is executed
#KT-58313: Fixed
2023-05-05 10:48:11 +00:00
Hung Nguyen 37d6606852 IC: Load one class at a time when snapshotting classpath
Previously, when snapshotting the classpath with
`ClasspathEntrySnapshotTransform`, for each jar we load all classes
in memory at once. This was needed to detect inaccessible classes
(classes that don't impact incremental compilation and therefore
don't need to be snapshotted).

To reduce memory consumption, this commit updates the algorithm such
that we can now load one class at a time while still being able to
detect inaccessible classes.

In addition, we now read jar files with `java.util.zip.ZipFile` API
instead of `java.util.zip.ZipInputStream` to avoid current JDK bugs with
`ZipInputStream` (e.g., https://bugs.openjdk.org/browse/JDK-8298530).

^KT-57757 Fixed
^KT-57767 Fixed
2023-05-02 19:42:03 +00:00
Nataliya.Valtman 2a391f7330 Move kotlin-build-statistic project to :compiler 2023-04-25 11:29:09 +00:00
Alexander.Likhachev ec4fab57a7 [Build] Add the kotlin- prefix to the build tools API modules names
KT-57396
2023-04-19 09:09:26 +00:00
Alexander.Likhachev 0727ee5a4f [Gradle] Use custom classloader and ServiceLoader to load bt-api implementation
#KT-57397 Fixed
2023-04-18 18:19:25 +00:00
Alexander.Likhachev 9127919e01 [Build] Enable explicit API mode for build-tools-api
#KT-57396 Fixed
2023-04-18 18:19:23 +00:00
Alexander.Likhachev 7d29d34bf9 [Build] Configure binary-compatibility-validator for build-tools-api
#KT-57396 In Progress
2023-04-18 18:19:23 +00:00
Alexander.Likhachev 3a8d7c0839 [Build] Add build-tools-api and build-tools-impl modules
#KT-57396 In Progress
2023-04-18 18:19:23 +00:00