Commit Graph

3227 Commits

Author SHA1 Message Date
Ilya Gorbunov 0ecbbbf1ca [stdlib] Set AV to 2.0, LV to 1.9 for main compilations, build tests with K2 2024-02-21 16:28:12 +00:00
Vladimir Sukharev bd7ffc71aa [K/N][Tests] Migrate test kt62262.kt
^KT-61259
2024-02-20 21:10:33 +00:00
Vladimir Sukharev 3d70be0c5f [K/N][Tests] Migrate test kt40426
^KT-61259
2024-02-20 18:56:54 +00:00
Dmitriy Dolovov 795ee9f26d [KLIB tool] "dump-metadata-signatures": exclude fake overrides
There are few reasons why fake overrides should not be printed:

1. Fake overrides are not serialized in metadata. So, if one will run
   "dump-metadata" they won't see there any fake overrides. Neither
   their signatures. It would be inconsistent if
   "dump-metadata-signatures" command would show them.

2. In order to properly build fake overrides the KLIB tool needs
   the dependency library with the super class or interface, which
   is not available unless this is stdlib or one of the built-in
   Kotlin/Native platform libraries. KLIB tool does not support any
   reasonable means for passing dependencies through CLI arguments.
   If such possibility is added in the future, it would be the
   right time to support printing fake overrides (probably under
   a separate CLI option).

^KT-62340
2024-02-20 11:52:26 +00:00
Dmitriy Dolovov f4f609bea7 [KLIB tool] "dump-metadata-signatures": exclude private declarations
Don't print signatures computed for private declarations. This
effectively means that only signatures for `public`, `protected`,
and `internal` declarations will be printed.

Note: This new behavior is intact with `dump-ir-signatures` command.

^KT-62340
2024-02-20 11:52:26 +00:00
Dmitriy Dolovov d18afff12b [KLIB tool] "dump-metadata-signatures" command: use stable sorted order
Print the signatures computed by the metadata always in stable sorted
order.

^KT-62340
2024-02-20 11:52:26 +00:00
Abduqodiri Qurbonzoda f6f04b209f [K/N] Remove deprecated setUnhandledExceptionHook(not-null) overload #KT-65532 2024-02-20 10:35:13 +00:00
Abduqodiri Qurbonzoda dd89efbce2 [K/N] Remove deprecated deinitRuntimeIfNeeded #KT-65532 2024-02-20 10:35:13 +00:00
Johan Bay d50b02adaf [K/N] only include bodies inside inlines for headers
Also renames the "header klib serializaion" option to something
that hopefully slightly better reflects its meaning
^KT-65442
2024-02-20 08:03:08 +00:00
Johan Bay a2516548e4 [K/N] avoid overwriting header when output paths are equal
^KT-65442
2024-02-20 08:03:07 +00:00
Ilya Gorbunov 15375c0fd5 [stdlib] Use more idiomatic and performant implementation of isBlank
Also replace expect-actual with a common function because its implementation is no longer different in different platforms.

KT-65590
2024-02-20 03:48:08 +00:00
Ivan Kylchik b0171dea63 [IR] Move FunctionInlining into separate module
#KT-64806 Fixed
2024-02-19 20:14:16 +00:00
Ivan Kylchik 35b13775d8 [IR] Move declaration of origins for IR inliner into LoweredStatementOrigins
#KT-64806
2024-02-19 20:14:16 +00:00
Vladimir Sukharev 2b2c685827 [K/N][Tests] Migrate dylib-interop-exe tests
^KT-61259
2024-02-19 18:44:08 +00:00
Dmitriy Dolovov 215303606b [KLIB tool] Entry point for tests: org.jetbrains.kotlin.cli.klib.Main.exec
^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 16a27c2e05 [KLIB tool] Split KlibToolCommand into multiple individual commands
^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 358ad272f4 [KLIB tool] Extract class KlibToolCommand from main.kt
^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 9878c1fa16 [KLIB tool] Introduce KlibToolOutput for capturing stdout and errors/warnings
With `KlibToolOutput` it's possible to forward the output of each
KLIB tool's command to either system stdout/stderr streams or to
some buffers which then can be read by tests.

^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 5b7c11ae39 [KLIB tool] Introduce a '-test-mode' CLI option
This is an option that allows running the commands that support it
in a special "test mode". The "test mode" means (but not limited to)
that a command may, for example, sort the output which is unsorted
by default, and this way guarantee stable output. This is essentially
helpful for tests, which rely on the command output.

^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 82115c1f26 [KLIB tool] Drop unused blind flag in "remove" command
^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 77b574bd0d [KLIB tool] Rename class Library -> class KlibToolCommand
Also, make it use `KlibToolArguments` instead of separate isolated
arguments passed via constructor or via individual command calls.

^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 7aa106c3a0 [KLIB tool] Extract self-sufficient classes from main.kt to separate files
Classes extracted:
- KlibToolArguments
- KlibToolArgumentsParser
- KlibToolLogger
- KlibToolIrLinker

^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 4fe8885376 [KLIB tool] Split KlibToolArguments to arguments & arguments parser
^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 02ab472f0b [KLIB tool] Rename: class Command -> class KlibToolArguments
This way it would better reflect its purpose.

^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov 921a787815 [KLIB tool] Move all CLI-related logic to the Command class
^KT-62340
2024-02-19 09:36:10 +00:00
Dmitriy Dolovov d4585ff3ce [KLIB tool] Refactoring. Fix visibility, add comments, drop useless code
What's done:
- Reduce the visibility of all entities inside the module to `internal`
  or `private`. Only leave `fun main()` as `public` because it's the
  single legal entry point.
- Add comments to few classes related to "contents" command that they
  should be removed together with the command after 2.0.
- Drop useless `DeclarationHeaderRenderer` interface.
- Rename: KlibToolLinker -> KlibToolIrLinker

^KT-62340
2024-02-19 09:36:10 +00:00
Mark Mann 00ef313df2 [K/N] Add binary option to produce error on mangled objc names (#5264)
objcExportErrorOnNameCollisions=true binary option makes the compiler
emit an error whenever it mangles a name emitted by ObjCExport.

^KT-65863 Fixed
2024-02-16 18:17:30 +00:00
Leonid Startsev a6cdf27204 Fix compilation of :tools:kotlinp-klib and related projects
Conflicting PRs https://jetbrains.team/p/kt/reviews/14253 and https://jetbrains.team/p/kt/reviews/14384/files
were merged too close to each other for Safe-Merge to catch the problem and therefore resulted in compilation error.
2024-02-15 17:15:58 +00:00
Dmitriy Dolovov f9f97f2050 [KLIB tool] Support metadata format by kotlinp
Use the unified metadata printing format in KLIB tool. The same format
is already used in `kotlinp` CLI tool.

^KT-62340
2024-02-15 15:38:27 +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
Vladimir Sukharev 20f6b0cb0c [K/N][Tests] Migrate test ir_providers_mismatch
^KT-61259
2024-02-15 10:13:56 +00:00
Vladimir Sukharev fbe8db4b45 [K/N][Tests] Migrate test override_konan_properties0 and add testDriverVersion
^KT-61259
2024-02-14 12:16:23 +00:00
Vladimir Sukharev 9ef051dbc5 [K/N][Tests] Migrate test override_konan_properties0
^KT-61259
2024-02-14 12:16:22 +00:00
Vladimir Sukharev d8a90f55a8 [K/N][Tests] Migrate driver test llvm_variant_dev
^KT-61259
2024-02-14 12:16:22 +00:00
Vladimir Sukharev 3ad8fed5a3 [K/N][Tests] Migrate test embedStaticLibraries.kt
^KT-61259
2024-02-14 11:56:59 +00:00
Pavel Kunyavskiy 6e8a7d4662 [ObjCInterop] Implement @ObjCSignatureOverride
This annotation leads to conflicting overloads error supression,
in case where several function with the same argument types,
but different argument names are inherited from ObjC class.

We need to implement it in both K1 and K2 to make the IDE experience
better.
But the annotation itself wouldn't be available in K1.

    ^KT-61323
2024-02-14 11:44:01 +00:00
Pavel Kunyavskiy d100a07981 [K/N] Move ObjCOverridabilityCondition to proper module
It was not active in diagnostic tests otherwise.
2024-02-14 11:44:01 +00:00
Vladimir Sukharev 3b4ca56f74 [K/N][Tests] Migrate test platform_zlib.kt
^KT-61259
2024-02-14 09:55:06 +00:00
Vladimir Sukharev 06a89a0061 [K/N][Tests] Migrate test withSpaces.kt
^KT-61259
2024-02-13 22:14:30 +00:00
Vladimir Sukharev 34af80943c [K/N][Tests] Remove obsolete cppInterop tests
^KT-61259
2024-02-13 21:48:40 +00:00
Pavel Punegov 6b9844705e [K/N] Make InfoPlistBuilder add DT* properties
The Firebase TestLab requires those properties to be present,
otherwise fails with verification errors.

These properties are specific to the Xcode installation or
toolchain used, and should be retrieved from it, not hardcoded.
See also KT-65601.

Part of the ^KT-58928


Merge-request: KT-MR-13964
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2024-02-13 11:14:24 +00:00
Vladimir Sukharev 6c78ec88c2 [K/N][Tests] Cleanup support code for objCFrameworks in old testinfra
^KT-61259
2024-02-13 07:43:25 +00:00
Alexander Shabalin d92eecb985 [K/N][tests] Add :nativeCompilerUnitTest and :nativeCompilerTest ^KT-65392
- :nativeCompilerUnitTest are unit tests on K/N compiler.
- :nativeCompilerTest are tests using K/N compiler and should be run in
  many different compilation modes that K/N supports.
2024-02-12 17:52:38 +00:00
Yahor Berdnikau 11fee106b2 [Gradle] Fix warnings in kotlin-native-build-tools
^KT-56904 In Progress
2024-02-12 14:39:33 +00:00
Vladimir Sukharev 7cb372e66f [K/N][Tests] Migrate test signext_zeroext_objc_export.kt
^KT-61259
2024-02-11 21:30:03 +00:00
Vladimir Sukharev 370f138ad4 [K/N][Tests] Migrate test signext_zeroext_interop.kt
^KT-61259
2024-02-11 12:44:31 +00:00
cristiangarcia 4a74498be7 Outputs are not serializable, FileCollection is
Required for KTI-1553
2024-02-09 19:10:03 +00:00
Alexander Shabalin 5bd0bbb159 [K/N][tests] Regroup runtime tests ^KT-53776 2024-02-09 11:14:56 +00:00
Alexander Shabalin 4468167a64 [K/N] Move kotlin-native/utilities/basic-utils to compiler/utils 2024-02-08 20:43:11 +00:00
Alexander Shabalin 77b9c40434 [K/N] Fix CrossDistBitcodeCopy task outputs 2024-02-08 11:50:21 +00:00