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

Add Javac compile option as an alternative to Zinc #5743

Merged
merged 1 commit into from May 8, 2018

Conversation

Projects
None yet
2 participants
@cheister
Copy link
Contributor

cheister commented Apr 24, 2018

Problem

Zinc doesn't run on Java 9 or Java 10.

Solution

Provide the option to use Javac for java compilation instead of Zinc.

Result

This is first pass which is meant for discussion. I haven't updated tests or documentation, mainly just want to get feedback on what is there, and if the general pattern of using the subsystem is how we want to go.

It should be noted that there is no code analysis with Javac so any tasks that use analysis won't work.

To test it on the branch you need to add

[compiler]
compiler: javac

to pants.ini

@cheister cheister requested a review from stuhood Apr 24, 2018

@stuhood stuhood requested a review from baroquebobcat Apr 25, 2018

@cheister cheister force-pushed the cheister:javac-compile branch from ae82d7d to 2a4317c Apr 25, 2018

@cheister cheister force-pushed the cheister:javac-compile branch from 2a4317c to fadf5d8 May 1, 2018

@stuhood

stuhood approved these changes May 7, 2018

Copy link
Member

stuhood left a comment

Thanks Chris.

logger = logging.getLogger(__name__)


class JvmCompileSubsystem(Subsystem):

This comment has been minimized.

@stuhood

stuhood May 7, 2018

Member

It seems like this option could probably go on src/python/pants/backend/jvm/subsystems/jvm_platform.py instead as --jvm-platform-compiler?

@@ -101,6 +102,31 @@ python_library(
sources = ['anonymizer.py'],
)

python_library(
name = 'javac',
sources = globs('javac/*.py'),

This comment has been minimized.

@stuhood

stuhood May 7, 2018

Member

The convention in this file of defining targets outside of their directory is unfortunate... would recommend defining this target in that directory instead.

@stuhood

This comment has been minimized.

Copy link
Member

stuhood commented May 7, 2018

Oh... one or two integration tests (or a decorator that allows marking a test as run with both zinc and javac) would be good.

@stuhood

This comment has been minimized.

Copy link
Member

stuhood commented May 8, 2018

Chris and I discussed landing this now in order to ensure that #4729 doesn't break anything, and then making the remaining fixes later in the week.

@stuhood stuhood merged commit 5c83439 into pantsbuild:master May 8, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@cheister cheister deleted the cheister:javac-compile branch May 8, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment