Skip to content

Support .srcjar files as source roots #3649

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

Closed
wants to merge 2 commits into from

Conversation

gharrma
Copy link
Contributor

@gharrma gharrma commented Aug 13, 2020

@udalov @ausatiy let me know what you think. Thanks!

@ivakub ivakub added the Backend label Aug 14, 2020
@udalov udalov added Compiler and removed Backend labels Aug 14, 2020
@udalov udalov self-assigned this Aug 14, 2020
gharrma added a commit to gharrma/kotlin that referenced this pull request Aug 21, 2020
...so that .srcjar support can be cherry picked from
JetBrains#3649 instead.
gharrma added a commit to gharrma/kotlin that referenced this pull request Aug 21, 2020
@udalov
Copy link
Member

udalov commented Aug 24, 2020

Could you please explain what would be the alternative (and its costs) to having this support built into the Kotlin compiler? So that we would get a clear picture why we are adding and will be supporting this.

@gharrma
Copy link
Contributor Author

gharrma commented Aug 24, 2020

Yes, good point.

I think there are two alternatives:

  1. We can patch the Kotlin compiler ourselves to include this change.

  2. We can unzip .srcjar files to disk before passing them off to the Kotlin compiler, and then delete the unzipped files when finished. This should work fine, it's just somewhat awkward and requires extra disk I/O.

Right now we are using option 1 for Android Lint, since Lint already bundles a custom build of the Kotlin compiler. So the cost is not too high.

As for other teams at Google using Kotlin with Bazel, I'm not sure how they currently deal with .srcjar files. I will reach out to them and see if they want to comment.

@udalov
Copy link
Member

udalov commented Aug 25, 2020

Thanks! Yes, it'll be very helpful to hear from other teams using Bazel.

Also how does it work for other compilers? E.g. javac probably doesn't support .srcjar files, and so I'd imagine there's some kind of a workaround already which might be reused as is for Kotlin.

@udalov
Copy link
Member

udalov commented Mar 4, 2021

Closing since there's been no movement on this. Feel free to reopen if it's still relevant. At this point though, I'm leaning more to avoid having this supported in the compiler, and implement this in build tools only, since similar support is likely required for other JVM languages.

@udalov udalov closed this Mar 4, 2021
@gharrma
Copy link
Contributor Author

gharrma commented Apr 11, 2021

Thanks for discussing; I agree this can stay closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants