-
Notifications
You must be signed in to change notification settings - Fork 411
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
potential fix for compatibility with KGP 1.9 #3081
Conversation
runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt
Outdated
Show resolved
Hide resolved
runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt
Outdated
Show resolved
Hide resolved
Thank you for taking a shot at this! I explained in more detail the high-level reason for why this is happening here. TLDR: some changes were made in KGP, and it doesn't fully support single-target multiplatform projects (not in the usual way), so Dokka is having issues in exactly the place you made changes to :) We also had a discussion with the KMP team a few days ago about what exactly the technical reason was, and what could be done on Dokka's end to fix it, both short and long term solutions. I plan to write down a summary at the beginning of next week, so it should hopefully provide enough background and context for you to proceed with the PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've finally had time to have a closer look at this PR and the issues with Kotlin 1.9.0 in general.
It seems like these are two separate problems:
- support for single-target multiplatform projects
- inter-module native dependency resolution thing
The first problem about single-target KMP projects is not completely fixed in this PR - I'll provide more details in one of the comments. We also decided that we need to include a fix for it to Dokka 1.9.0, which is already overdue, so we'd like to take this particular issue off your hands :)
The second issue, however, is interesting - you've potentially found the problem and a fix for it, so I'd like to discuss it further and merge it if the fix is OK. I'll also leave a more detailed comment below
runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt
Outdated
Show resolved
Hide resolved
runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt
Outdated
Show resolved
Hide resolved
runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt
Outdated
Show resolved
Hide resolved
Single-target projects were somewhat "fixed" in #3103 (sorry that you need to resolve merge conflicts now), so we can focus on addressing #3068 in this PR If you don't mind, I'll resolve the long conversations above as there were mostly clarifications, and I'll sum them up here instead. I've also discussed the proposed solutions with Sebastian from the Kotlin Multiplatform team, and will include his thoughts below.
Given the tight schedule for 1.9.0 (it's pretty much ready for final testing), and that this place in general is quite scary to change and has led to serious problems before, I would propose the following: For < 1.9.0, use the current behaviour (along with keeping compatibility with < 1.7 and so on). For >= 1.9.0:
Additionally:
The reason for not enabling the Right after merging the PR and cherry-picking the commit into the release branch:
There should be about a month between 1.9.0 and 1.9.10, which gives us time to dogfood and find problems with Code-wise, to avoid a bunch of if-else branches, maybe it'll be easier to refactor the file a little, and extract pre-1.9.0 and >=1.9.0 solutions into separate classes / functions, it's up to you What do you think? :) |
@IgnatBeresnev Nice plan! I like it. Also big thanks for summarising everything, good job! |
@whyoleg awesome, thank you! |
So, I've pushed changes. 2 flags introduced:
I've tested it on my project - everything works fine here with flag After that, I've decided to run some integration tests with this flag set to true and Then I've decided to check on replacement of deprecation of So, to summarise, excluding platformDependencyFiles is not an option for projects, which expose It's up to you to decide, should we leave this flag, for excluding platformDependencyFiles, or not, while for my project it's a solution (as there is no such declarations exposed), for other it will be not acceptable. |
Also, is there a good place to document those flags? |
Well done! I'll have a closer look towards the evening
Oh, thank you for researching and confirming what Sebastian mentioned! I believe in these situations
As there are no guarantees and we don't plan to support these flags for long, I think it's better to only post them in the comments of issues (which should be googlable by the error message), as opposed to some official documentation. I need to close the duplicates though, so that all of the related bugs lead to a single issue in which these flags will be suggested as a workaround - I'll do it this week. I guess I should also mention it in the release notes, that some projects with But maybe you have some other suggestions? |
I've also approved the GitHub Actions that run integration tests, and it seems like there are some compatibility problems:
Because this is your first contribution, I have to manually approve the runs after your every commit, but if you want - you can send a PR with updating some library version (like kotlinx-bcv), I'll merge it quickly, and after that the actions should be run automatically. Or you can initialize git submodules locally, and then run kotlinx.coroutines / kotlinx.serialization from IDEA ( |
Yeah, that's what I've seen when checking produced by test results.
Yes, I agree, that will be enough, as those flags are mostly for workarounds
Oops, haven't run all integration tests (too much resources needed), will recheck locally later today, thx! |
I've pushed fix for compatibility with older kotlin versions. Haven't spotted, that previously Also, run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, thank you!
Just in case, I'll trigger longer integration tests on TeamCity now, as well as thorough tests with more platforms, and will merge the PR tomorrow if there are no problems
(upd to not lose the link: thorough tests run)
return oldCompileClasspathOf(project) | ||
} | ||
|
||
return newCompileClasspathOf(project) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as a side note (and, I guess, as acknowledgement that it's a conscious decision for anyone looking at it): names with old
and new
get repetitive quick, it's easy to fall into "old
vs old old
" / "really old
vs old
", but I couldn't think of a better alternative to suggest, and hopefully we'll get rid of this code altogether by Kotlin 2.0, so it will definitely do for now 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I agree, first idea at my side for naming was like pre19*
and post19*
or just use pre19
for old function and no prefix for new, but it also started to look a bit odd for me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, I had the same idea and also found it weird looking :)
The integration tests failed a few times due to TeamCity agents not having enough space, and just due to some test being flaky, but I restarted it and everything passed in the end, so it looks like everything is alright Congrats on the first contribution, off to a great start! :) |
attempt to fix #3068 which is blocking building documentation for https://github.com/whyoleg/cryptography-kotlin/tree/dev (
dev
branch, KGP 1.9.0)for recent changes consult: #3081 (comment)