Commit Graph

109286 Commits

Author SHA1 Message Date
Andrei Tyrin 4e10dcd808 [tests] Klib based signature clash improve coverage for KT-63670 2024-02-27 14:01:44 +00:00
Artem Daugel-Dauge fff5a412ec [Gradle] Xcode version too high warning
Adds new warning diagnostic that checks that selected Xcode version is not higher than latest tested with the current Kotlin version

^KT-62373 Verification Pending
2024-02-27 13:23:55 +00:00
Artem Daugel-Dauge e822375461 [Gradle] Fix CocoaPods configuration cache IT for Gradle 8.6 2024-02-27 13:23:33 +00:00
Alexander Shabalin 0882d1752d [K/N][tests] Fix path-separator handling ^KT-65977 2024-02-27 13:20:50 +00:00
Alexander Shabalin c491858a49 [K/N][tests] Add EnforcedHostTarget to atomicfu tests ^KT-65977 2024-02-27 13:20:50 +00:00
Alexander Shabalin a8fcef9cca Revert "[K/N][tests] Remove atomicfu tests from :nativeCompilerTest ^KT-65977"
This reverts commit 513f86f8fc.
2024-02-27 13:20:50 +00:00
Alexander.Likhachev 2d161723d5 [Gradle] Regenerate Gradle compiler arguments DSL
^KT-65986 Fixed
2024-02-27 13:07:18 +00:00
Alexander.Likhachev 95fd91ae16 [CLI, Gradle] Update GradleDeprecatedOption.removeAfter values
The values updated to follow the deprecation cycle "warning -> error -> removed"
^KT-65986 In Progress
2024-02-27 13:07:18 +00:00
Alexander.Likhachev d20f31e963 [CLI, Gradle] Fix GradleDeprecatedOption.removeAfter processing
The expected format was Kotlin language version (e.g. `2.0`), however the actual passed values were Kotlin release versions (e.g. `2.0.0`)
^KT-65986 In Progress
2024-02-27 13:07:18 +00:00
Alexander.Likhachev 83a9ac62ea [Gradle] Regenerate Gradle compiler arguments DSL
^KT-65986 In Progress
2024-02-27 13:07:18 +00:00
Alexander.Likhachev d40d1316d3 [CLI, Gradle] Suppress deprecation errors in generated compiler arguments DSL
^KT-65986 In Progress
2024-02-27 13:07:18 +00:00
Alexander Shabalin ac6aad1f65 [K/N][tests] Do not run objcexport-header-generator in backend.native:tests ^KTI-1571 2024-02-27 12:24:36 +00:00
Roman Efremov 23ae617ea0 Fix inaccurate report of DEPRECATED_ACCESS_TO_ENTRY_PROPERTY_FROM_ENUM
Add separate diagnostic for the case when it is reported on qualifiers.

^KT-64488
2024-02-27 11:22:35 +00:00
Roman Efremov 02b5fed389 Fix inaccurate report of DEPRECATED_ACCESS_TO_ENTRY_PROPERTY_FROM_ENUM
It can be reported not only from within the enum, but also from
top-level functions. Add separate diagnostic for such cases.

^KT-64488
2024-02-27 11:22:35 +00:00
Roman Efremov 34d87465ac [Test] Add test for Enum.entries shadowing when property is imported
This is similar to KT-64488 but without context receivers.
Warning message "access ... from within the enum" is also incorrect
here.

^KT-64488
2024-02-27 11:22:35 +00:00
cristiangarcia e83d2e31d4 Fix CompileToBitcodePlugin onlyIf to make it CC compatible
Required for KTI-1553
2024-02-27 10:32:58 +00:00
Vyacheslav Gerasimov c382b0e2b3 Build: Remove kotlin-compiler from dependencies during Idea import
#KTI-1598
2024-02-27 10:29:59 +00:00
Vyacheslav Gerasimov 8fd3166199 Build: Remove coroutines-core dependency from backend.native:tests
The dependency on kotlinx-coroutines-core seems redundant and always
overridden by another dependency.
2024-02-27 10:29:59 +00:00
Vyacheslav Gerasimov f924de5a2c Build: Remove unused dependencies on :kotlin-compiler project
#KTI-1598
2024-02-27 10:29:59 +00:00
Timofey Solonin 5ddc7b47ef Add a task to hierarchically assemble multiplatform resources
^KT-65540
2024-02-27 10:27:38 +00:00
Timofey Solonin 74628c0394 Register multiplatform publication extension
^KT-65540
2024-02-27 10:27:38 +00:00
Timofey Solonin ea0c3837a0 Add kotlin.mpp.enableResourcesPublication feature toggle
^KT-65540
2024-02-27 10:27:38 +00:00
Mikhail Glukhikh 678816f9e8 K1: introduce BUILDER_INFERENCE_STUB_PARAMETER_TYPE to prevent compiler crashes
This diagnostic is reported in rare situations when
StubTypeForBuilderInference is kept as a parameter type
of for loop or lambda. Before this commit, we had in K1
"Could not load module <error module>" from IrLinker instead.

Related to: KT-52757, KT-53109, KT-63841, KT-64066
#KT-53478 Fixed
2024-02-27 10:25:13 +00:00
Dmitriy Novozhilov 6f6e37f552 [FIR] Report about recursion in implicit types for receivers of invoke
^KT-65576 Fixed
2024-02-27 09:34:02 +00:00
Dmitriy Novozhilov 234cc5be2b [Test] Reproduce KT-65576 2024-02-27 09:34:02 +00:00
Mikhail Glukhikh 91e9fbd9bf K1: change depr. level of List.getFirst to HIDDEN but don't force it on overrides
#KT-65441 Fixed
2024-02-27 08:40:53 +00:00
Mikhail Glukhikh d870d9dcc6 K1/K2: add tests for KT-65441 current behavior 2024-02-27 08:40:52 +00:00
Nataliya.Valtman 5885514c3d Add JSON output type for build reports
#KT-65792 Fixed
2024-02-27 08:32:36 +00:00
Artem Olkov f493df42a9 [Swift Export] fix swift export full test by adding missing runtime modulemap
Merge-request: KT-MR-14627
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
2024-02-27 08:15:12 +00:00
Evgenii Mazhukin 347eedb0a0 [JPS][IC] Fix the use of Jps-dependency-graph API for lookups
All dependencies should be registered before the Backend::associate().

^KT-65429


Merge-request: KT-MR-14616
Merged-by: Evgenii Mazhukin <evgenii.mazhukin@jetbrains.com>
2024-02-27 07:42:15 +00:00
Anton Lakotka 3ff2bc403c [Gradle] Report warning when there is multiple source roots in compilation
This issue should warn users about possible problems in K2 compiler.
Because in this setup there will be no symbols visibility between
those source set roots as it used to be in K1.
There is an assumption that this case usually appears in the code
generation setup. And users might not experience any problems before.

^KT-64913 Verification Pending
2024-02-27 02:01:25 +00:00
Marco Pennekamp b5eccd63b1 [AA] Fix compilation facility "multi binary module" test module structure
- The module structure for these tests was set up backwards: We should
  keep the test module kind of the main module flexible (as it is
  configured by test configurators), but keep the module kinds of the
  binary libraries fixed.

^KT-65960
^KT-64994
2024-02-26 21:57:23 +00:00
Marco Pennekamp 4ea3de1760 [AA] Refactoring: Rename KtModuleFactory to KtTestModuleFactory
^KT-65960
2024-02-26 21:57:23 +00:00
Marco Pennekamp 3f04604187 [AA] Tests: Improve handling of dependencyPaths
- The name wasn't specific enough.
- Remove default `emptyList()` argument from `CompiledLibraryProvider`
  so that passing `dependencyBinaryRoots` isn't missed. (My changes
  didn't include it in `KtLibraryBinaryModuleFactoryBase` yet, but it
  was actually missed from `KtLibrarySourceModuleFactory` even in the
  original commit.)

^KT-65960
^KT-64994
2024-02-26 21:57:23 +00:00
Marco Pennekamp 5663521a36 [AA] Tests: Remove topological ordering from KtTestModule creation
- The test infrastructure already requires test modules to be properly
  ordered regarding dependencies, so a module A which is a dependency
  for a module B must always be ordered before B. Hence, it makes no
  sense to also order modules topologically.
- Reordering modules may cause the resulting `KtTestModule`s to be
  out-of-order with the test modules, because the topological order
  might be different from the test module order, even if the dependency
  relationship already holds in the original order.
  `KtTestModuleProjectStructure` requires the same ordering as test
  modules to ensure the same order during iteration of `KtTestModule`s.

^KT-65960
^KT-64994
2024-02-26 21:57:23 +00:00
Marco Pennekamp c7ccfcc785 [AA] Fix sealed inheritors provider for binary libraries in Standalone tests
- Since binary libraries don't carry decompiled files anymore, the
  static declaration provider doesn't index binary libraries in the
  Standalone mode, where we don't use stub-based deserialization. This
  led `LLSealedInheritorsProviderFactoryForTests` to fail in Standalone
  mode for sealed classes from binary libraries, as this provider is now
  populated from the declaration provider's index (see the previous
  commit). Luckily, class-based deserialization sets
  `sealedInheritorsAttr`, so we can simply use this attribute.

^KT-65960
2024-02-26 21:57:23 +00:00
Marco Pennekamp e62038f5f3 [AA] Tests: Rewrite sealed class inheritors collection to use the declaration provider
- Now that binary libraries are decompiled to stubs instead of PSI
  files, we cannot collect sealed inheritors from `KtFile`s anymore.
  Since all `KtFile`s and binary library stubs are both indexed by the
  declaration provider, we can collect inheritors from its index
  instead.
- Invalidating all sessions at the end of `prepareSealedClassInheritors`
  fixes some improper resolve phases in lazy resolution test data. While
  the previous implementation requested an uncached resolve session, it
  didn't account for sessions of dependencies still being cached.

^KT-65960
2024-02-26 21:57:23 +00:00
Marco Pennekamp 47afd37596 [AA] IDE mode tests: Build and index stubs for binary libraries
- Instead of indexing binary library declarations from decompiled PSI,
  the static declaration provider now builds and indexes stubs. As noted
  in KT-65960, this brings IDE mode tests much more in line with
  decompiled stubs indexing in the IDE. It should allow us to catch
  issues with the stub-based deserialized symbol provider outside of IDE
  tests.
- In the Standalone mode, we can skip stub-indexing completely, as we
  provide FIR symbols via class-based deserialization. This also extends
  to shared binary roots.

^KT-65960 fixed
2024-02-26 21:57:23 +00:00
Marco Pennekamp 78ef58bef4 [AA] Tests: Remove decompiled files from LibraryBinary and add LibraryBinaryDecompiled
- `LibraryBinary` should not contain any decompiled files, as we want
  FIR symbols in tests to be provided from indexed stubs or class files,
  but definitely not from decompiled PSI. This brings `LibraryBinary`
  much closer to the behavior of binary libraries in the IDE.
- Some tests may still require access to a decompiled file, for example
  when trying to test `getOrBuildFir` for some `KtElement` coming from a
  library. This commit introduces `LibraryBinaryDecompiled`, which
  does contain decompiled files.
- We don't really need `LibraryBinary` as a main test module kind
  anymore, since tests generally want to access some main `KtFile`.
  Hence, test configurators for `LibraryBinary` have been turned into
  configurators for `LibraryBinaryDecompiled`.
- An alternative would be decompiling files on demand, but this is not
  currently feasible because the Standalone API doesn't reconcile stubs
  with decompiled PSI, like the IDE does automatically. (For the same
  declaration, the stub and the PSI will have a different identity.) As
  long as there is no support for this, we'll have to rely on a separate
  test module kind.

^KT-65960
2024-02-26 21:57:23 +00:00
Marco Pennekamp 7baaa38b8a [AA] Add KtTestModule.moduleKind
- `TestModule.explicitTestModuleKind` requires a directive to be present
  to get the `TestModuleKind`. But we still want to find out the test
  module kind for test modules without a directive. Hence, we have to
  add this property to `KtTestModule` during its construction.

^KT-65960
2024-02-26 21:57:23 +00:00
Marco Pennekamp dc0f498b15 [AA] Simplify prepareFilesInModule with KtTestModule
^KT-65960
2024-02-26 21:57:23 +00:00
Marco Pennekamp 6cc414bdfd [AA] Simplify createProjectStructureByTestStructure with KtTestModule
^KT-65960
2024-02-26 21:57:23 +00:00
Marco Pennekamp 2060709c03 [AA] Turn KtModuleWithFiles into KtTestModule (AA test framework)
- `KtModuleWithFiles` isn't actually used in a production Standalone API
  context, but it was exposed via `analysis-api-standalone-base`. In
  current production usages, the project structure is built with the
  module builder DSL.
- Hence, `KtModuleWithFiles` is only relevant for tests. This commit
  moves `KtModuleWithFiles` to the Analysis API test framework and
  renames it to `KtTestModule`. This removes any risk that an outside
  user could start using `KtModuleWithFiles` and completely uncouples
  the test project structure from production APIs.
- In addition, we can add the `TestModule` to `KtTestModule`, allowing
  tests to quickly access the original test module, for example to check
  the test module kind.
- The commit also removes the data class status of `KtTestModule` and
  `KtTestModuleProjectStructure` to avoid issues with destructuring when
  properties are added or removed.

^KT-65960
2024-02-26 21:57:23 +00:00
Marco Pennekamp 878eba7d52 [AA] Introduce AnalysisApiIndexingConfiguration test service
- The configuration allows the test infrastructure to decide whether to
  index binary libraries to stubs (when stub-based deserialized symbol
  providers are used) or to skip indexing (when class file-based
  deserialization is used).
- The information is needed in `AnalysisApiBaseTestServiceRegistrar`,
  where the `KotlinStaticDeclarationProviderFactory` is created. This
  service registrar shouldn't access `LLFirLibrarySymbolProviderFactory`
  and so checking the library symbol provider factory wasn't an option.
- Another alternative was adding a property to
  `AnalysisApiTestConfigurator`. However, this then requires passing the
  property to `AnalysisApiBaseTestServiceRegistrar`, because it doesn't
  have access to the configurator out of the box. This however goes
  against the design of our service registrars, which generally only
  access test services. So adding a test service seemed like the best
  solution.

^KT-65960
2024-02-26 21:57:23 +00:00
Alexander Udalov d4278250e6 IR: never check static members for overridability
#KT-66077 Fixed
2024-02-26 20:38:02 +00:00
Yahor Berdnikau bdb96dc0db [Gradle] Rename to HasConfigurableKotlinCompilerOptions
Added "Kotlin" to better indicate to what this interface belongs to.

^KT-65196
2024-02-26 19:32:26 +00:00
Alexander Shabalin edf05b69ac [K/N][performance] Fix build 2024-02-26 18:06:44 +00:00
Jaebaek Seo 2f64a878e4 K2: Support dependency symbol providers for binary libraries
When a symbol X from a binary library A uses another symbol Y from
another binary library B, `LLFirDependenciesSymbolProvider` cannot
resolve Y for X. This is because the existing
LLFirAbstractSessionFactory passes symbol providers for only builtin
libraries to `LLFirDependenciesSymbolProvider` even when the session has
dependencies. As a result, when `LLFirDependenciesSymbolProvider`
searches a symbol, it can find only symbols from the builtin libraries,
but it cannot find a symbol from libraries other than builtin libraries.
This happens only for the binary libraries.

^KT-65240 Fixed
2024-02-26 18:02:08 +00:00
Yan Zhulanow 42c2e7d503 [Analysis API] Minor, prettify 'createModules()' 2024-02-26 18:02:08 +00:00
Yan Zhulanow b925462852 [Analysis API] Minor, tune the 'createModule()' signature
Move the 'dependencyPaths' parameter closer to other traits of
a created module.
2024-02-26 18:02:08 +00:00