typetools / typetools/checker-framework

Handle -bootclasspath argument

Open
#1,010 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Android
Dominant language
Java
Stars
1.1k
Forks
440
Avg merge
1d 12h
Merged PRs (30d)
134

Description

I am trying to get the Checker framework working in the context of a small Android project built with Buck. For Android projects, Buck uses the -bootclasspath argument when invoking javac, with an argument list like:

javac -source 7 -target 7 -g -bootclasspath /Users/msridhar/Library/Android/sdk/platforms/android-24/android.jar:/Users/msridhar/Library/Android/sdk/platforms/android-24/optional/org.apache.http.legacy.jar -d /Users/msridhar/my-first-buck-project/buck-out/bin/java/com/example/activity/lib__activity__classes -classpath '' @buck-out/gen/java/com/example/activity/__activity__srcs

It looks like the CheckerMain javac wrapper doesn't handle -bootclasspath correctly. This regular expression won't match the -bootclasspath argument, so I think the argument will still get passed to the underlying javac library. This leads to a warning that the annotated JDK is not being used. (I'm not sure how exactly javac handles seeing both -bootclasspath and -Xbootclasspath/p: arguments.)

Other related arguments that are not handled are -Xbootclasspath/a: and -Xbootclasspath/: (as far as I can see), as mentioned here. Properly handling combinations of these arguments may be a bit tricky; it's unclear how javac handles it from the documentation.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in framework/src/org/checkerframework/framework/util/CheckerMain.java around the regular expression at line 262, then compare it with the javac invocation and bootclasspath options described in the issue. Check how -bootclasspath, -Xbootclasspath/a:, and -Xbootclasspath/: are handled, including combinations, and verify that the annotated JDK warning is resolved without breaking other javac arguments.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
compilers, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.