-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
scala plugin joint compilation succeed without producing bytecode files #13984
Comments
@SheliakLyr Do you know if the incremental compiler in Zinc has mechanism to detect that the output was messed up? And do a full recompile in that case? |
I think that Zinc supports this fully: it will compile incrementally only missing files. That's how my sample sbt project works, and the code responsible for this is in zinc. See doc for
I guess That method is used in The difference between sbt & gradle is that sbt provides an implementation of the The solution: provide an implementation of the |
My last comment is no longer relevant. Newer sbt/zinc work differently. I suspect that upgrade to zinc 1.4.4 will solve this and #15961 (possible duplicate). Upgrade to newer zinc is blocked by #15491, but I made necessary changes locally and with zinc 1.4.4 missing classes are correctly restored. Further tests are needed to verify this works correctly. |
@SheliakLyr Are you planning to submit the local changes you have made as a PR? |
No, I have only tested it to check what causes the issue. My changes (very rough) are here: https://github.com/SheliakLyr/gradle/tree/newZinc_1.4.4. If no one from gradle is going to tackle those 3 related issues, I could work on a proper PR - just let me know. I have seen some initial work by @big-guy in #15961, which made me think this topic is already being worked upon. |
Let's see what @big-guy says, but I assume they would appreciate contributions. |
@SheliakLyr A contribution to fix this and the related issues would be very welcome. The Gradle team currently has very limited capacity for this unfortunately. |
Ok, I would like to inquire about one topic: compatibility with zinc. Is it possible to drop support for zinc <= 1.5.0 in gradle 7.x? Or should I build some reflection-based layer of compatibility between gradle and zinc in order to keep the support for older versions? Arguments for using only zinc 1.5.0:
Arguments for keeping support for older zincs:
BTW, I asked about 1.5.0 because zinc 1.4.x seems kind of broken. zinc_2.12:1.4.4 has indirect dependency on scala 2.13 :( IMHO: I would drop support for older zincs and limit the ability to change zinc version (only bugfixes, ex. 1.5.0 -> 1.5.1). |
I think it makes the most sense to go with the latest zinc version and support it well versus supporting multiple versions poorly. |
Thanks for the answer and the proposal. I now wish we had that conversation two weeks ago, selecting Zinc 1.5 for Gradle 7.0 would have been an easy choice. |
@SheliakLyr Sorry for taking so long to get back to you. |
No need to apologize, especially when you are a community contributor 😉 Given your feedback, I am closing this issue and marking it fixed in Gradle 7.2. And contributions on other issues, Scala related or not, will be appreciated. |
Expected Behavior
Having a scala project and using joint compilation. After deleting a class file (bytecode) in build/, when re-running the compilation, the task succeed but the class file is not generated.
Steps to Reproduce
I wrote a sample project : https://github.com/apflieger/gradle-incremental-build
Even with multiple run of
./gradlew classes
, the class isn't outputted. The task is considered up-to-date.Environment
./gradlew -version
Gradle 6.6-rc-3
Build time: 2020-07-24 14:04:09 UTC
Revision: 13b5dcc
Kotlin: 1.3.72
Groovy: 2.5.12
Ant: Apache Ant(TM) version 1.10.8 compiled on May 10 2020
JVM: 14.0.1 (Oracle Corporation 14.0.1+7)
OS: Mac OS X 10.15.6 x86_64
java -version
openjdk version "14.0.1" 2020-04-14
OpenJDK Runtime Environment (build 14.0.1+7)
OpenJDK 64-Bit Server VM (build 14.0.1+7, mixed mode, sharing)
The text was updated successfully, but these errors were encountered: