Commit Graph

123 Commits

Author SHA1 Message Date
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
Pavel Punegov 7eb552bb93 [K/N][test] Fix Xcode test in kotlin-native-shared 2023-02-27 10:48:28 +00:00
Pavel Punegov 8938d5cc79 [K/N][build] Make kotlin-native shared be included subproject 2023-02-27 10:48:26 +00:00
Pavel Punegov dcc5c7e435 [K/N][build] Fix shared project to use projects directly 2023-02-27 10:48:25 +00:00
Pavel Punegov cc258934c4 [K/N][build] Cleanup obsolete build tasks
* Remove obsolete reporting
* Remove old build tasks: BuildPusher and CollisionDetector
* Gradle build file cleanup
* Remove old wrappers

Merge-request: KT-MR-8788
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
(cherry picked from commit a9cae3fe87)
2023-02-16 11:56:34 +00:00
Nikolay Krasko 2ad567e14c Revert "[K/N][build] Cleanup obsolete build tasks"
This reverts commit a9cae3fe87.
2023-02-14 11:30:17 +00:00
Pavel Punegov a9cae3fe87 [K/N][build] Cleanup obsolete build tasks
* Remove obsolete reporting
* Remove old build tasks: BuildPusher and CollisionDetector
* Gradle build file cleanup
* Remove old wrappers

Merge-request: KT-MR-8788
Merged-by: Pavel Punegov <Pavel.Punegov@jetbrains.com>
2023-02-13 14:02:28 +00:00
Sergey Bogolepov 7402ef24bb [K/N] Remove obsolete TempFiles constructor parameter 2023-02-09 08:20:33 +00:00
Sergey Bogolepov a11be433e2 [K/N] Get rid of predefined values in TempFiles
One step closer to getting rid of this class at all.
2023-02-09 08:20:31 +00:00
Nikita Bobko ae661dd11b Fix :kotlin-native:backend.native compilation on CI
This commit fixes:
```
./gradlew :kotlin-native:backend.native:compileCompilerKotlin -PdeployVersion=1.9.0-dev-900
```

`-PdeployVersion=1.9.0-dev-900` is important for reproducibility (it's
not necessarily `1.9.0-dev-900` any version starting with `1.9.0-dev`
will reproduce the problem)
2023-02-02 10:56:20 +01: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
Sergey Bogolepov 2f0bdfc5e2 [K/N] Add objcClassesIncludingCategories cinterop property
It allows to list Objective-C classes that should include
corresponding categories from the same file.
The current implementation is super-simple and slow, but
it is OK since it is not intended to be a general-purpose
solution for now.
2023-01-16 13:26:05 +00:00
Gleb Lukianets e9984ce38d Make checking Xcode version faster.
xcodebuild -version call may take enormous amount of time even after warmup. To alleviate this, first try to check Xcode version directly by reading application .plist file, but still use xcodebuild -version as a fallback.

Merge-request: KT-MR-7694
Merged-by: Gleb Lukianets <Gleb.Lukianets@jetbrains.com>
2022-12-06 15:52:13 +00:00
Martin Petrov 6c0b4bcfd4 [KT-54284][Native] Produce deterministic klibs from cinterop. (#4979)
Pass in temp-file C sources to clang via stdin instead of by name.
This prevents absolute paths of temp files from being encoded in bitcode.
2022-10-21 12:16:34 +02:00
Alexander Udalov c410c5d3cd Do not reset freeCompilerArgs for some kotlin-native modules
Otherwise common compiler arguments which are set for all modules in the
project in `buildSrc/src/main/kotlin/common-configuration.gradle.kts`
are not applied. The most interesting of those are `-Xuse-k2` (if K2 is
enabled) and `-Xjvm-default=all`.
2022-09-27 11:04:31 +00:00
Alexander Shabalin f009d9b633 [K/N] Manually compact mimalloc heap ^KT-53182
Merge-request: KT-MR-7111
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-09-23 15:07:16 +00:00
Sergey Bogolepov 0b4a4ca42b [K/N] AArch64 watchOS target 2022-09-18 08:58:21 +00:00
Alexander Shabalin 529a29ae52 [K/N] Use TargetDomainObjectContainer ^KT-53776
Merge-request: KT-MR-7110
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-09-17 08:40:09 +00:00
Sergey Bogolepov 5f847ac40d [K/N] Add workaround for NS_FORMAT_ARGUMENT(A)
See KT-48807 for explanation
2022-09-17 07:51:34 +03:00
Sergey Bogolepov b4b27e9bc6 [K/N] KT-54001
Add a new DefFile.excludeFilter property that excludes headers
from interop library by given glob.

This change is required to properly support platform libs from Xcode 14
without breaking ABI.
2022-09-16 19:22:38 +00:00
Pavel Kunyavskiy 7293dd6d65 [K/N] Require small binaries for all watchos targets 2022-09-16 12:24:11 +00:00
Svyatoslav Scherbina e64b057131 Native: make KonanTarget.supportsMimallocAllocator() exhaustive
To prevent forgetting adding a target there again.
2022-09-01 09:24:11 +00:00
Svyatoslav Scherbina 3f9da7263a Native: enable mimalloc by default on ios_simulator_arm64
This was probably forgotten when supporting Apple silicon.
2022-09-01 09:24:11 +00:00
Vladimir Sukharev 77ab69240e Do inline safepoints for watchos_arm64
Merge-request: KT-MR-6993
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-09-01 08:14:41 +00:00
Vladimir Sukharev 7f1ab29668 Fix Windows targets has bad addresses in stacktrace
^KT-49240 Fixed

Merge-request: KT-MR-6883
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
2022-08-24 09:05:06 +00:00
Nikita Bobko 2a4f3f41aa 2/5 Replace source dependency on kotlin-reflect with binary dependency
Review: https://jetbrains.team/p/kt/reviews/6753

Meaningful semantic change was splitted into 5 commits to simplify the
change review. Sinle commit would be too big.

Why replace source to binary: to get rid of kotlin-reflect in Kotlin
plugin artifact KTIJ-22276

Note: Kotlin Maven artifacts (./gradlew publish) changed their
dependency on kotlin-reflect
2022-08-22 15:43:49 +02:00
Nikita Bobko 837d100cda Drop settings.gradle.kts from kotlin-native/shared
Review: https://jetbrains.team/p/kt/reviews/6753

I don't know why this settings.gradle.kts is needed. But I think that
it was needed before "kotlin-native merge into kotlin" times. (Pavel
Punegov says the same) I try to remove and if CI doesn't fail then I
will push it.

I need to drop settings.gradle.kts because I'm going to replace
kotlin-reflect dependency from source to binary in the next commits. And
before doing this refactoring I want to normalize all the dependencies
on kotlin-reflect.
2022-08-22 15:42:40 +02:00
Pavel Kunyavskiy de1dd47ab1 [K/N] Rework defines passing to runtime compilation 2022-08-17 08:32:47 +00:00
Pavel Kunyavskiy a082aeb29e [K/N] Make atomic ordering weaker for less performance harm 2022-08-10 08:36:08 +00:00
Alexander Shabalin ed881f3f31 [K/N] Make PlatformManager serializable
Merge-request: KT-MR-6358
Merged-by: Alexander Shabalin <Alexander.Shabalin@jetbrains.com>
2022-05-30 15:52:08 +00:00
Pavel Punegov 8afe203f39 [K/N] Remove obsolete generator project 2022-05-26 10:37:30 +00:00
Pavel Punegov 83c2b3657f [K/N] Fix build-tools project compilation
Add necessary subprojects and dependencies
Add OptIn annotation for experimental stdlib methods in 1.5
Fix compilation errors and cleanup
2022-05-26 10:37:28 +00:00
Sergey Bogolepov 7401760d23 [K/N] Remove obsolete hack in ClangArgs
Fixes backend.native:tests for watchosArm64 target.
2022-04-27 14:46:34 +00:00
Svyatoslav Scherbina 4cf10686d6 Native: delete konan_temp right after the compilation instead of on exit
The Kotlin/Native compiler uses `.deleteOnExit()` as a substitute for
"delete after the compilation". But when the compiler runs in a Gradle
daemon, `.deleteOnExit()` means "delete on Gradle daemon exit", which
might be not soon. If a single Gradle daemon runs the compiler many
times, the remaining temporary files can consume quite a lot of disk
space. For example, this is the case for the Kotlin build.

Replace some of `.deleteOnExit()` calls with an explicit removal of
temporary files at the end of a compilation session.
2022-04-22 06:47:39 +00:00
Sergey Bogolepov f010c33958 [K/N] Fix compilation of static libraries for Android
^KT-49145 fixed
2022-02-22 15:37:41 +00:00
Sergey Bogolepov 34cb79fc9f [K/N] Fix KT-50970
Force generation of ARM instruction set for iosArm32 and
watchosArm32 targets for C++ code. There is no need for such
adjustments for Kotlin code because we don't specify any target
features in IrToBitcode and compiler backend infers target features
from target architecture (which is armv7* and not thumbv7).
2022-02-14 13:38:49 +00:00
Svyatoslav Scherbina 5afbbecea4 Native: rename Xcode.current to .findCurrent()
To reflect that it is a non-trivial operation with possible performance
overhead.
2022-02-14 08:52:14 +00:00
Svyatoslav Scherbina e92f7b5ec3 Native: don't cache Xcode.current between different compiler invocations
The compiler might be executed in a Gradle daemon process,
so current Xcode might actually change between different invocations.

^KT-49496 Fixed
2022-02-14 08:52:13 +00:00
Svyatoslav Scherbina 86ad804848 Native: remove support for pre-Xcode 12 libclang_rt
Kotlin/Native doesn't support Xcode versions older than 12.5 anymore,
so just remove the obsolete code.
2022-02-14 08:52:13 +00:00
Svyatoslav Scherbina eb78f5e1ca Native: make xcrun failures a bit more useful again
^KT-50923
2022-02-09 12:46:19 +00:00
Svyatoslav Scherbina 1d3e72cef4 Native: do not cache DependencyProcessor.localKonanDir
Caching is wrong when the compiler is working in Gradle daemon, because
the daemon can change the environment, while localKonanDir depends on
the environment.
2022-01-26 12:43:41 +00:00
sebastian.sellmair 0fd65ab1a0 [Native] TargetedLibraryImpl: Respect 'commonizerNativeTargets' property
^KT-50847 Verification Pending
2022-01-25 16:59:27 +00:00
Igor Chevdar bd6ea71ead [K/N][gradle][interop] Refactored ToolConfig
Added possibility to create different strategies for loading libclang
2022-01-14 10:29:10 +05:00
Sergey Bogolepov 10b48296e8 [K/N] Fix FrameworkTest in case of simulator target
As of Xcode 13.1 Swift 5.5 passes wrong libclang_rt to simulator targets
(similar to ours KT-47333). To workaround this problem, we explicitly
provide the correct one.
2021-12-01 08:49:51 +00:00
Igor Chevdar 4b53a8e3c7 Revert "[K/N][gradle][interop] Refactored ToolConfig"
This reverts commit d9c1b1f6f7.
2021-11-26 14:01:40 +05:00
Igor Chevdar d9c1b1f6f7 [K/N][gradle][interop] Refactored ToolConfig
Added possibility to create different strategies for loading libclang
2021-11-25 23:42:10 +05:00
Sergey Bogolepov 4c45f71edb [K/N] Fix KT-49876
Use llvm-ar on Windows host when producing Linux static library.
2021-11-25 09:28:03 +00:00
Martin Petrov 416d12bce8 [Native] Lazily create dependency & cache directories. (#4627)
Previously initializing the DependencyProcessor will result in file IO.

In a fully-hermetic environment where all dependencies are local, this IO is redundant and may require the build system (e.g. Bazel) to do extra setup to ensure there is a local writable directory specified for these directories. This change will instead cause the dependency processor to bail early and skip downloading dependencies if all are local anyway.

Prior to this change kicking off a clean build with local dependencies would result in:

```
rm -rf ~/.konan/cache; fswatch -ax ~/.konan
~/.konan/cache Created IsDir
~/.konan/cache/.lock Created IsFile
```

After the change no FS operations are performed.
2021-11-09 11:30:30 +03:00
Mattia Iavarone c92e34ca9f [Native] Enable real Android Native executables (#4624)
* Add AndroidProgramType binary option, override entry point, fix linker flags

* Add Konan_main_standalone entry point to the Android runtime

* Add compiler warning

* Make standalone programs print to stdout

* Fix warning message and readability
2021-10-26 11:33:17 +07:00
Sergey Bogolepov 48a26204a7 [K/N] Make xcrun failures a bit more useful 2021-10-02 09:16:53 +00:00