Commit Graph

91673 Commits

Author SHA1 Message Date
Anton Lakotka c42cedc0d0 [Gradle] Use METADATA attribute when no compatibility variant enabled
Consumer configurations with following set of attributes:

* org.gradle.usage = 'kotlin-api'
* org.jetbrains.kotlin.platform.type = 'common'

are supposed to consume legacy `*.kotlin_metadata` artifacts.
And can be consumed by HMPP project with
"Compatibility Metadata Variant Enabled" flag. For such purpose
`metadataCompileClasspath` configuration is configured with attributes
mentioned above.
There is no sense to consume such artifacts in HMPP projects without
compatibility metadata variant. And in order to prevent
breaking changes in KGP ecosystem, legacy configurations are
reconfigured to consume new KLIB metadata artifacts. Instead of failing
on resolution.

^KT-50925 Verification Pending
2022-03-17 11:13:02 +00:00
Anton Lakotka 9d754d7631 [Gradle][test] Unignore test that fails due to the ^KT-50925
This reverts commit 74ac51a4cb.
2022-03-17 11:13:01 +00:00
Anton Lakotka 32f01999b1 [Gradle] Add test for KT-50925 2022-03-17 11:13:01 +00:00
Yan Zhulanow dd2afb558e Port stub-relating changes from 'master' of IntelliJ 2022-03-17 17:44:55 +09:00
wrongwrong a1b6c9f546 Fixed a bug where DEFAULT_CONSTRUCTOR_MARKER appeared twice as an argument
#KT-27598 Fixed

Co-authored-by: Alexander Udalov <alexander.udalov@jetbrains.com>
2022-03-17 00:54:09 +01:00
Pavel Punegov 5851f757f5 [K/N][build] Add comment about dependency and cross build 2022-03-16 10:46:16 +00:00
Pavel Punegov ce5094e586 [K/N][build] Don't rewrite same stdlib parts during copy 2022-03-16 10:46:16 +00:00
Martin Petrov 2a1d5d3e0a [Native] Explicitly use Foundation in ObjC export. (#4762)
This enables using exported Frameworks with `-fmodules-decluse`.
One use-case for this is ensuring that distributed builds are
explicitly providing all required modules; this is important for
reproducibility.

For more background on `use` declarations, see:
https://clang.llvm.org/docs/Modules.html#use-declaration

The easiest way to reproduce this locally is by compiling a framework,
and emitting a pcm file with `swiftc`. Note that this requires a
reference to a pcm for Foundation, which can be found in the clang
ModuleCache.

```
kotlin-native/dist/bin/kotlinc-native ~/test.kt -produce framework -o /tmp/TestFramework.framework
swiftc -emit-pcm -module-name TestFramework -o /tmp/TestFramework.pcm /tmp/TestFramework.framework/Modules/module.modulemap -Xcc -fmodules-decluse -Xcc -fmodule-file=Foundation=$HOME/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/1IQ2SWDEIAPH0/Foundation-2FJBXN8U6QRTS.pcm
```
2022-03-16 12:15:50 +03:00
Roman Golyshev 7bcd67068c [FIR IDE] Resolve explicit invoke calls more correctly
Also, enable some muted tests

^KTIJ-21343 Fixed
2022-03-15 21:29:36 +03:00
Mads Ager 0c4f2711d6 Avoid reading /tmp/build.txt in standalone compiler invocations.
^KT-51627 Fixed

kotlinc will currently read /tmp/build.txt in an attempt to
determine an IDEA version number for IDEA plugin compatibility
checking. If that file exists and does not match the expected
format kotlinc will fail.

Since standalone kotlinc is not IDEA, this change explicitly
sets the system property for the build number to a fallback
value. That avoids reading /tmp/build.txt.

closes https://github.com/JetBrains/kotlin/pull/4763
2022-03-15 18:37:01 +01:00
Ilya Kirillov 8b8d81cf2f [symbol lc] fix compilation of SymbolLightClassesForLibraryFrontendApiTestConfiguratorService 2022-03-15 19:50:19 +03:00
Jinseong Jeon a106ec6530 Do not create FastJarFileSystem when USE_PSI_CLASS_FILES_READING
because the intention of that configuration is to use "slower" class
reading.

In the near future, even though FIR is enabled, which uses experimental
faster jar file system, FIR clients (e.g., FIR UAST or Android Lint) may
still need to use slower class reading. So, we need to handle that
configuration before checking others.
2022-03-15 19:50:18 +03:00
Jinseong Jeon 24ec1e0cab AA: include root when populating files for scope of KtLibraryModule 2022-03-15 19:50:18 +03:00
Jinseong Jeon 6ec6def8e3 AA: reuse CoreJarFileSystem from KotlinCoreEnvironment in tests 2022-03-15 19:50:17 +03:00
Jinseong Jeon 89725941df AA: showcase an error in resolution to stdlib in standalone mode 2022-03-15 19:50:16 +03:00
Yahor Berdnikau b5a5f25b99 Distribute SimpleKotlinGradleIT test to other tags
^KT-45745 In Progress
2022-03-15 15:19:18 +01:00
Mikhail Glukhikh c051edcbee FIR: add visibility filtering for qualifier resolve #KT-51621 Fixed 2022-03-15 13:21:03 +00:00
Mikhail Glukhikh 3251c474a2 FIR: add test for KT-51621 (qualifiers conflict case) 2022-03-15 13:21:02 +00:00
Mikhail Glukhikh 901336e6e9 FIR: handle ambiguity more precisely during constructor processing 2022-03-15 13:21:02 +00:00
Mikhail Glukhikh 87a7408ddf FIR: handle double-imported qualifiers properly 2022-03-15 13:21:02 +00:00
Mikhail Glukhikh b038ae8b0c FIR: handle double-imported constructors properly 2022-03-15 13:21:01 +00:00
Mikhail Glukhikh bd790b792c FIR: minor code cleanup 2022-03-15 13:21:01 +00:00
Mikhail Glukhikh 0a7da903f4 FE1.0/FIR: add test for "double import" situation 2022-03-15 13:21:00 +00:00
Yahor Berdnikau f5d200e295 Add fake old test
This will allow CI job to not fail with "no tests found" error.

^KT-45745 In Progress
2022-03-15 16:08:44 +03:00
Yahor Berdnikau c4149c2404 Migrate KotlinSpecificDependenciesIT to new test dsl
^KT-45745 In Progress
2022-03-15 16:08:44 +03:00
Mikhail Glukhikh 5810ac01d2 FE1.0/FIR: slightly fix diagnostic messages about OptIn 2022-03-15 13:08:19 +00:00
Mikhail Glukhikh 6b53ac8367 FIR: forbid top-level destructuring declarations #KT-50468 Fixed 2022-03-15 13:08:18 +00:00
Mikhail Glukhikh 6ecc97575d FIR: make deeper recursive type alias expansion check (see KT-37000) 2022-03-15 13:08:18 +00:00
Ilya Goncharov c8237cb5e2 rra/ilgonmic/mocha-fail
[Gradle, JS] Use empty adapter to just dry run

[Gradle, JS] Not dry run, but full run

[Gradle, JS] Fix test to be failed without dry run

[Gradle, JS] Not use client twice

[Gradle, JS] Add test on mocha failing

[Gradle, JS] Fail mocha in case of infrastructure problems

Merge-request: KT-MR-5802
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>

^KT-51623 fixed
2022-03-15 11:18:35 +00:00
Mikhael Bogdanov 41a54241bb Update testdata 2022-03-15 11:38:04 +01:00
Mikhael Bogdanov 15c3dd527c KAPT+IR: Support data classes 2022-03-15 11:38:04 +01:00
Mikhael Bogdanov ceedad40f3 KAPT+IR: Support secondary constructors 2022-03-15 11:38:03 +01:00
Alexander Shabalin 3b2a318c7d [K/N] Generalize Mark queue handling ^KT-51436
Merge-request: KT-MR-5904
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-03-15 10:36:16 +00:00
Alexander Korepanov 69295f2cf0 [JS IR] IC invalidation refactoring
- Huge refactoring for IC
  - Update hash combination logic
  - Introduce value class for IC hashes
  - Calc md5 directly by function IR
  - Split IC logic by classes
  - Move JsIrLinkerLoader into separate file
  - CacheUpdateStatus is a sealed class
  - Render TYPE_PARAMETER reified flag

^KT-51081 Fixed
^KT-51084 Fixed
2022-03-15 05:34:19 +00:00
nataliya.valtman c38dd1c004 Fix unstable testIncrementalCompilationAfterCacheHit test 2022-03-14 20:08:14 +03:00
Ilya Goncharov 0463b5ec3c rra/ilgonmic/duplicated-import-names
[JS IR] Add tests with external funs and global vals

[JS IR] Non module cases are exceptions for naming

[JS IR] Use fqn for jsModule on declaration

[JS IR] Add test on same external names

Merge-request: KT-MR-5901
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>

^KT-51438 fixed
2022-03-14 14:04:27 +00:00
Nikita Bobko a471ddf059 Kotlin JPS: Inject KOTLIN_BUNDLED macro into JPS
KTIJ-21292
2022-03-14 13:53:15 +00:00
Elena Lepilkina f5bd210c08 [K/N] Remove outdated gradlew wrapper 2022-03-14 13:27:46 +00:00
Alexander Shabalin 53de23200d [K/N] Make GC scheduler parametrized by Clock. ^KT-48537 2022-03-14 13:21:40 +00:00
Alexander Shabalin e014e6b154 [K/N] Handle clock wrapping in RepeatedTimer. ^KT-48537 2022-03-14 13:21:39 +00:00
Alexander Shabalin eae9d05f50 [K/N] Add mockable clock. ^KT-48537 2022-03-14 13:21:39 +00:00
Alexander Shabalin e6b7a142b2 [K/N] Implicit constructors for saturating. ^KT-48537 2022-03-14 13:21:38 +00:00
Alexander Shabalin 03b09346a5 [K/N] Intrusive single linked list ^KT-51436
Merge-request: KT-MR-5854
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-03-14 13:20:41 +00:00
Ilya Chernikov 6ae55a98cd FIR2IR: fix annotations conversion for precompiled functions
fixes the case then the function being inlined is taken
from the binaries compiled on the previous iteration, and therefore
should be treated similarly to a fun from a library.
2022-03-14 13:37:50 +03:00
Ilya Chernikov aa0386276d Fix FIR incremental compilation failure with inlines and lambdas
#KT-51546 fixed
2022-03-14 13:37:50 +03:00
Yan Zhulanow 8f1a2f4612 Improve heuristic for filtering synthetic enum methods out
It's not possible to check the exact method signature, as it is
unavailable in dumb stubs for Kotlin's light classes. Yet, it's still
possible to check more things, such as parameter count and access flags.
2022-03-14 17:53:55 +09:00
Yan Zhulanow c334a44e02 Preserve synthetic enum methods in stub-based 'ClsClassImpl'
'ClsClassImpl' instances created by the platform contain synthetic
enum methods (added by 'ClassInnerStuffCache.calcMethods()'). Such
convention is common in IntelliJ (see KT-36095 and
'9a8b345adaded83fe13980a28db5d9f9acc7450d' in the IntelliJ repository).

This commit makes Kotlin's stub-based classes consistent with the
convention. Instead, a filter is added in place of 'ClsClassImpl' usage.

See also the following commits:
- 7c86911f44
- 43468c6d55
2022-03-14 17:53:55 +09:00
Yan Zhulanow fa4dadf9b7 Update KotlinClassInnerStuffCache implementation
'KotlinClassInnerStuffCache' was copy-pasted from the platform's
'ClassInnerStuffCache' several years ago. After J2K and other changes,
it became quite dirty.

Besides cleaning things up, enum synthetic method handling have
significantly improved. Before, such methods were handled only in
'processDeclarationsInEnum', and 'getMethods()' didn't return them.
This led to inconsistent behavior and was reason for providing special
ad-hoc support in '1b6ded600518176b21cc308ed3e032ef8d04cc90'.
2022-03-14 17:53:55 +09:00
Yan Zhulanow 955d0841bd Remove unused modification tracker in KotlinClassInnerStuffCache
'dropCaches()' is not used anywhere both in the compiler and in the IDE.
2022-03-14 17:53:55 +09:00
Yan Zhulanow f237631f05 Revert "FIR/LC: create synthetic members of enum class"
This reverts commit 1b6ded60
2022-03-14 17:53:55 +09:00