-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Declare byte-buddy as 'implementation' dependency instead of shading. #4266
Conversation
8eba785
to
2a0b02d
Compare
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 don't have comments to the overall idea of not using shading, but then, https://github.com/Kotlin/kotlinx.coroutines/tree/master/kotlinx-coroutines-debug#build-failures-due-to-duplicate-resource-files needs to be updated so that it no longer mentions the issues related to shading.
Updated the readme ✅ |
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.
Thanks for taking care of it!
Repackaging was instead an overcautious decision because byte-buddy was used everywhere, and it was totally unclear if they have a proper compatibility policy (they do!), and back then JPMS wasn't big of an issue.
@dkhalanskyjb waiting for your review as well here, as you already started viewing the mechanical aspect of the change |
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.
With this change, we are no longer shading anything, so could you please also remove all mentions of the shadow
plugin from our library?
@@ -170,9 +170,6 @@ conflicts, but: | |||
* `kotlinx-coroutines-debug` transitively depends on JNA and JNA-platform, both of which include license files in their | |||
META-INF directories. Trying to merge these files leads to conflicts, which means that any Android project that | |||
depends on JNA and JNA-platform will experience build failures. | |||
* Additionally, `kotlinx-coroutines-debug` embeds `byte-buddy-agent` and `byte-buddy`, along with their resource files. | |||
Then, if the project separately depends on `byte-buddy`, merging the resources of `kotlinx-coroutines-debug` with ones | |||
from `byte-buddy` and `byte-buddy-agent` will lead to conflicts as the resource files are duplicated. |
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.
With this change, the list above only has a single bullet point (so it's strange that it's still a list), and also, in addition to JNA and JNA-platform mentioned above, kotlinx-coroutines-debug
now depends on byte-buddy
and byte-buddy-agent
.
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.
At this point, I think one of two ways is more efficient than ping-ponging in this review.
Either we merge the contribution as is and you can quickly edit the readme to your liking in a new commit, or you might just want to edit the commit directly pre merge.
WDYT?
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.
There's also a third way, the one we usually take in this library: the contributor carefully looks at the places affected by the proposed change, considers the consequences, and then introduces sweeping, coordinated edits. In other words, instead of making a small isolated change, they consider the bigger picture. A reviewer's job then boils down to highlighting the affected areas the contributor hasn't thought of / didn't know about (without enumerating every specific line of code to change), after which the contributor goes back to researching what the proposed change entails and introduces further sweeping edits. No ping-ponging results, as the list of such areas to consider is typically limited.
Although the third way is preferred, both of the options you've proposed are okay: we're also glad and thankful to accept incomplete contributions if the contributor says: "I'm no longer interested in working on this, you do it." In this scenario, the credit still goes to the contributor.
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 pushed an update, please provide feedback
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.
Nice, thanks! I've also left a comment with my review, it's possible that you've missed it:
With this change, we are no longer shading anything, so could you please also remove all mentions of the shadow plugin from our library?
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.
Done ✅
Shading byte buddy might have negative effects: - It increases binary size by ~3MB w/o an easy option to opt-out - It causes JPMS issues (because of the re-location itself) The used APIs from the dependency can be considered stable.
ee48309
to
c10a35d
Compare
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.
Great job, thank you!
Shading byte buddy might have negative effects:
The used APIs from the dependency can be considered stable.