Commit Graph

119 Commits

Author SHA1 Message Date
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
Roman Artemev 7d8c86caf1 [KLIB] Add API to access file's part of data as ByteArray
It requires for computing fingerprint of IrFile in IC infra
2021-08-24 01:09:12 +03:00
Alexander Udalov 376b420d1a Fix warnings in JS/WASM modules 2021-08-06 22:36:22 +02:00
Roman Artemev 3403c464fe [KLIB] Promote library ABI version 2021-07-01 17:40:39 +03:00
Roman Artemev b8e5185b61 [KLIB] Add extra debug information for Local signatures 2021-07-01 17:40:37 +03:00
Nikolay Krasko 9d1a6ebb18 Minor: narrow extracting functions scope 2021-05-27 20:13:07 +03:00
sebastian.sellmair 22ea5c7de4 Demote fatal error to warning on unresolved libraries mentioned in Klib's manifest 'depends' for metadata compilation
^KT-46107
2021-04-21 20:05:55 +00:00
sebastian.sellmair bbcfde7231 [Commonizer] Add 'commonizer_target' and 'commonizer_native_targets' to commonized klib's manifest
^KT-46077 Fixed
2021-04-16 14:56:31 +00:00
Alexander Udalov 168d8b07a8 Minor, fix warnings on new stdlib API
In modules where allWarningsAsErrors is not yet enabled.
2021-04-15 18:39:06 +02:00
Anton Bannykh ba5582de99 IntArray and LongArray serialization 2021-04-09 19:54:14 +03:00
Dmitriy Dolovov caee17fddb [IR] Bump ABI version due to string serialization format change 2021-04-08 12:22:48 +03:00
Dmitriy Dolovov 1fa0ba987b Revert "[IR] Bump ABI version due to string serialization format change"
This reverts commit 4df5dcdf
2021-04-08 09:46:12 +03:00
Dmitriy Dolovov 4df5dcdf75 [IR] Bump ABI version due to string serialization format change
^KT-33175
2021-04-08 09:40:22 +03:00
Dmitriy Dolovov 50326f019b [IR] Use the proper encoding for string serialization
^KT-33175
2021-04-08 09:40:02 +03:00
Roman Artemev d6bb1f2d4e [KLIB] Make KotlinLibraryImpl printable 2021-02-02 12:05:34 +03:00
Roman Artemev 8bc7866f01 [KLIB] Fix klib IO when accessing parent file 2021-01-27 09:48:57 +03:00
Roman Artemev 75016bf54d [Gradle, JS] Fix bridge between Gradle and Js IR CLI 2021-01-26 19:23:25 +03:00
Roman Artemev 37c7f60ae7 [KLIB] Fix issues between directory and .klib modes
- use .klib extension explicitly
 - fix issue with `module.klib.klib` names
2021-01-26 19:23:23 +03:00
Roman Artemev 697d4675a2 [KLIB] Improve klib debugging implementing KotlinLibrary.toString() 2021-01-26 19:23:23 +03:00
Igor Chevdar 03693e3d5a [klib] Optimized away some Files.exists() 2020-12-17 13:57:16 +05:00
Alexander Gorshenev eea5a9102c Bump klib abi version to 1.4.2 to reflect absence of serialized fake overrides 2020-11-09 16:02:14 +03:00
Alexander Gorshenev 5f2a963006 Better wording and comments for klib compatibility code 2020-11-06 16:19:43 +03:00
Alexander Gorshenev 891a4c4621 Dropped outdated klib version compatibility mechanisms 2020-11-06 16:19:43 +03:00
Alexander Gorshenev 8b2b36d61f Enabled klib abi version compatibility 2020-11-06 16:19:42 +03:00
LepilkinaElena ee8db2f760 Escape resolving same library several times in K/N (#3880) 2020-11-03 15:57:48 +03:00
Roman Artemev a4945878aa [KLIB] Pass containsErrorCode flag from library/IC cache into deserializer
- Make deserializer track whether error node are allowed.
2020-10-15 13:55:05 +03:00
Roman Artemev 28c6d17ab4 [KLIB] Mark klib that contains error with special flag 2020-10-15 13:55:05 +03:00
Alexander Udalov a810dbb41b IR: fix compiler warnings 2020-08-18 10:33:25 +02:00
Roman Artemev add0ad6733 [KLIB] Change KLIB IO API
- Use ReadBuffer instead of native java buffer
 - Use Weak buffers for File IO
 - fix klib memory leak for KT-40345
2020-08-03 19:22:06 +03:00
Alexander Gorshenev 2b2fce5949 Fix for KT-37761. Don't use mmap. It causes more troubles than it produce benefits 2020-06-22 14:53:25 +03:00
Ilya Matveev 03bb9138ad [klib] Create ZipFileSystem from a Path instead of an URI
Calling FileSystems.newFileSystem(URI, ...) throws a
FileSystemAlreadyExistsException if a ZipFileSystem for this
URI is already created. We still can use a single instance
of ZipFileSystem by calling FileSystems.getFileSystem. In
this case we use reference counting to determine when this
instance can be safely closed.

But we cannot count references if the same ZipFileSystem is used
from different class loaders. This patch fixes this issue by
creating a file system from Path instead of an URI. Contract of
FileSystemProvider.newFileSystem(Path, ...) doesn't imply throwing
FileSystemAlreadyExistsException.

Issue #KT-37443 fixed
2020-06-18 14:17:59 +00:00
Roman Artemev 44dfae53f0 [IR BE] Add runtime compilation benchmarks for IR JS compiler 2020-05-26 14:41:49 +03:00
Roman Artemev e6c855111e [KLIB] Add flag to select between per-file and monolithic layout 2020-05-26 14:41:49 +03:00
Kevin Most 4f26ac9a04 Fix "Koltin" typos throughout codebase (#3383)
* Fix "Koltin" typos throughout codebase

* Update K2MetadataKlibSerializer.kt
2020-05-20 15:12:32 +03:00