Commit Graph

2332 Commits

Author SHA1 Message Date
Roman Efremov 14b4cdc7c4 Write "hasEnumEntries" flag into metadata when feature enabled
^KT-53929 Fixed
2023-01-23 12:53:04 +01:00
Ilya Chernikov 7ec72b568d Fix assertion in light tree diagnostic reporter
happened then two diagnostics are reported on the same element.
#KT-55924 fixed
2023-01-20 17:57:15 +00:00
Mikhail Glukhikh c8db20bd0b Compiler: restore an opportunity to switch light tree mode OFF
#KT-55996 Fixed
2023-01-18 14:01:22 +00:00
Alexander Likhachev 4c2923f96f [IC] Support precise output backup for kapt stubs
#KT-49785 In Progress
2023-01-17 22:15:53 +00:00
Alexander Udalov 2a80e70860 Install jansi only when colors are enabled, add test
Also minor cleanup. Remove the comment about the issue jansi#35 because
although the issue is fixed, the behavior is correct right now: we
enable colors by default iff stderr is a TTY (and the platform is not
Windows), and to determine that we need to call `CLibrary.isatty`.

 #KT-55784
2023-01-17 16:59:51 +01:00
Loïc Mangeonjean 34947c9d7a Allow overriding ansi mode on PlainTextMessageRenderer
#KT-55784 Fixed
2023-01-17 16:59:51 +01:00
Mikhail Glukhikh 70fc891260 K2: move -Xuse-k2 VS language version checks to CommonCompilerArguments 2023-01-16 18:16:49 +01:00
Mikhail Glukhikh 7a61578e08 Language version 2.0: fix compiler messages and minor details 2023-01-16 18:16:48 +01:00
Mikhail Glukhikh 0c4a0360ac Deserialization/class reading: pass chosen JvmMetadataVersion whenever possible 2023-01-16 18:16:07 +01:00
Mikhail Glukhikh 3dc05f4ec5 Introduce language version 2.0 and associate K2 compiler with it 2023-01-16 18:12:55 +01:00
Ilya Chernikov a29c418b63 Add missing platform core hack to use nio2, avoids warning on Windows
add the hack to project environment creation, instead of compliation
call sites, covers missing scenarions with maven scripting and K@ now
and should help to avoid problems in the future.
#KT-54461 fixed
2023-01-15 20:11:57 +01:00
Ilya Chernikov d8650d9b04 Scripting: support compiler plugins in hosted script compiler
Now the plugin-related compiler arguments are respected then used in
the compiler configuration (only in the static part, not supported
if set in a refinement callback)
Note that the "embeddable" version of the plugin should be used if
embeddable compiler is used.
#KT-54095 fixed
2023-01-15 11:14:41 +01:00
Artem Daugel-Dauge 0d1e7e83b5 [K/N, CLI] Pass through errors from Gradle to Xcode
^KT-55650

Merge-request: KT-MR-8245
Merged-by: Artem Daugel-Dauge <Artem.Daugel-Dauge@jetbrains.com>
2023-01-13 20:54:05 +00:00
Ivan Kochurkin 5d273ce839 [FIR & FIR2IR] Prepare test and CLI infrastructure to support MPP
- Move out getAnalyzerServices from FirFrontendFacade to TestSetupUtils
- Simplify DependencyListForCliModule. Now it takes BinaryModuleData as input
- FirOutArtifact contains several FirOutputArtifactPart
- Simplify FirFrontendFacade
2023-01-13 12:55:57 +00:00
Ivan Kochurkin bcfdbaa6a6 [FIR] Use ModuleCompilerAnalyzedOutput instead of FirResult
Remove FirResult since it has the same semantics value
2023-01-13 12:55:55 +00:00
Marco Pennekamp a777ffcd8a [AA] KT-55566 StandaloneProjectFactory: Setup JDK default module roots
- Setup JDK default module roots in `StandaloneProjectFactory` (compare
  with `KotlinCoreEnvironment`). The implementation is a distilled
  version of `ClasspathRootsResolver`'s default module handling.
- This fixes an issue where some LL FIR tests with JDK 17 and 11 had
  mismatched types between Kotlin and Java sources.

^KT-55566 fixed
2023-01-04 11:46:11 +00:00
Vladimir Dolzhenko 4542b3947b Clean up: rename Jet* to Kt* 2023-01-03 16:36:53 +01:00
Ilya Chernikov 19a0a1fcd8 K2: add missing MPP warning in LightTree mode 2023-01-02 19:54:57 +00:00
Ilya Chernikov 47a4532ea0 K2: update LightTree support in modularized tests 2023-01-02 19:54:56 +00:00
Ilya Chernikov 1a373317ed K2: temporarily disable scripts compilation in LT mode
Should be addressed in the new K2 scripting support soon
2023-01-02 19:54:56 +00:00
Ilya Chernikov 23a27864e5 K2: introduce LT mode config property 2023-01-02 19:54:56 +00:00
Alexander Udalov 3f2b51151f Remove -Xexclude-from-dumping
Apparently the underlying logic was removed in b07690fccf and no one
noticed.
2023-01-02 15:26:07 +00:00
Denis.Zharkov d3549c2c5b Optimize CoreJrtFileSystem
Do not recompute children on each file request
At the same time, we should clear the roots after each compilation
just the same way as we do for common jars
2022-12-29 09:59:16 +00:00
Andrey Uskov f07f193938 Make line number field public in PerformanceMeasurement
Required for KT-55537
2022-12-26 17:16:02 +03:00
Dmitriy Novozhilov 5d6cb2b691 [Test] Use IrPluginContext for searching declarations for DUMP_EXTERNAL_CLASS check 2022-12-09 12:02:07 +00: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
Sergey Bogolepov c22cad07ed Introduce FlexiblePhaseConfig
For dynamic Kotlin/Native driver we need a PhaseConfigurationService
that does not force us to provide a list of phases upfront.
2022-11-30 11:24:38 +00:00
Mikhael Bogdanov edc54524aa Xjdk-release: support mixed compilation of Java and Kotlin
#KT-52815 Fixed
2022-11-14 06:57:12 +00:00
Xin Wang 7b3ce35613 JVM_IR: Prevent writing output after an error is reported
#KT-53825 Fixed
2022-11-09 23:14:11 +01:00
Ilya Chernikov 23144b92d8 Fix FastJarFS caches cleaning
- add FastJarFS cache cleaning to the daemon implementation, so
the behavior is now the same as for CoreJarFS
- clear not only mappings but also handlers cache: this may result some
slowdown on comparison with the previous cleaning implementation,
but should avoid unreliable behavior on heavy parallel build usages.
2022-10-31 16:02:50 +00:00
Ilya Chernikov 8566589cf5 Add minimal roots deduplication on classpath update
duplication was detected e.g. in some scripting scenarios
2022-10-21 06:11:42 +00:00
Ilya Chernikov b50a803b6f Make jdk root processing more robust
#KT-54337 fixed
2022-10-21 06:11:42 +00:00
Ilya Chernikov 7d5257c258 Preserve FastJarFS in app env and implement intermediate cleanup
FastJarFS was behaving differently than the regular CoreJarFS it
tries to replace, namely it was cleaned after each compilation
(had the lifetime tied to core env).
This commit preserve it in the app env the same way as CoreJarFS,
so it could be reused in parallel builds and preserved if automatic
cleanup of the app env is turned off,
But since FastJarFS caches also mmf handles, the additional handles
cleaning is introduced that triggers after all possibly parallel
compilations are finished.
2022-10-21 06:11:41 +00:00
Ilya Chernikov 61e9aaf113 Convert java to kotlin 2022-10-21 06:11:41 +00:00
Ilya Chernikov bccfc2ad18 Rename .java to .kt 2022-10-21 06:11:40 +00:00
Ilya Chernikov 6627b62c21 Fix sources extraction when processing extension is on
The latter is used e.g. for scripts in source roots handling
as implemented in the commit
"Scripting: update scripts in source roots handling"
The former implementation did not covered all the cases.

#KT-54355 fixed
2022-10-18 16:29:06 +00:00
Ivan Kochurkin 40a01180ff [FIR] Move createSessionWithDependencies and createEmptySession into FirSessionFactoryHelper 2022-10-13 18:11:48 +00:00
Dmitriy Novozhilov d423782fac [FE 1.0] Remove usages of safeAs and cast from most of FE 1.0 modules:
- :core:descriptors
- :core:descriptors.jvm
- :core:deserialization
- :compiler:cli
- :compiler:frontend
- :compiler:frontend:cfg
- :compiler:frontend.java
- :compiler:frontend.common.jvm
- :compiler:psi
- :compiler:resolution
- :compiler:resolution.common
- :compiler:resolution.common.jvm
- :kotlin-reflect-api
2022-10-12 13:58:56 +00:00
Denis.Zharkov d9701c71b7 Minor. Clean ZipImplementation.kt 2022-10-05 15:03:41 +00:00
Denis.Zharkov 337f461ad8 Fix IndexOutOfBoundsException at FastJarFS
If there are more than 0xffff files in the jar,
we have to use Zip64 format

^KT-52786 Fixed
2022-10-05 15:03:41 +00:00
Simon Ogorodnik 53069ee03f Fix application disposer registered only once due to deduplication
Disposer uses passed object identity to decide should it be registered
Since lambda, that passed into disposer doesn't capture anything, it has
only one instance, so it ends up being registered only once
While it should be registered for every parentDisposable
2022-10-03 13:36:05 +00:00
Simon Ogorodnik f2dee2bf85 Core. Fix data-race in ApplicationEnvironment initialization
getOrCreateApplicationEnvironment is main entrypoint to create
ApplicationEnvironment in production and compiler tests
It is subject to be called concurrently, that's why
APPLICATION_LOCK exists

ApplicationEnvironment itself hosts Application from idea-core
It is actually singleton, that is subject to be disposed, once all
operations referencing it completes

To properly dispose ApplicationEnvironment when there is no references
left, we maintain reference counter aka ourProjectCount

Originally, there was data-race caused by the fact, that ourProjectCount
was updated after publication of application

Linear, data-race occurs in following order
T1: getOrCreateApplicationEnvironment returns application
T2: Disposes its reference to application, causing ourProjectCount to
reach zero, and disposing application that is already available to T1
T1: Updates counter, but its application already disposed
2022-10-03 13:36:05 +00:00
Alexander Udalov 4a00d1f978 Add internal way to enable old backend
Needed for tests on debugger in Kotlin IDE plugin.
2022-09-26 13:35:41 +00:00
Anže Sodja 09d6dfc8bf [Assign plugin] Add a compiler plugin for overloading assign ('=') operator 2022-09-16 10:12:41 +03:00
Anže Sodja 6052962f50 Register AssignResolutionAltererExtension in KotlinCoreEnvironment 2022-09-16 10:12:41 +03:00
Alexander Udalov 0569f429dd Report error on -Xuse-old-backend, remove Gradle option useOldBackend
Allow using old JVM backend only to compile kts.

 #KT-48532 Fixed
2022-09-16 00:16:31 +02:00
Aleksei.Cherepanov 782dc55800 Make exception more user-friendly (2)
Add stacktrace and given error to error message

#KTIJ-21077 Fixed


Co-authored-by: Alexander Udalov <Alexander.Udalov@jetbrains.com>

Merge-request: KT-MR-7122
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
2022-09-15 13:33:11 +00:00
Aleksei.Cherepanov 0d1b748cd5 Make exception more user-friendly
Accompany registration of non-compatible compiler plugin with readable error

#KTIJ-21077 Fixed
2022-09-14 10:30:42 +00:00
Mikhail Glukhikh 036f9affd8 K2: link via signatures if -Xlink-via-signatures is set
Related to KT-53505
2022-09-14 10:15:22 +00:00
Alexander Udalov 7dad47cd76 Add -X argument to disable generation of @SourceDebugExtension
This will be used in tests in the subsequent commit.
2022-09-09 14:32:35 +02:00