Skip to content

Don't pass -J<flag> to local java, improve javac's error parsing#2272

Merged
eed3si9n merged 5 commits intosbt:0.13from
Duhemm:fix-1968
Nov 27, 2015
Merged

Don't pass -J<flag> to local java, improve javac's error parsing#2272
eed3si9n merged 5 commits intosbt:0.13from
Duhemm:fix-1968

Conversation

@Duhemm
Copy link
Contributor

@Duhemm Duhemm commented Nov 11, 2015

This PR provides a fix for #1968 by not passing -J<flag> options to the local Java compiler and emitting a warning.

It also fixes #2256. Error messages were not displayed because they were not correctly parsed by JavaErrorParser.

These options can only be given to a forked Java compiler. If we run a
local java compiler, we filter these options out and emit a warning.

Fixes sbt#1968
Upon startup, javac may report errors because (for instance) because it
received incorrect flags. These errors were not correctly parsed by the
JavaErrorParser and were never reported to the user.

This commit fixes this problem by adding a new parsing rule in
JavaErrorParser: errors that start with the prefix "javac:" are now
correctly parsed and reported to the user.

Fixes sbt#2256
@typesafe-tools
Copy link

Can one of the admins verify this patch?

@dwijnand
Copy link
Member

LGTM (for what I can see, not what I know :D)

@eed3si9n
Copy link
Member

LGTM pending Travis
Plz open PR to incrementalcompiler

eed3si9n added a commit that referenced this pull request Nov 27, 2015
Don't pass `-J<flag>` to local java, improve javac's error parsing
@eed3si9n eed3si9n merged commit c5b7fc1 into sbt:0.13 Nov 27, 2015
eed3si9n added a commit to sbt/zinc that referenced this pull request Dec 7, 2015
@eed3si9n eed3si9n mentioned this pull request Jan 7, 2016
7 tasks
@Duhemm Duhemm deleted the fix-1968 branch February 8, 2016 08:29
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.

4 participants