Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[K2] Use only stable compiler API #3141

Open
IgnatBeresnev opened this issue Aug 24, 2023 · 5 comments
Open

[K2] Use only stable compiler API #3141

IgnatBeresnev opened this issue Aug 24, 2023 · 5 comments
Assignees
Labels
language: Kotlin Issue/PR related to the Kotlin language feature/analysis/docs tech-debt A technical issue that is not observable by the users, but improves maintainers quality of life topic: K2 Issues / PRs that are related to the K2 migration. See #2888 upstream bug An issue that appears due to an upstream dependency bug, such as kotlin-compiler

Comments

@IgnatBeresnev
Copy link
Member

This issue is part of a larger issue: Sustainability of dependencies (#3127)

Context

As described in #3127, the K1 compiler API that Dokka relies on is not stable, and internal compiler refactorings, new features and bugfixes sometimes (unwillingly and unknowingly) have a very negative impact on Dokka. We aren't the only ones with this problem, so one of the goals of the new K2 compiler is to introduce separate API-only artifacts that would be stable and not affected by internal compiler changes.

As of Kotlin 1.9.10, this stable compiler API is still in the works, so Dokka has to depend on a bunch of artifacts with questionable stability — some required for the needed API, some for runtime only.

Goal

Dokka should, sooner or later, only rely on the stable compiler API, and all of the compiler runtime dependencies (== API implementations) should (ideally) be provided as a single or a number of artifacts with runtimeOnly scope.

This will require working with the team responsible for the compiler API to make sure that all of Dokka's use cases are covered. It will take time for that team to implement the API that Dokka needs, so this issue exists to keep track of progress.

@IgnatBeresnev IgnatBeresnev added the language: Kotlin Issue/PR related to the Kotlin language feature/analysis/docs label Aug 24, 2023
@IgnatBeresnev IgnatBeresnev added this to the K2 compiler analysis milestone Aug 24, 2023
@IgnatBeresnev
Copy link
Member Author

After a quick chat with @darthorimar, we agreed that the Dokka team will create a list of non-stable API that Dokka uses (in other words, the API we use from non-API / implementation artifacts). Then we can discuss it together and decide what to do with this API - either also extract / stabilize it, or come up with stable alternatives.

@IgnatBeresnev IgnatBeresnev added the tech-debt A technical issue that is not observable by the users, but improves maintainers quality of life label Aug 24, 2023
@IgnatBeresnev
Copy link
Member Author

IgnatBeresnev commented Sep 22, 2023

Subtasks:

  1. After implementing [K2] Migrate to new Standalone Analysis API #3114, collect a list of non-stable API and discuss it with the compiler API team.
  2. After implementing [K2] Support KMP projects #3137, we'll refine the list, as we might end up using more unstable API to support it that we didn't have to use before.

@IgnatBeresnev IgnatBeresnev added the topic: K2 Issues / PRs that are related to the K2 migration. See #2888 label Oct 13, 2023
@IgnatBeresnev IgnatBeresnev removed this from the K2 compiler analysis milestone Oct 13, 2023
@IgnatBeresnev IgnatBeresnev self-assigned this Nov 3, 2023
@vmishenev
Copy link
Member

Needed API for Dokka:
KT-63339

@vmishenev
Copy link
Member

vmishenev commented Nov 21, 2023

It is expected Analysis API's sourcePsiSafe should support Java sources as well. It depends on KT-53669
After KT-53669, all uses of KtSymbol.origin should be revisited.

@IgnatBeresnev
Copy link
Member Author

IgnatBeresnev commented Dec 12, 2023

@IgnatBeresnev IgnatBeresnev added the upstream bug An issue that appears due to an upstream dependency bug, such as kotlin-compiler label Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language: Kotlin Issue/PR related to the Kotlin language feature/analysis/docs tech-debt A technical issue that is not observable by the users, but improves maintainers quality of life topic: K2 Issues / PRs that are related to the K2 migration. See #2888 upstream bug An issue that appears due to an upstream dependency bug, such as kotlin-compiler
Projects
None yet
Development

No branches or pull requests

2 participants