Compile Java with Zinc

Review Request #2156 - Created May 4, 2015 and submitted

Information
Fedor Korotkov
pants
ecba57b...
Reviewers
pants-reviews
benjyw, jsirois, nhoward_tw, stuhood, zundel

Added --compile-zinc-java-enabled to enable compilation of java targets with zinc.

Eventually we want to refactor everything around to choose a java compiler globally and hopefully retire jmake. For now as a proof of the concept added just a flag to enable it so everyone can test before futher changes.

ci.sh passes: https://travis-ci.org/fkorotkov/pants/builds/61095655

Issues

  • 0
  • 2
  • 0
  • 2
Description From Last Updated
Stu Hood
Fedor Korotkov
Fedor Korotkov
Fedor Korotkov
Fedor Korotkov
Benjy Weinberger
Patrick Lawson
Eric Ayers
Fedor Korotkov
Stu Hood
Fedor Korotkov
Fedor Korotkov
Review request changed

Status: Closed (submitted)

Eric Ayers

Just to follow up on this, I just switched Square over to using zinc to compile our java code.

  1. Wow! Wonderful news! We found one regression in java compilation today: output from zinc compiler for java has the same log level.

    The issue is in SBT for java compilation. javac don't write messages with different log levels to different places. It dumps it to a single PrintWriter and SBT just checks exit code to determine a log level for all messages from javac. See this line in SBT sources: https://github.com/sbt/sbt/blob/0.13.8/compile/src/main/scala/sbt/compiler/JavaCompiler.scala#L134

    Still figuring out how to fix it.

  2. I just got a report from a user that error messages come out so that every line of output in the compilation unit is marked with:

    [err]  
    

    we are still using the global compile strategy so it marks a lot of warning messages with the incorrect label.

  3. Do you want me to create am email thread on pants-devel?

    I wrote an integration test to reproduce the issue in tests. But still not sure how to fix it.

Loading...