Skip to content

Formalize the internal IDEA dependencies for binary compatibility #3746

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

Merged
merged 4 commits into from
Jun 28, 2023

Conversation

dkhalanskyjb
Copy link
Collaborator

No description provided.

@dkhalanskyjb dkhalanskyjb changed the base branch from master to develop May 9, 2023 12:54
@dkhalanskyjb dkhalanskyjb requested a review from qwwdfsad May 9, 2023 14:21
@qwwdfsad
Copy link
Member

qwwdfsad commented Jun 1, 2023

Friendly reminder

@dkhalanskyjb dkhalanskyjb force-pushed the dk-DebugProbes-bincompat branch from 7f4d83f to dc64c80 Compare June 2, 2023 09:26
@dkhalanskyjb
Copy link
Collaborator Author

dkhalanskyjb commented Jun 2, 2023

Ah, ok. I misinterpreted the flow of the conversation. After the question about IDEA's side, I thought the review would go, "Well, here's the code where this is used; please go ahead, check it, and update the list of the used method to the actual one since you're at it already."

@qwwdfsad
Copy link
Member

qwwdfsad commented Jun 2, 2023

@dkhalanskyjb
Copy link
Collaborator Author

Thanks for the list!
I updated the PR in accordance. Here are the things that I couldn't get to work:

These aren't fields, they have getters.

kotlinx.coroutines.debug.internal.DebugCoroutineInfo
	field context
	field sequenceNumber
	field lastObservedFrame
	field lastObservedThread
kotlinx.coroutines.CancellableContinuationImpl
	field delegate
	field context

I don't know how these names are generated and how to make the compatibility validator know about them:

kotlinx.coroutines.debug.internal.DebugProbesImpl
	method isInstalled$kotlinx_coroutines_debug()
	method isInstalled$kotlinx_coroutines_core()

There are no such fields. Maybe they are hidden somewhere up the inheritance chain.

kotlinx.coroutines.StandaloneCoroutine
	field _state
	field context

I think this is from DispatchedCoroutine. This is an atomic field, so the validator says get_decision$FU. I suppose this is from atomicfu, but I don't understand whether this is expected.

kotlinx.coroutines.CancellableContinuationImpl
	field _decision

Simply doesn't show up in the .api file for some reason:

kotlinx.coroutines.DispatchedContinuation
	field continuation

Not in the library at all:

kotlin.coroutines.CombinedContext
	method get()
kotlin.coroutines.jvm.internal.DebugMetadataKt
	method getStackTraceElement()
	method getSpilledVariableFieldMapping()

Also, pardon my French, but bloody hell!

@qwwdfsad
Copy link
Member

qwwdfsad commented Jun 2, 2023

Thanks!

These aren't fields, they have getters.

Right, but unfortunately, the underlying private fields are used instead.

I don't know how these names are generated

internal names that are not classes/interfaces are mangled, so it's impossible to call them from Java ($ is not a valid identifier in Java). The default mangling strategy for internal modifier is name + $ + module name

how to make the compatibility validator know about them

No way, neither there should be, because they are internal.

Maybe they are hidden somewhere up the inheritance chain.

One is JobSupport._state, the other one is the underlying field for the getter. Hint: CTRL+F12 pressed twice enables "Inherited members" overview in IDEA.

Simply doesn't show up in the .api file for some reason:

Explicitly excluded here: https://github.com/Kotlin/kotlinx.coroutines/blob/master/build.gradle#L136

Also, pardon my French, but bloody hell!

This all is a very educational story about project management and responsibilities in general, but this margin is too narrow to contain it :)

@qwwdfsad qwwdfsad self-requested a review June 2, 2023 16:31
@qwwdfsad qwwdfsad self-requested a review June 22, 2023 08:27
Copy link
Member

@qwwdfsad qwwdfsad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, good job figuring it out and consolidating;

Feel free to merge, not doing so myself in case you have any questions/additions

@dkhalanskyjb dkhalanskyjb merged commit 5664713 into develop Jun 28, 2023
@dkhalanskyjb dkhalanskyjb deleted the dk-DebugProbes-bincompat branch June 28, 2023 07:55
dkhalanskyjb added a commit that referenced this pull request Jul 24, 2023
The PR #3746 introduced a bug due to which the IDEA coroutine
debugger didn't run. See
https://youtrack.jetbrains.com/issue/KTIJ-26327
dkhalanskyjb added a commit that referenced this pull request Jul 25, 2023
The PR #3746 introduced a bug due to which the IDEA coroutine
debugger didn't run. See
https://youtrack.jetbrains.com/issue/KTIJ-26327
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants