Commit Graph

13879 Commits

Author SHA1 Message Date
Anton Lakotka 373c838ebb [Gradle] Enable applyDefaultHierarchyTemplate back for...
...testCInteropsDoesNotDependOnAnySourceCompilation test

^KT-59596 Verification Pending
2023-08-17 15:47:55 +00:00
Anton Lakotka b37ebb47d9 [Gradle] Draft implementation of Configurations for Commonized CInterops
Introduce *CommonizedCInterop & *CommonizedCInteropElements configurations
and fix CInteropCommonizerTask to consume dependencies / expose artifacts
via these configurations.
2023-08-17 15:47:55 +00:00
Ilya Gorbunov c98377af7b Add js compiler disambiguation attribute to fix errors on project import
There were remaining configurations in legacy JS projects with amiguous attributes requesting kotlin-stdlib. They are not used in build, but resolved on import.
2023-08-16 14:25:54 +00:00
Hung Nguyen 894ba9ab80 [IC] Relocatable IC caches for projects with custom buildDir
IC caches often contain file paths. To make them relocatable, we need
to convert these file paths into relative paths, relative to a base
directory.
  - If the file paths are source files, we can use the root project
    directory as base.
  - If the file paths are class files, we should use the classes
    directory as base (before this commit, we used the root project
    directory in both cases, that's why we hit KT-58547).

The key changes in this commit include:
  - RelocatableFileToPathConverter: converts paths to relative paths
  - IncrementalCompilationContext: contains 2 different path converters,
    one for source files and one for class files
  - SourceToOutputFilesMap: maps source files to class files using the
    above path converters
  - IncrementalCompilerRunner: creates the path converters based on file
    locations

Test: RelocatableFileToPathConverterTest unit test
      SourceToOutputFilesMapTest unit test
      BuildCacheRelocationIT.testCustomBuildDirectory integration test
^KT-58547 Fixed
2023-08-16 13:40:19 +00:00
Bogdan Mukvich e89334e5ba [Build] Update gradle enterprise 2023-08-16 12:36:28 +00:00
Alexander.Likhachev 765a8bdd7c [Gradle] Fix JsIrConfigurationCacheIT was disabled by a mistake
It was marked as an abstract class and thus wasn't executed
2023-08-16 09:48:48 +00:00
Dmitrii Krasnov 8a576438ce Turned off KotlinNativeLinkIT.defaultValueForPartialLinkage on Windows, caches are not supported there yet
KT-60839
2023-08-15 16:10:22 +00:00
Dmitry Savvinov c359f684cd [Gradle] Don't print stacktraces in IDEA sync
IDEA sync is always launched with equivalent of `--stacktrace`, so
checking startParameter.showStacktrace is unreliable.

This commit instead mutes printing of stacktraces in sync unless the
internal property is specified. If users want stacktraces, they're
expected to launch Gradle task with `--stacktrace`.

In the extremely rare cases where the stacktrace is needed
*specifically* during IDE sync,
`kotlin.internal.diagnostics.showStacktrace=true` can be used

^KT-61172
2023-08-15 10:11:45 +00:00
Ilya Goncharov a5893d4bee [Gradle, JS] Build service npm resolution manager does not contain packageJsonHandlers
^KT-60469 fixed
2023-08-15 09:10:10 +00:00
Leonid Startsev 8b821e1feb Deprecate KmProperty.hasGetter(hasSetter) in favor of KmProperty.getter(setter)
as a follow-up of flag deprecation.

#KT-59440
2023-08-14 12:36:34 +00:00
Sebastian Sellmair 1c2eab39d2 [Gradle][Minor]: Update comment on 'shouldUseOldKtorAndCoroutinesExternalDependencies'
KT-60901
2023-08-14 11:28:21 +00:00
Timofey Solonin d25d0e4f94 [MPP] Validate which configurations resolve for explicit stdlib-js dependency
^KT-60901
^KT-61126
2023-08-11 14:52:03 +00:00
Timofey Solonin 78e09816e5 [MPP] Use assemble instead of resolving all configurations
We expect that some configurations might fail to resolve in the case of
stdlib-js dependency if they are resolved explicitly. These configurations
should not actually resolve for the KGP user.

^KT-60901
^KT-61126
2023-08-11 14:52:03 +00:00
Sebastian Sellmair db1ee743ae [Gradle] Adjust functionalTests for stdlib-jdk7, stdlib-jdk8 constraint to 1.8.0
^KT-60901 Verification Pending
2023-08-11 14:52:03 +00:00
Sebastian Sellmair be867d0f25 [Gradle] Fix testMultiModulesHmppKt48370 missing cinterop opt-in
^KT-60901 Verification Pending
2023-08-11 14:52:03 +00:00
Sebastian Sellmair 65bc494a1a [Gradle] MppSharedNativeCompileIT: Disable K2 test because of 'KT-60943'
^KT-60901 Verification Pending
2023-08-11 14:52:03 +00:00
Sebastian Sellmair 73483b7a77 [Gradle] Update functionalTests to reflect kotlin-stdlib-common pointing to kotlin-stdlib
^KT-60901 Verification Pending
2023-08-11 14:52:03 +00:00
Sebastian Sellmair 59b29dc2b9 [Gradle] Update NativeIrLinkerIssuesIT to reflect changes in stdlib
^KT-60901 Verification Pending
2023-08-11 14:52:03 +00:00
Sebastian Sellmair 65e467dd5b [Gradle] Update NativeExternalDependenciesIT to reflect changes in stdlib
^KT-60901 Verification Pending
2023-08-11 14:52:03 +00:00
Sebastian Sellmair ada446b68f [Gradle] Update HierarchicalMppIT to reflect changes in stdlib
^KT-60901 Verification Pending
2023-08-11 14:52:03 +00:00
Sebastian Sellmair 00362390eb [Gradle] Ensure default stdlib is added to dependsOn source sets
^KT-60901 Verification Pending
2023-08-11 14:52:03 +00:00
Sebastian Sellmair 10f3704b35 [Gradle] Update MppCompositeBuildIT to reflect changes in stdlib
^KT-60901 Verification Pending
2023-08-11 14:52:02 +00:00
Sebastian Sellmair 12c3b981c4 [Gradle] Do not run 'IdeTransformedMetadataDependencyResolver' on 'single kotlin target' Source Sets
This will prevent transformed kotlin-stdlib source sets from
being resolved for leaf (e.g. jvmMain) as well as bamboo (jvmBambooMain)
source sets. For such source sets only the jvm jar shall be attached

^KT-60901 Verification Pending
2023-08-11 14:52:02 +00:00
Sebastian Sellmair 23ddabd5d7 [Gradle] Update WasmDependencyResolutionSmokeTest to reflect changes in stdlib
^KT-60901 Verification Pending
2023-08-11 14:52:02 +00:00
Sebastian Sellmair e9a1025c37 [Gradle][Minor] Update IdeJvmAndAndroidDependencyResolutionTest to newer version of mvikotlin
This is just a maintenance commit

^KT-60901 Verification Pending
2023-08-11 14:52:02 +00:00
Sebastian Sellmair bafb1aac80 [Gradle] Update IdeStdlibResolutionTest to reflect changes in stdlib
^KT-60901 Verification Pending
2023-08-11 14:52:02 +00:00
Sebastian Sellmair fa2b21e71b [Gradle] Update IdeOriginalMetadataDependencyResolverTest: Test with kotlin-test-common instead of stdlib
(because stdlib is now published with new metadata formats)

See: KT-56278
^KT-60901 Verification Pending
2023-08-11 14:52:02 +00:00
Sebastian Sellmair f06a1c89ef [stdlib-mpp] Publish patched/custom kpsm to list 'commonMain' included into 'nativeApiElements'
Native/Shared Source Sets still requires stdlib:commonMain.klib as
dependency for IDE analysis.

See: KT-56278
^KT-60901 Verification Pending
2023-08-11 14:52:02 +00:00
Sebastian Sellmair 243707c956 Revert "[stdlib-mpp] Disable/ignore failing tests in Kotlin Dev"
This reverts commit 171d156688.

KT-60901
2023-08-11 14:52:02 +00:00
Kirill Rakhman 724d527fd8 [FIR] Fixes for call conflict resolution
Let ConeCompositeConflictResolver pass the results of the previous
resolver to the next one.
Otherwise, we get false positive conflicts when a set of candidates
can't be fully reduced by one resolver but could be resolved by the
subsequent application of multiple ones.
This change makes ConeCompositeConflictResolver order-dependent and
thus, ConeOverloadConflictResolver must be invoked last, because it
must work on a pre-filtered list.

Also, let ConeEquivalentCallConflictResolver use
FirStandardOverrideChecker instead of compareCallsByUsedArguments
because it's stricter.

This all fixes a false positive overload resolution ambiguity in common
metadata compilation that is caused by stdlib using the new KMP
format.
Now stdlib metadata is in the classpath, and so declarations from the
stdlib are returned from both MetadataSymbolProvider and
KlibBasedSymbolProvider.
This isn't a problem per se because duplicate candidates are filtered
out by ConeEquivalentCallConflictResolver (K1 works analogously), but
in the case of top-level functions with generic receivers like
Collection<T>.toTypedArray, the check failed because of the direct
comparison of receiver types.

#KT-60943 Fixed
2023-08-11 10:54:24 +00:00
Ilya Gorbunov 3e4cbd6dd2 Publish Gradle metadata for kotlin-stdlib-common, KT-60911
This makes it depend on kotlin-stdlib in all targets
and have no artifacts from Gradle's point of view
2023-08-11 08:49:23 +00:00
Dmitry Savvinov e8289181e6 [mpp] Minor: diagnostic messages clean-up
- Mention link to docs about templates in warning messages
^KT-60491 Fixed

- Make sure that each warning mentions some way to solve the problem
  aside from disabling default template

- Fix small syntactical bug in code sample

- fix incorrect indentation in trimMargin after joinToString

- Use kotl.in in Kotlin12XMppDeprecation
2023-08-11 08:26:14 +00:00
Dmitry Savvinov edbaed0da9 [Gradle] Minor: restore link to page about JVM toolchains in warning text
The link has been accidentally lost during migration of diagnostics to
the new infrastructure
2023-08-11 08:26:14 +00:00
Nikita Bobko d39755b578 [FE] Convert specific diagnostic for actual function with default arguments into a common incompatibility
^KT-59665 Fixed
Review: https://jetbrains.team/p/kt/reviews/11039/timeline

It's better to have this logic in common place
(AbstractExpectActualCompatibilityChecker) to avoid missing compilation
errors in the future

This commit fixes:
1. Missing compilation error for actual function with default arguments
   for 'actual typealias' KT-59665
2. Missing compilation error for actual function with default arguments
   for actual fake-override KT-59665

Alternative solution for KT-59665 is to create a special checker.

"incompatibility" vs "special checker":

Arguments for common incompatibility:
- What if we had a rule that expect and actual default params must
  match? If so then it certainly would be an incompatibility.
- Technically, we do the matching of expect and actual params (because
  we allow default params in common ancestors of expect and actual
  declarations).
- It's hard to check that the actual definition doesn't use default
  params because `ExpectedActualResolver.findActualForExpected` filters
  out fake-overrides and doesn't return them. It's not clear logic for
  me, that I'm afraid to touch.
  implicitActualFakeOverride_AbstractMap.kt test breaks if you drop this
  weird logic
- WEAK incompatibilities can be considered as "checkers". So it doesn't
  matter how it's implemented, as a "incompatibility" or a "checker"

Arguments against common incompatibility:
- Although we match expect and actual declarations to allow default
  params in common ancestors of expect and actual declarations, it's
  still can be considered that we check that the actual declaration
  doesn't have default params. And it doesn't feel right that we check
  correctness of the actual declaration in expect-actual matcher.
- ~~It may change the rules of expect actual matching~~ (It's not true,
  because ActualFunctionWithDefaultParameters is declared as WEAK
  incompatibility)
2023-08-10 15:46:46 +00:00
Ilya Gorbunov aaa068596c [Gradle] Disable stdlib-jdk7/8 alignment from 1.9.20
Reason: kotlin-stdlib now publishes Gradle metadata with the required dependency constraints for these artifacts

KT-55297
2023-08-10 10:35:54 +00:00
Ilya Gorbunov 0882c645dd [stdlib-mpp] Move dependency constraints to api dependencies, KT-55297
Constrained alignment is also required for compile time dependencies
2023-08-10 10:35:54 +00:00
Dmitrii Krasnov 682cb991b8 Test for PartialLinkageMode resolving fix
#KT-60839 Fixed
2023-08-09 15:13:24 +00:00
Aleksei.Cherepanov c8c3565a24 Fix JPS import
Exclude kotlin-stdlib-js project for JPS build. Related to KT-56106

#KT-61059 Fixed


Merge-request: KT-MR-11527
Merged-by: Aleksei Cherepanov <aleksei.cherepanov@jetbrains.com>
2023-08-09 14:37:21 +00:00
Ilya Goncharov 949e4be658 [Gradle, JS] Add test with cross modules with compose dependency 2023-08-09 11:45:58 +00:00
Leonid Startsev f450122d63 Refactor MetadataExtensions.kt to remove extension visitors
This helps to completely get rid of Visitors API during reading and writing
of the JVM metadata.

Note: Klib writers still use .accept and left for future refactorings.

See also #KT-59442
2023-08-09 10:16:27 +00:00
Leonid Startsev b8e4b44b04 Promote DeprecationLevel on Visitors API to ERROR
Rewrite Readers.kt and Writers.kt to avoid using
Visitors API

Align KotlinCommonMetadata/KotlinModuleMetadata API with
KotlinClassMetadata one (it is necessary for restructured reading/writing)

#KT-59442 In Progress
2023-08-09 10:16:27 +00:00
Yahor Berdnikau 380062c511 [repo] Update the shadow version to 8.1.1 release
https://github.com/johnrengelman/shadow/releases/tag/8.1.1
2023-08-09 08:36:46 +00:00
Anton Lakotka 7c5dd7c451 [stdlib-mpp] Add dependency constraint on kotlin-stdlib-common for...
...other variants where it can be expected. Such as:

* commonMainMetadataElements (legacy metadata)
* metadataElements (klib metadata)
* nativeApiElements

This would prevent from leaking kotlin-stdlib-common dependencies of
older Kotlin versions. So every KGP configuration where
stdlib dependencies is configured automatically will enforce dependency
constraints on kotlin-stdlib-common.

^KT-61053 Verification Pending
2023-08-09 07:52:35 +00:00
Igor Yakovlev 87ab88957d [Wasm] Fix wasm-target compiler key in gradle plugin 2023-08-08 18:35:31 +00:00
Ilya Goncharov a3aa1f6121 [Gradle, Wasm] Add wasm wasi stdlib by default 2023-08-08 18:35:31 +00:00
Igor Yakovlev 223e590dcd [Wasm] Temporary task to provide wasm stdlib tests 2023-08-08 18:10:20 +02:00
Igor Yakovlev 5d7781c40a [Wasm] Update node.js version to 20.2.0 2023-08-08 18:10:20 +02:00
Igor Yakovlev 983991d46c [Wasm] Add box and stdlib tests in wasi mode 2023-08-08 18:10:19 +02:00
Igor Yakovlev f42d0b1ed4 [Wasm] Add wasi kotlin.test target gradle buildscript 2023-08-08 18:10:19 +02:00
Igor Yakovlev d1c7caf15c [Wasm] Add wasi stdlib target gradle buildscript
KT-56608
2023-08-08 18:10:19 +02:00