Commit Graph

311 Commits

Author SHA1 Message Date
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
Denis.Zharkov 4fffe7b9c8 FIR: Fix VerifyError caused by private delegates
^KT-45048 Fixed
2021-02-25 19:30:15 +03:00
Ivan Gavrilovic 2fce6a4af9 Locate build history when file is outside of root project dir
Support use-cases when the build dir is outside of root project dir.
Many projects set up output dir as <root_project>/../out/<project_name>/build
to be able to clean build dir more easily. This commit adds support
to build history file detection and it tries to find build history
files for artifacts that are:
- under root project dir (a default structure)
- under root project's build dir parent (to support typical custom setup)

Fixes https://youtrack.jetbrains.com/issue/KT-40875

Test: BaseIncrementalCompilationMultiProjectIT
2021-02-02 12:47:07 +03:00
Denis.Zharkov 7e6abffb62 FIR: Fix incorrectly serialized type
See the test added: there's a non-denotable T!! type inside flexible type
that wasn't handled before.

ConeKotlinType::contains handles flexible types content and some other cases
Also, it has better asymptotics
2021-01-29 10:50:23 +03:00
Alexander Udalov 1deb317e0d Update and regenerate incremental compilation tests for 1.5
Set TargetBackend.JVM_IR for these tests by default; remove the
generated IR-based test and add a new old-backend-based test. This fixes
the issue where some (3) of these tests were not properly ignored
because of incorrect target backend used in the test generator.

Also update test data for some tests which use local functions, which
are not generated to separate anonymous classes in JVM IR.
2021-01-28 13:19:27 +03:00
Roman Artemev 350ff8033d [IC KLIB] Replace JS IR build log with KLIB build log for klib compialtion
- fix test data
2021-01-26 19:23:25 +03:00
Roman Artemev 04777d2ff2 [IC TEST] Generate legacy js multi module IC tests 2021-01-26 19:23:24 +03:00
Roman Artemev 898c0470dc [IC TEST] Implement legacy js multi module gradle-like test infra 2021-01-26 19:23:24 +03:00
Roman Artemev 43022a292d [IC TEST] Abstract multi module test runner from klib 2021-01-26 19:23:24 +03:00