-
-
Notifications
You must be signed in to change notification settings - Fork 33
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 JDK8 support #19
base: master
Are you sure you want to change the base?
Add JDK8 support #19
Conversation
@bbigras I was able to run it on your project with these changes mvn2nix --repositories https://jaspersoft.jfrog.io/jaspersoft/jr-ce-releases \
--repositories https://repo.maven.apache.org/maven2 \
--repositories http://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts dependencies.nix
|
If your build builds only with **Java8** (the deafult is Java11); you can execute the alternative | ||
*mvn2nix* attribute. | ||
|
||
```bash | ||
$ nix run -f https://github.com/fzakaria/mvn2nix/archive/master.tar.gz mvn2nix-jdk8 --command mvn2nix | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bbigras You will have to run the JDK8 command here.
Maven only sets JAVA_HOME if its not set. I suspect that GitHub actions are setting JAVA_HOME; so it's not getting the JDK11 version and failing to build.
@@ -0,0 +1 @@ | |||
use nix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just added direnv; unrelated to the fix.
@@ -14,6 +14,6 @@ jobs: | |||
with: | |||
name: fzakaria | |||
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}' | |||
- run: nix-build | |||
- run: nix-build -A mvn2nix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sure we build the JDK11 version
@@ -28,7 +28,7 @@ in mkDerivation rec { | |||
mkdir -p $out/bin | |||
|
|||
# create a symbolic link for the lib directory | |||
ln -s ${mavenRepository}/.m2 $out/lib | |||
ln -s ${mavenRepository} $out/lib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed this was a bug;
I'll running this to the github actions afterwards.
name = "mvn2nix-shell"; | ||
buildInputs = with pkgs; [ jdk11_headless maven gh-md-toc]; | ||
buildInputs = with pkgs; [ jdk11_headless maven gh-md-toc ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nixfmt formatting
@bbigras if you want to confirm; i can then merge it in. |
Sorry I have been trying but I must be doing something wrong.
|
I could paste more of the log. |
You might have to; I just ran the command you linked and it completed locally. nix run -f https://github.com/fzakaria/mvn2nix/archive/41cc1c464350af2afb9db151b6642de7b7f96540.tar.gz \
mvn2nix-jdk8 --command mvn2nix --repositories https://jaspersoft.jfrog.io/jaspersoft/jr-ce-releases \
--repositories https://repo.maven.apache.org/maven2 \
--repositories http://jaspersoft.jfrog.io/jaspersoft/third-party-ce-artifacts |
|
@bbigras Here is mine: ❯ ls -l /tmp/mvn2nix3157314594534710738/net/sf/launch4j/launch4j/3.12/launch4j-3.12-workdir-linux64/bin/windres
.rwxr-xr-x 1.1M fmzakari 23 May 2018 /tmp/mvn2nix3157314594534710738/net/sf/launch4j/launch4j/3.12/launch4j-3.12-workdir-linux64/bin/windres I was able to run it even. /tmp/mvn2nix3157314594534710738/net/sf/launch4j/launch4j/3.12/launch4j-3.12-workdir-linux64/bin/windres --help | head
Usage: /tmp/mvn2nix3157314594534710738/net/sf/launch4j/launch4j/3.12/launch4j-3.12-workdir-linux64/bin/windres [option(s)] [input-file] [output-file]
The options are:
-i --input=<file> Name input file |
I tried again:
|
Interesting @bbigras. I take it your on NixOS ? $ nix-locate libz.so.1
...
zlib.out 0 s /nix/store/p1vgrfa31k73256nbrqsqcnvb9ij84lh-zlib-1.2.11/lib/libz.so.1 This project (jasperstarter) is a pretty complicated one; using dynamic libraries for Java.
Sorry I don't have a really great answer at the moment; otherwise. |
Here is my attempt locally to demonstrate what I mean
|
Yes
|
@bbigras can you run winres itself with the LD_LIBRARY_PATH set ( |
|
hmm we have departed a little from mvn2nix and just debugging this binary lol My next guess would be to strace to see why its failing. |
Since it's out of scope of mvn2nix and that I'm not a big fan of open source software using Discord, I'll just stop here. Thank you very much for your time and help. |
@bbigras fair enough. |
@bbigras opened an issue trying to run mvn2nix on jasperstarter.
The jasperstarter project actually demonstrated a few key defecits in mvn2nix that this pull-request resolves.
The project requires the awt libraries (user interfaces); which are not included with the headless distribution that I was bundling. Change all the JDK to the full installation by default.
The Maven project could not be built using JDK11 which was the default JRE version that mvn2nix uses to execute Maven. Introduce separate mvn2nix derivations that use jdk8 or jdk11
Fixes #18
CC
@roberth
@DerGuteMoritz