Commit Graph

518 Commits

Author SHA1 Message Date
Dmitry Savvinov 8f3c0e71fa [native] Drop deprecated Kotlin/Native targets (5/8)
Adjust KGP: drop usages of deprecated KonanTargets, leave
@Deprecated-stubs in public APIs for readable errors

^KT-64517
2024-03-12 16:22:27 +00:00
Dmitriy Dolovov 8365915b3f [Commonizer] Metadata comparator: Proper comparison of type lists
There are two types of type lists that can be met in Kotlin metadata
and that should be treated in a different way:

1. The order-sensitive type list. Examples: Context receivers.
2. The order-insensitive type list. Examples: Class supertypes,
   type parameter upper bounds.

With (1) swapping elements in list causes source and/or ABI
incompatibility, while with (2) it does not. If it happens that we
compare two type lists in Kotlin metadata of (2) kind, we should group
them using the key computed with the help of
`dumpToString(dumpExtras = false)` instead of just the index as we do
in case of (1).

^KT-62753
2024-02-22 17:53:15 +00:00
Dmitriy Dolovov 40af02ca4f [Commonizer] Metadata comparator: A special path element for FlexibleTypeUpperBound
^KT-62753
2024-02-22 17:53:15 +00:00
Leonid Startsev 09e89db82f Change kotlinx- to kotlin- in kotlin-metadata-jvm and related projects
Change package, artifact group, artifact name, and Gradle module name to
kotlin-metadata and kotlin-metadata-jvm, respectively.

In Kotlin 2.0, kotlin-metadata-jvm library is promoted to stable, and is
a part of Kotlin distribution now.

Note that kotlinx-metadata-klib is left with org.jetbrains.kotlinx group, artifact name and package
because -klib part is considered not stable and for internal use. Since it is still published via Sonatype,
it should have kotlinx group. Therefore, it will have both classes from kotlin.metadata and kotlinx.metadata packages. This is not a problem, because we already had kotlinx.metadata split package between -jvm and -klib before.

#KT-63219 Fixed
2024-02-15 15:32:33 +00:00
Pavel Kunyavskiy 0a07f16896 [Commonizer] Better handling of ObjcMethod and related annotations
They are important for overridability rules, so can't be just ignored.
Some arguments are still different on different platforms, so
commonized version is a bit strange.

But the only important part is selector, which should be same on
all platforms.

^KT-57588
2024-02-08 09:46:35 +00:00
Dmitriy Dolovov 1fe8b50c19 [Commonizer] Metadata comparator: treat type nullability properly
^KT-62753
2024-01-31 17:40:53 +00:00
Dmitriy Dolovov e021411768 [Commonizer] Metadata comparator: More verbose output (with more details)
^KT-62753
2024-01-29 17:34:55 +00:00
Dmitriy Dolovov 5f3eee7267 [Commonizer] Metadata comparator: Fully support contracts comparison
^KT-62753
2024-01-29 17:34:55 +00:00
Timofey Solonin 0aa7b6f6ad Fix UnsafeNumber being applied incorrectly in hierarchical commonization
^KT-64376
2024-01-15 09:35:43 +00:00
Timofey Solonin 3c03e388d2 Record erroneous UnsafeNumber commonization behavior
^KT-64376
2024-01-15 09:35:43 +00:00
Dmitriy Dolovov 6951efe63c Metadata comparator: Support new metadata attributes (see below)
Support new metadata attributes that were added to Kotlin metadata
but are not yet supported in `MetadataDeclarationsComparator`:
- DNN type flag
- context receivers
- underlying type & property name for inline classes

^KT-62753
2024-01-11 09:26:41 +00:00
Timofey Solonin 59b8941c28 Remove ModuleResult.Missing from commonization results
This result seems to not be used

^KT-51026
2024-01-11 08:57:28 +00:00
Dmitriy Dolovov e92017f64e [KLIB Resolver] Deprecate Logger.fatal()
Invocation of Logger.fatal() may cause severe side effects such as
throwing an exception or even terminating the current JVM process
(check various implementations of this function for details).

The code that uses Logger.fatal() sometimes expects a particular kind
of side effect. This is totally a design flaw. And it's definitely not
a responsibility of Logger to influence the execution flow of
the program.
2024-01-08 13:26:24 +00:00
Dmitriy Dolovov 0de04f934e [Commonizer] Switch from trove4j to fastutil
^KT-63159
2023-11-06 19:56:17 +00:00
Dmitriy Dolovov 7658b818ac [Commonizer] Add a performance test (muted by default)
This test can be used to make small performance measurements of
the core commonizer on occasional basis. This test is not intended
for regular execution, e.g. at the CI server.

^KT-63159
2023-11-06 19:56:17 +00:00
Dmitriy Novozhilov 7ff2fc9dbe Add workaround for KT-62702 2023-10-19 12:13:46 +00:00
Sebastian Sellmair 9031deeacf [Commonizer] PropertyCommonizer: Support annotation commonization
^KT-62028 Verification Pending
2023-09-21 12:39:15 +00:00
Sebastian Sellmair f5b107d4f0 [Commonizer] ClassCommonizer: Support annotation commonization
^KT-62028 Verification Pending
2023-09-21 12:39:15 +00:00
Alexander.Likhachev 357d12fc8e [Build] Move JUnit dependencies into the version catalog
The `kotlin-test` dependencies are left untouched as changing them affects publications, thus these versions are independent from the used inside our build
#KTI-1349 In Progress
2023-09-06 22:47:33 +00:00
Leonid Startsev 06c471d413 Remove deprecated Flag usages in MetadataDeclarationsComparator.kt
#KT-59440
2023-08-23 16:47:05 +00:00
Leonid Startsev 8b821e1feb Deprecate KmProperty.hasGetter(hasSetter) in favor of KmProperty.getter(setter)
as a follow-up of flag deprecation.

#KT-59440
2023-08-14 12:36:34 +00:00
Dmitriy Dolovov 3b626ea97c [Commonizer] Replace ResettableClockMark by TimeSource.Monotonic 2023-08-08 09:40:18 +00:00
Sebastian Sellmair d510c93241 [Commonizer] Support generic/simple annotation commonization (to support kotlinx.cinterop.* annotations)
^KT-59302 Verification Pending
2023-08-04 11:29:23 +00:00
Nikita Bobko 4f3ecedbca [FE] Stop ignoring ABSTRACT_MEMBER_NOT_IMPLEMENTED for expect classes
^KT-59739 Fixed
Review: https://jetbrains.team/p/kt/reviews/11038/timeline
2023-07-24 09:15:11 +00:00
Pavel Kunyavskiy fd564d4af9 [K/N] Disable custom import for forward declarations
If forward declaration exists in a library, it was
possible to import it both by forward declaration name
and normal library name. This is strange unique behavior.
And it would also make KT-59643 changes binary incompatible.
So from now it's only possible to import forward declaration by
forward declaration name only.

^KT-59642
2023-07-24 08:24:20 +00:00
Pavel Kunyavskiy ef9413108b [K/N] Consolidate forward declarations handling
This is refactoring in preparation for KT-59764.
Names and layout of forward declarations related classes
was copy-pasted many times over compiler code.

Implementing KT-59764 would require copy-pasting it two more times.
So instead of doing this it was put in single place.

No behaviour changes intended in this commit.
2023-07-10 08:59:16 +00:00
Leonid Startsev b15da7c63a Deprecate old kotlinx-metadata flags API:
Flag, Flag constants, Flags typealias, flagsOf() function, and
Flag accessors in nodes (such as KmClass.flags, KmClass.jvmFlags, KmProperty.setterFlags, etc)

#KT-59440
2023-06-27 15:12:46 +00:00
Leonid Startsev 1a1cbcb321 Rework flags in kotlinx.metadata:
Introduce extensions for KmNodes to work with various modifiers instead of old Flags.SOMETHING.invoke(flags).
Provide Visibility, Modality, and Kind enums.
Introduce KmPropertyAccessorAttributes to replace KmProperty.getterFlags and KmProperty.setterFlags.
Deprecate nodes constructors which take flags but not flags itself (yet).
Adapt KotlinP to changes.

#KT-59440 Fixed
2023-06-27 15:12:46 +00:00
Pavel Kunyavskiy b28b0e70b6 [commonizer] Support commonizing includedForwardDeclarations in manifest
It is a new manifest property which is used only in K2, and it is
required for correct K2 processing of forward declarations.

^KT-59132
2023-06-27 08:05:52 +00:00
Leonid Startsev 0cfe2b04f5 Move KmModuleFragment to an internal.common package
because it is klib-related and can be read only with KotlinCommonMetadata.
2023-06-08 17:53:31 +00:00
Pavel Punegov 47c7dfe6b4 [K/N][klib] Wrap library dependencies with quotation marks
Fixes ^KT-58537. Space in the library now should be correctly parsed now
Klib readers can already read this
2023-06-05 14:40:11 +00:00
Roman Efremov c8023eac13 [commonizer] Don't commonize "tailrec" and "external" modifiers
expect external and tailrec were prohibited
in previous commit.

^KT-58536
2023-05-23 12:43:51 +00:00
Nataliya.Valtman 2a391f7330 Move kotlin-build-statistic project to :compiler 2023-04-25 11:29:09 +00:00
nataliya.valtman e34dd043da Add minimal statistic report for JPS build
Fix build stat for gradle 8

#KT-56438 Fixed
2023-04-25 11:29:09 +00:00
Roman Golyshev d4cffb8a5a [213] Switch to 213 platform
KTI-1114
2023-04-21 13:19:04 +00:00
Vyacheslav Gerasimov 76c54a8ff3 Build: Fix usages of apis deprecated in Gradle 8 2023-03-20 19:45:39 +00:00
Sebastian Sellmair d103f60af8 [Commonizer] Demote duplicate dependency libraries to 'warning'
^KT-56729 Verification Pending
2023-02-20 16:30:10 +00:00
Sebastian Sellmair 513f4a3c42 [Commonizer] Commonize 'HAS_ENUM_ENTRIES' flag
^KT-56207 Verification Pending
2023-02-06 18:36:37 +00:00
Nikita Bobko 62b27b4613 Cleanup: drop KlibIrVersion
Review: https://jetbrains.team/p/kt/reviews/8401
In scope of: KT-55082

Because this version isn't used for anything. We have KotlinAbiVersion
to version the IR format.
2023-02-01 15:13:34 +01:00
Dmitriy Novozhilov 993695a7d0 [Commonizer] Mute tests due to KT-56207 2023-01-30 09:30:00 +00:00
Roman Efremov 2dc3871954 Add "hasEnumEntries" class flag to kotlinx-metadata
^KT-53929 Fixed
2023-01-23 12:53:06 +01:00
Mikhail Glukhikh 89dd28226b BinaryVersion: introduce isCompatibleWithCurrentCompilerVersion 2023-01-16 18:12:55 +01:00
Sergej Jaskiewicz 1539d7ef1a [klib] Bring package names in sync with the directory layout
Basically, some package names were Native-specific, whilst the packages
themselves were not Native-specific at all. This was already reflected
in the directory layout, but not in the package names.
This is fixed here.

NFC, just an automatic rename of packages with fixes of imports.
2022-12-01 21:46:43 +00:00
Leonid Startsev 471882b743 Introduce @DeprecatedVisitor; mark up visitor-related declarations with it.
Provide convenient JVM writing API.

Get rid of ExperimentalUnsignedTypes.
2022-11-10 13:30:09 +00:00
Anton Lakotka 1b3cc0dfaa [Gradle] Register watchosDeviceArm64 in commonizer
^KT-53107
2022-10-05 19:32:03 +00:00
Sergey Bogolepov 289f540530 [Commonizer] workaround for CoreGraphics from Xcode 14 2022-10-05 09:59:10 +00:00
Nikita Bobko 70ed76e0bd Drop unused ':dist' dependency in some tests
Review: https://jetbrains.team/p/kt/reviews/6753

This commit doesn't fix any issue except for "cleanup". If you find a
mistake in this commit feel free to revert part of it/the whole commit

I checked every module where I drop ':dist' dependency. Tests still pass
in those modules
2022-08-22 15:42:34 +02:00
Aurimas e2ac24cc90 Make sure to sort klib manifest data
Not sorting results in non reproducible output causing up-to-date check failures
2022-06-24 07:43:01 +00:00
sebastian.sellmair 204bc4ca95 [Commonizer] Provide union of forwardDeclarations as common dependencies
^KT-52050 Verification Pending

The issue described in KT-52050 happened, because forwardDeclarations
were not carried into next commonization steps. For commonization
it is fair to choose the union of all modules forwardDeclarations
as common dependency (instead of a union), since we can assume that
all those forward declarations will be provided.
2022-04-22 08:47:39 +00:00
Pavel Kirpichenkov 621f14c5bb [MPP] Improve creation of @UnsafeNumber w.r.t. non-aliased types and PIC
^KT-51643
2022-03-25 16:22:25 +00:00