Commit Graph

152 Commits

Author SHA1 Message Date
Johan Bay 32d67d101a [K/N] add flag to klib manifest for header klibs
^KT-65443
2024-03-19 14:09:44 +00:00
Dmitriy Dolovov a78d498e36 Revert "[K/N] add flag to klib manifest for header klibs"
This reverts commit 59f0c0464b.
2024-03-15 22:32:50 +01:00
Johan Bay 59f0c0464b [K/N] add flag to klib manifest for header klibs
^KT-65443
2024-03-15 10:24:26 +00:00
Dmitriy Dolovov d43db973d4 API 4 ABI: Rename manifest property: wasm_target -> wasm_targets
^KT-66367
2024-03-14 10:33:00 +00:00
Dmitriy Dolovov 25de42b7eb API 4 ABI: Move const val KLIB_PROPERTY_WASM_TARGET to :kotlin-util-klib
^KT-66367
2024-03-14 10:33:00 +00:00
Dmitriy Dolovov 4e5a36de18 [KLIB] Mark DFG serialization code as unused and planned for removal
^KT-66218
2024-02-29 16:44:45 +00:00
Dmitriy Dolovov dcf1c7e61d [KLIB] API 4 ABI: Fail with adequate errors on non-existing/malformed KLIBs
^KT-64395
2024-01-09 13:10:24 +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 1c285de55e [KLIB Resolver] Prettier KLIB resolver messages
- Make the messages that are reported by KLIB resolver prettier
- For those messages that affect the resolve process add
  prefix "KLIB resolver: "
- Don't log warning on duplicated libraries on the classpath. This
  does not make any sense.

^KT-63573
2023-12-18 13:03:40 +00:00
Dmitriy Dolovov 3ab35cd417 [KLIB Resolver] Don't log any messages in isKotlinLibrary(File) fun
This function is only used for probing if a library at the given
path exists. Any errors or warnings logged by this function could
only bring a user to a confusion. So, it's better to avoid any
logging here.

^KT-63573
2023-12-18 13:03:40 +00:00
Dmitriy Dolovov 46081f968d [KLIB Resolver] Report KLIB resolver issues as compiler messages
The reason of this change is to make messages (especially warnings)
that are reported by the KLIB resolver become visible to the end user.
This can be achieved to forwarding such messages to the appropriate
compiler's components such as
`org.jetbrains.kotlin.cli.common.messages.MessageCollector` and
`org.jetbrains.kotlin.ir.util.IrMessageLogger`.

Also: The default `DummyLogger` should be used as minimal as possible.
Because it just forwards messages to the standard output (console)
where they can remain unattended. When the compiler is executed
from the Gradle plugin such messages appear only in DEBUG Gradle's log.

^KT-63573
2023-12-18 13:03:40 +00:00
Dmitriy Dolovov e9b4b8919d [KLIB Resolver] Add a heuristic to look up for KLIB file given only unique name
This fix adds a workaround to allow Kotlin/Native compiler to resolve
KLIB library if only library name was passed via `-l` CLI argument.

^KT-63931
2023-12-13 18:06:07 +00:00
Dmitriy Dolovov 2b1fc51f89 [KLIB Resolver] Deprecate UnresolvedLibrary.substitutePath()
This method in unused in Kotlin compiler and IDEA plugin.
2023-12-13 18:06:07 +00:00
Ilya Kirillov 6aeabc83ea [kotlin] fix "IllegalStateException: Could not find stdlib"
The commit removes all the KLib resolution logic,
now Analysis API Standalone clients need to provide all the KLib
list directly.

The resolution logic was removed as too error-prone and requiring compiler configurations.

Kotlin Gradle plugin can provide a full set of required KLibs,
so if a client is a Gradle plugin, this should not be an issue.

Probably, some fancy API which will explicitly perform all KLib dependency searches
should be introduced in the future (KT-63395)

^KT-63126 fixed
2023-11-16 13:31:53 +00:00
Dmitriy Dolovov e7b8f3ecde [Native] Deprecate KLIB repositories in Kotlin/Native compiler
1. Log warnings on usage of KLIB repositories.
2. Don't block using repositories for now.

^KT-61098
2023-11-15 19:38:24 +00:00
Dmitriy Dolovov d65fc00578 [KLIB] Introduce isJsStdlib() and isWasmStdlib() checks for KLIBs 2023-11-11 13:33:06 +00:00
Dmitriy Dolovov f276fe6506 [KLIB] Add a reliable mechanism to check if KLIB has IR inside
^KT-62341
2023-10-27 09:27:59 +00:00
Vladimir Sukharev c4201101ac [K/N] K2/MPP: Move stdlib to the head of dependency list.
^KT-61645 Fixed

Merge-request: KT-MR-12079
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2023-09-13 13:56:21 +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
Mark Mann 8a31e2ed82 [IR] Optimize a few hot spots to reduce total CPU time
^KT-61121
2023-08-10 09:57:06 +00:00
Artem Kobzar a29fa428b3 [K/JS] Add warning for ES-modules on the klibgen stage on the uniqueness of the exported names from the module 2023-08-08 15:45:02 +00:00
Dmitriy Dolovov 5171d92fb9 [KLIB] API for dumping KLIB ABI
^KT-54402
2023-07-28 09:52:18 +00:00
Sergej Jaskiewicz c624bba8cd [klib] Introduce the "ir_signature_versions" in klib manifests
^KT-60576 Fixed
2023-07-21 12:51:47 +00:00
Dmitriy Dolovov 56bebeaf92 [KLIB] Extract "ir_provider" manifest property name as a const val, p.2 2023-06-17 01:00:04 +00:00
Dmitriy Dolovov 72525a22a6 [KLIB] Extract "ir_provider" manifest property name as a const val 2023-06-15 11:07:30 +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
Dmitriy Dolovov 161fe1d2ca [IR] Don't produce gaps for skipped IR declarations during serialization 2023-05-30 10:14:08 +00:00
Alexander.Likhachev 44d9a2136b Bump language version for Gradle plugins' dependencies to 1.5
#KT-58569 Fixed
2023-05-12 12:59:39 +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
Svyatoslav Kuzmich 02beaa1daa [Wasm] Add BuiltInsPlatform.WASM
Use it instead of BuiltInsPlatform.JS in klibs
2023-04-01 10:50:29 +00:00
Pavel Punegov aed6272107 [K/N] Merge :kotlin-native-shared with :native:kotlin-native-utils
* Code was moved to utils, but sources are included to the shared
until bootstrap advance.
* Fixed dependencies and set API & LV to 1.4 for the modules used with
Gradle.

Merge-request: KT-MR-9122
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-03-10 12:57:35 +00:00
Alexander Korepanov e4406638bd [KLIB] Add ZIP file system accessor
The accessor interface is used for reading klib archives in place.
2023-03-10 09:38:51 +00:00
Nikita Bobko 770d6a4708 Bump KotlinAbiVersion for Enum.Entries
^KT-55808 Fixed
Review: https://jetbrains.team/p/kt/reviews/8401

If I don't bump `versions.kotlin-native` then locally
`kotlinx.coroutines` & `kotlinx.atomicfu` user projects compilation
fails with message:
```
w: skipping /home/bobko/jb/kotlinx-atomicfu/atomicfu/build/classes/kotlin/metadata/commonMain. Incompatible abi version. The current default is '1.7.0', found '1.8.0'. The library produced by 1.8.255 compiler
e: Could not find "/home/bobko/jb/kotlinx-atomicfu/atomicfu/build/classes/kotlin/metadata/commonMain" in [/home/bobko/jb/kotlinx-atomicfu, /home/bobko/.konan/klib, /home/bobko/.konan/kotlin-native-prebuilt-linux-x86_64-1.8.20-dev-5812/klib/common, /home/bobko/.konan/kotlin-native-prebuilt-linux-x86_64-1.8.20-dev-5812/klib/platform/linux_x64]
```

It worth noticing that we hardcoded "1.9.0-dev-693" on CI
(kotlin-teamcity-build/6693cb229c7485e07241fbc28322344774bcc3e0) to
workaround KTI-1107. 1.9.0-dev-693 also bumps KotlinAbiVersion
2023-02-01 15:13:34 +01:00
Nikita Bobko 44b1cf6c46 Add docs for different metadata versions and proto files
Review: https://jetbrains.team/p/kt/reviews/8401
In scope of KT-55082
2023-02-01 15:13:34 +01: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
Nikita Bobko dff13ec584 Minor klib cleanups
Review: https://jetbrains.team/p/kt/reviews/8401

- Code style
- Drop unused properties in kotlin-native/build.gradle
- kotlin-native/build.gradle: drop unused import
- use final instead of open when possible

This is just a cleanup commit. It neither fixes any issue/bug, nor
introduces new behaviour.

Feel free to revert this commit if you find out that it breaks something
2023-02-01 15:13:34 +01:00
Sebastian Sellmair 1978566fee [K/N] SearchPathResolver: Do not emit warning for LenientUnresolvedLibrary
^KT-56205 Verification Pending
2023-01-31 16:15:19 +00:00
Pavel Punegov c9aeadd31f [K/N] Remove old Compiler and Meta Version ^KT-55677 Fixed
* Replace it with KotlinCompilerVersion
* K/N version should be set now with `deployVersion`.
* Cleanup deprecated functions in older versions
 of the Gradle plugin
* Cleanup tests for older versions of compiler downloader

Merge-request: KT-MR-8436
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-01-30 13:10:08 +00:00
Svyatoslav Scherbina 322a8a443b Native: add included forward declarations into cinterop klib manifest
This allows the compiler to limit imports from "magic" packages like
cnames.structs to forward declarations actually present in dependent
cinterop klibs.

The manifest already had `exportForwardDeclarations` field, but
- it didn't include Objective-C forward declarations (@class, @protocol)
- it has a slightly different meaning (the export list enables importing
  the listed declarations through the interop package of the library,
  while the include list shouldn't do that), so we better avoid mixing
  them.
2023-01-30 11:00:33 +00:00
Nikita Bobko 887547c445 Drop MetadataComparisonTest & drop build-tools -> util-klib dependency
Review: https://jetbrains.team/p/kt/reviews/8360

MetadataComparisonTest was the only one in build-tools module who
depended on util-klib, that's why we can drop build-tools -> util-klib
dependency

MetadataComparisonTest is no longer needed, that's why we can drop it.

The dependency drop is a one step forward in dropping
`kotlin.srcDir("../compiler/util-klib/src")` line in
`buildSrc/build.gradle.kts`. Adding source roots in `buildSrc` is hacky
and can lead to frustrations (e.g. KT-55874). That's why it's desirable
to drop buildSrc -> util-klib hacky dependency.

Unfortunatelly, I couldn't drop buildSrc -> util-klib dependency,
because:
1. buildSrc depends on kotlin-native/shared/src/library/kotlin +
   buildSrc depends on kotlin-native/tools/kotlin-native-gradle-plugin +
   maybe smth else
2. kotlin-native/shared/src/library/kotlin depends on util-klib +
   kotlin-native/tools/kotlin-native-gradle-plugin depends on util-klib +
   maybe smth else
2023-01-19 12:55:56 +00:00
Sergej Jaskiewicz a66950b629 [klib] Finish refactoring of ZipUtil 2023-01-05 10:13:38 +00:00
Sebastian Sellmair 0575567da4 [Gradle] Implement KotlinLibrary.builtInsPlatform extension
KT-55189
2022-12-02 07:47:28 +00:00
Sergej Jaskiewicz d50c072af0 [klib] Validate paths when unpacking zip archives 2022-11-29 12:21:04 +00:00
Troels Bjerre Lund e520fb712b [K/N] Fix general case of KT-49827
When loading default libraries, the code assumed that all subdirectories
of <kotlin native home>/klib/*/ corresponded to valid libraries. The bug
report only considers the case of .DS_STORE, which is generated by
Finder on MacOS, but this case has already been accounted for in the
code.

The fix filters out all subdirectories that are not stdlib and don’t have the
“org.jetbrains.kotlin” prefix. 

Co-authored-by: Troels Lund <troels@google.com>
2022-06-23 10:12:38 +00:00
Pavel Kunyavskiy 76da9df102 Bump klib ABI version
KLIB forward compatibility was broken during work related to
definitely not-null types, but version was not changed. This led to
exceptions in compiler instead of meaningful error.

^KT-52518
2022-05-28 07:30:54 +00:00
sebastian.sellmair 0fd65ab1a0 [Native] TargetedLibraryImpl: Respect 'commonizerNativeTargets' property
^KT-50847 Verification Pending
2022-01-25 16:59:27 +00:00
Vyacheslav Gerasimov bc2f0936bd Build: Rename commonDep -> commonDependency 2021-12-16 21:48:19 +03:00
Elena Lepilkina 416719c216 [KLIB] Removed support of pattern '<library_name>@<version>' (KT-42500 Fixed) 2021-10-06 09:34:55 +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