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

Cannot generate javac.jar, checker-source.jar, checker-javadoc.jar when using ./gradlew assemble #3565

Closed
HuM4NoiD opened this issue Aug 6, 2020 · 11 comments

Comments

@HuM4NoiD
Copy link
Contributor

HuM4NoiD commented Aug 6, 2020

Cannot generate the above mentioned jars when using ./gradlew assemble

Expected: build passes for ./gradlew assemble and generates:

- checker.jar
- checker-qual.jar
- checker-javadoc.jar
- checker-source.jar
- javac.jar

Actual outcome: build is successful, but with only the following files in $CHECKERFRAMEWORK/checker/dist:

- checker.jar
- checker-qual.jar

$CHECKERFRAMEWORK/build/resources/main/git.properties:

git.branch=master
git.build.host=mistry
git.build.user.email=
git.build.user.name=
git.build.version=3.6.1-SNAPSHOT
git.closest.tag.commit.count=4277
git.closest.tag.name=after-reformatting
git.commit.id=6376640fd19d967941862439df8d0ea2c90a2ea5
git.commit.id.abbrev=6376640
git.commit.id.describe=after-reformatting-4277-g6376640
git.commit.message.full=Add comment to GenericAnnotatedTypeFactory\#getAnnotatedTypeVarargsArray. (\#3560)\n\n
git.commit.message.short=Add comment to GenericAnnotatedTypeFactory\#getAnnotatedTypeVarargsArray. (\#3560)
git.commit.time=2020-08-06T01\:05\:48+0530
git.commit.user.email=smillst@cs.washington.edu
git.commit.user.name=Suzanne Millstein
git.dirty=false
git.remote.origin.url=https\://github.com/typetools/checker-framework.git
git.tags=
git.total.commit.count=15691

Have tried this on two systems, Fedora Linux 32 x86_64 and Windows Subsystem for Linux (Ubuntu 20.04), on this repository as well as a synced fork on my account

I have added the debug log for ./gradlew assemble --debug after a ./gradlew clean :
assemble-log.log

@mernst
Copy link
Member

mernst commented Aug 6, 2020

I'm sorry you are having trouble. Thanks for stating your expectation, which is helpful. Can you explain why you expect ./gradlew assemble to generate those jar files?

There are gradle tasks allSourcesJar for creating allJavadocJar for generating checker-source.jar and checker-javadoc.jar. javac.jar is obsolete. Why do you need these files?

@HuM4NoiD
Copy link
Contributor Author

HuM4NoiD commented Aug 7, 2020

running alias javacheck=$CHECKERFRAMEWORK/bin/javac gives a RuntimeException stating:

Exception in thread "main" java.lang.RuntimeException: The following files could not be located: /home/jugal/build/checker-framework/checker/dist/javac.jar
        at org.checkerframework.framework.util.CheckerMain.assertFilesExist(CheckerMain.java:692)
        at org.checkerframework.framework.util.CheckerMain.assertValidState(CheckerMain.java:140)
        at org.checkerframework.framework.util.CheckerMain.<init>(CheckerMain.java:134)
        at org.checkerframework.framework.util.CheckerMain.main(CheckerMain.java:54)

@mernst
Copy link
Member

mernst commented Aug 7, 2020

Running the command

alias javacheck=$CHECKERFRAMEWORK/bin/javac

cannot give a RuntimeException. Maybe running some command after that does give a RuntimeException, though. Can you please give a complete set of commands, starting with cloning the Checker Framework, that reproduces the problem you are having? It sounds like there is a problem, and if you can give full instructions we can fix it. Thanks!

@HuM4NoiD
Copy link
Contributor Author

HuM4NoiD commented Aug 7, 2020

I meant to say, when I run javacheck, with NullnessChecker, I get the above exception

@HuM4NoiD
Copy link
Contributor Author

HuM4NoiD commented Aug 7, 2020

steps:

  1. Clone checkerframework
  2. run ./gradlew assemble in the checker framework directory, (No other commands have been run) (Build is successful)
  3. run /path/to/checker-framework/checker/bin/javac -processor org.checkerframework.checker.nullness.NullnessChecker MyClass.java

@mernst
Copy link
Member

mernst commented Aug 7, 2020

Unfortunately, I cannot reproduce this problem.

Could you please submit a proper bug report, per the instructions? It should include exact commands (not English descriptions nor approximations, which you provided). It should include exact output (which you still have not provided, except a hard-to-read log with extreme debugging).

For example, here is how I tried to reproduce your problem. You should provide a script like this (or use this one). Also provide the output, and the other information that was requested.

mkdir -p ~/tmp
cd ~/tmp
rm -rf checker-framework jdk stubparser annotation-tools
git clone https://github.com/typetools/checker-framework/
cd checker-framework
./gradlew assemble
ls checker/dist/
./checker/bin/javac -processor nullness checker/tests/nullness/ArrayNew.java

@HuM4NoiD
Copy link
Contributor Author

HuM4NoiD commented Aug 8, 2020

I have followed the same commands that you have written, but as it cannot be reproduced, I may have a problem in my installation, which I'll have to see for myself.

@HuM4NoiD HuM4NoiD closed this as completed Aug 8, 2020
@mernst
Copy link
Member

mernst commented Aug 8, 2020

Your statement "it cannot be reproduced" is ambiguous. Do the commands work for you?

@HuM4NoiD
Copy link
Contributor Author

HuM4NoiD commented Aug 8, 2020

I have followed the exact same steps that you have written in here and I get the above RuntimeException when running javacheck -processor nullness Program.java i.e. I get the error but you cannot reproduce it. So I said that there is a problem with my installation which I will have to figure out

@mernst
Copy link
Member

mernst commented Aug 8, 2020

Thanks for clarifying. Let us know if you need help.

@HuM4NoiD
Copy link
Contributor Author

I was able to solve this problem.
If JAVA_HOME and Java command both point to Java version 8, javac.jar will be generated
If JAVA_HOME and Java command both point to Java version 11, javac.jar will not be generated as javac.jar is not required.
I mixed up both Java versions and environment variables. which led to this problem.

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

No branches or pull requests

2 participants