519 Commits

Author SHA1 Message Date
Hung Nguyen 37c6b1c2dc KT-45777: Track build time in nanoseconds instead of milliseconds
to ensure precision (otherwise, rounding errors to milliseconds may
add up and cause unexplainable gaps in the running time).

We can still use milliseconds in the final report after all the precise
sub-build-times have been aggregated.
2022-01-31 19:50:03 +03:00
Nikita Bobko ca716fd226 Regenerate tests 2022-01-12 15:25:16 +01: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
Hung Nguyen 78f10d9142 KT-45777: Keep only package facades whose members are looked up
to reduce the size of the shrunk classpath snapshot further.
2021-12-25 00:20:31 +03:00
Hung Nguyen 9b96dbe2d2 KT-45777: Parse classes only once with ASM
to get both constants and inline functions.

Also add BasicClassInfo to ClassFileWithContents to simplify the code.
2021-12-24 18:31:49 +03:00
Hung Nguyen 9a995af0df KT-44741: Improve handling of constants defined in companion objects 2021-12-24 18:31:49 +03:00
Hung Nguyen a900f2b66d KT-45777: Reorganize unit test data for classpath snapshot feature
to make it easier to add more tests in the next commits.

- Add unit tests for constants and inline functions

Also add tests for different kinds of Kotlin classes: CLASS,
FILE_FACADE, MULTIFILE_CLASS.

-Add unit test for nested classes

Also remove the existing integration test for nested classes to keep the
integration tests focused on the key scenarios while unit tests will
cover the corner cases.

Ignore inline functions that are private
2021-12-24 18:31:49 +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
Hung Nguyen 586fa8af64 KT-45777: Shrink classpath snapshot incrementally
Currently, we shrink classpath snapshots at 2 steps:
  - Classpath diffing: Shrink the current classpath snapshot against
    the previous lookup symbols
  - Classpath snapshot saving: Shrink the current classpath snapshot
    against the current lookup symbols

With this commit, the shrinking at the second step is now incremental.
The shrinking at the first step is still non-incremental.
2021-12-14 13:10:08 +03:00
Dmitriy Novozhilov 8fcb525d75 [Test] Add ability to mute IC tests via fail.txt file
If fail.txt is present in root directory of test then exception from
  test will be muted. If there were no exceptions and fail.txt exists
  then test fail with suggestion to remove fail.txt

Content of fail.txt does not matter, so it can be used to store
  information about why this test doesn't pass
2021-12-03 14:17:41 +03:00
Anastasiya Shadrina d47cf315e7 [Metadata] Add context receivers to metadata.proto
[Tests] Add JvmVersionRequirementTest
2021-12-02 20:24:20 +03:00
Denis.Zharkov 6082f0b712 FIR2IR: Postpone binding overrides for lazy classes until sources processed 2021-12-01 08:32:20 +00:00
Hung Nguyen 6ba1b2cc08 KT-45777: Don't include classpath snapshot dir in task output backup
for performance reasons: (1) the snapshots are too big, and (2) they are
usually updated only at the end of the task execution--in a failed task
run, they are usually unchanged and therefore don't need to be restored.
2021-11-30 13:59:19 +03:00
Hung Nguyen 062a8fe56f KT-45777: Ignore Kotlin synthetic classes when computing classpath changes 2021-11-30 13:59:17 +03:00
Hung Nguyen 2b65d673bb KT-45777: Also collect added classes/class members as classpath changes
as they can impact recompilation (examples shown in the code comments).

Test: Updated ClasspathChangesComputerTest
2021-11-30 13:59:17 +03:00
Hung Nguyen 6bee7948e7 KT-45777: Don't compute snapshots for inaccessible classes
Also visit a class file with ASM once to extract all information we need
in advance, instead of visiting the class file each time some piece of
info is needed.
2021-11-30 13:59:14 +03:00
Hung Nguyen f52be5f471 KT-45777: Move classpath diffing to incremental Kotlin compiler (2/2)
as we need access to the lookup tracker to compute classpath changes
more efficiently and reduce the size of the saved classpath snapshot.

The previous commit only changed the files' paths, this
commit actually updates the files' contents.

Note that classpath snapshotting still happens in Gradle artifact
transforms. (However, the previous commit also moved the code for
classpath snapshotting together with the code for classpath diffing as
they are closely related.)
2021-11-30 13:59:13 +03:00
Hung Nguyen dfaf195e1d KT-45777: Move classpath diffing to incremental Kotlin compiler (1/2)
This commit only changes the files' paths, the next commit will update
the files' contents.

See the next commit for more context.
2021-11-30 13:59:12 +03:00
Ilya Chernikov f324a81de7 Implement (failing) test for FIR IC - as in KT-49750 2021-11-19 08:36:15 +01:00
Aleksei.Cherepanov 276fb77155 Fix incremental build after changing Java const used as class property
Report Java static final constant with InlineConstantTracker, used as class property in Kotlin for further registration in JPS

#KT-49177 Fixed
2021-10-20 15:06:19 +03:00
Dmitriy Novozhilov e933c7b6d9 [Build] Remove testApi(intellijDep()) dependencies from all modules
Since IDEA moved most of it's jars to java 11 it's illegal to use them
  in our dependencies, so all modules which use `intellijDep()` should
  carefully specify which jars they use
2021-09-30 14:41:31 +03:00
nataliya.valtman 452dfd6edd Use default performance manager for K2JVMCompiler 2021-09-28 09:20:50 +00: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
Hung Nguyen f400305cc6 KT-45777: Handle problematic classes when taking snapshots
There are certain classes that we are not yet able to take snapshots of,
either because the class is faulty, or there is a bug in our code.

For these classes, we will use a special snapshot and fall back to the
existing approach to compute classpath changes.

In the short run, we will update this list of cases as they arise. In
the long run, we will:
  - Fix all cases that are caused by bugs in our code.
  - Decide what to with the faulty jars in general and remove the list.

Test: The following should pass
  - Step 1: ./gradlew publish
  - Step 2: ./gradlew publish -Pbootstrap.local=true
              -Pbootstrap.local.path=/path/to/kotlin/build/repo
              -Pkotlin.incremental.useClasspathSnapshot=true
2021-09-23 12:47:51 +03:00
nataliya.valtman 130fd8311e KT-48620: add readable output size metric into build scan 2021-09-14 17:56:11 +03:00
Hung Nguyen a48bf63630 KT-45777: Compute classpath changes for incremental Kotlin compile
Test: Updated unit tests + incremental compilation integration tests
2021-09-14 12:10:38 +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
Victor Petukhov d730db094a Don't look at raw type's arguments while enhancing super types
^KT-48172 Fixed
2021-08-20 13:10:45 +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
Roman Artemev ece9307471 [JS IR] Fix destination directory in Incremental compiler runner for JS 2021-07-13 18:58:56 +03:00
Dmitriy Novozhilov 11faf04a4c [Test] Remove dependencies on IDEA classes from test modules
Some of IDEA services (like in `com.intellij/execution`) was copied,
  because they are used in tests but jars with them compiled with
  jdk 11 and we run our tests on jdk 8, so their bytecode can not
  be read
2021-07-08 13:29:19 +03:00
Yahor Berdnikau 7789054547 Migrate repo to use JVM toolchains Gradle feature.
^KT-46972 Fixed
2021-07-05 14:11:12 +00: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
nataliya.valtman f6b428f271 KT-34862 use abi snapshot instead of build history files
Use jar snapshot instead build history file to avoid using time stamps and support remote gradle cache
2021-06-22 07:48:14 +03:00
Nikolay Krasko 32f811e0ec Build: Cleanup old platforms from the build 2021-06-09 17:43:53 +03:00
Aleksei.Cherepanov b1ab597616 Fix FIR tests after ee45aa6b 2021-06-01 15:59:17 +03:00
Andrey Uskov be097244d4 fixup synchronizations 2021-05-31 20:23:54 +03:00
Aleksei.Cherepanov b5ef6c9316 Add tests for SAM conversions
Add tests for KT-45191 [JPS] Marking method as "default" in Java SAM interface doesn't affect dependencies, which was fixed in intlellij(212): cbad0d91 support kotlin-generated lambda usage

#KT-45191 Fixed
2021-04-17 03:36:17 +03:00
Abduqodiri Qurbonzoda 40d1849f33 Migrate compiler, idea and others to new case conversion api 2021-04-08 03:22:02 +03:00
nataliya.valtman bce677f7f7 Generate tests for companion constant changes 2021-04-06 07:13:13 +03:00
nataliya.valtman df08ed2ac0 Recompile files which import companion constant
#KT-44741 Fixed
2021-03-26 10:27:52 +03:00
Ilya Chernikov 14121a1d9a FIR: Disable java tracking in FIR IC
until it is properly implemented,
fixes some IC tests for now, making it less pecise
2021-03-24 21:24:19 +01:00
Ilya Chernikov 7d29ae7cce FIR: add incremental compilation tests 2021-03-24 21:24:18 +01:00
justin.wei 34274dd032 Support relocatable cache for InputCache 2021-03-03 11:25:58 +03:00
Aleksei.Cherepanov 07d11508a7 Generate JvmMultifileClass tests for Gradle 2021-02-26 11:31:17 +03:00
Denis.Zharkov e6b61ecc22 Fix incorrectly generated tests 2021-02-26 10:46:54 +03:00