Skip to content
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

cheister
Copy link
Contributor

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 April 24, 2018 23:31
@stuhood stuhood requested a review from baroquebobcat April 25, 2018 00:10
Copy link
Member

@stuhood stuhood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Chris.

logger = logging.getLogger(__name__)


class JvmCompileSubsystem(Subsystem):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@stuhood
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
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.

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

Successfully merging this pull request may close these issues.

2 participants