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

Instructions for compiling / contributing? #8

Closed
jdb8 opened this issue Jan 12, 2018 · 2 comments
Closed

Instructions for compiling / contributing? #8

jdb8 opened this issue Jan 12, 2018 · 2 comments

Comments

@jdb8
Copy link

jdb8 commented Jan 12, 2018

I've been trying to debug an issue with mirror, and am having trouble working out what's going on.

I tried cloning the repo and building a local copy of the project so as to insert some print statements etc. but wasn't able to get it working. I tried:

$ gradle shadowJar

> Task :generateProto UP-TO-DATE
Using TaskInputs.file() with something that doesn't resolve to a File object has been deprecated and is scheduled to be removed in Gradle 5.0. Use TaskInputs.files() instead.


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> invalid flag: --release

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 0s
4 actionable tasks: 1 executed, 3 up-to-date
$ gradle -version                                                                                                              

------------------------------------------------------------
Gradle 4.4.1
------------------------------------------------------------

Build time:   2017-12-20 15:45:23 UTC
Revision:     10ed9dc355dc39f6307cc98fbd8cea314bdd381c

Groovy:       2.4.12
Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM:          1.8.0_25 (Oracle Corporation 25.25-b02)
OS:           Mac OS X 10.12.6 x86_64

I tried removing/changing the line in build.gradle referencing --release, but it then produced binaries with zsh: exec format error: ./build/libs/mirror-all.jar.

If you have any guidance on how best to build a local copy for debugging purposes, I'd be happy to help contribute and try to fix bugs where I find them. Having trouble since I'm a little rusty with java build systems D:

@stephenh
Copy link
Owner

Ah shoot, sorry about that --release flag; I added it because I'm trying the new Java 1.9 release, and didn't realize that gradle should only apply that to the newer/1.9 releases. Just removing it for now is good, I'll remove it.

To avoid the format error, if you run ./mirror in the main directory, it should have an if statement in there that automatically picks up the build/libs/mirror-all.jar.

(If that doesn't work, what it's basically doing is calling java -jar build/libs/mirror-all.jar instead of directly invoking the jar, which is a JVM-ish, that it does not produce native executables).

Good call on adding a section on contributing/compiling; I'll fix the --release issue and add a note to the readme.

stephenh added a commit that referenced this issue Jan 12, 2018
When building on JDK 1.8, it will cause build errors per bug #8.
@stephenh
Copy link
Owner

Thanks for the issue; I'll take a look at the others as well, but let me know if you run into any more build/compiling issues.

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

No branches or pull requests

2 participants