Bug 257230 - deskutils/ganttproject: Fails to run with openjdk8, openjdk11 or openjdk16
Summary: deskutils/ganttproject: Fails to run with openjdk8, openjdk11 or openjdk16
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-17 10:45 UTC by Graham Perrin
Modified: 2023-10-26 16:35 UTC (History)
2 users (show)

See Also:
freebsd: maintainer-feedback+
koobs: merge-quarterly?


Attachments
Updated port diff (4.05 KB, patch)
2021-07-20 15:09 UTC, Chris Moerz
freebsd: maintainer-approval+
Details | Diff
Updated (4.05 KB, patch)
2021-07-29 17:33 UTC, Chris Moerz
no flags Details | Diff
Updated port diff (4.05 KB, patch)
2021-07-31 07:48 UTC, Chris Moerz
freebsd: maintainer-approval+
Details | Diff
Poudriere Log for FreeBSD 12.2 (37.34 KB, text/plain)
2021-07-31 07:48 UTC, Chris Moerz
no flags Details
Poudriere Log for FreeBSD 13.0 (37.36 KB, text/plain)
2021-07-31 07:50 UTC, Chris Moerz
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Graham Perrin freebsd_committer freebsd_triage 2021-07-17 10:45:08 UTC
After not succesfully running with openjdk11-11.0.11+9.1 I installed openjdk16-16.0.1+9.1

Below: is the JAVA_HOME environment variable ignored, or am I mistaken?

----

% echo $JAVA_HOME
/usr/local/openjdk16/bin/java
% /usr/local/bin/ganttproject
/usr/local/bin/ganttproject: [[: not found
/usr/local/bin/ganttproject: [[: not found
/usr/local/bin/ganttproject: [[: not found
/usr/local/bin/ganttproject: [[: not found
/usr/local/bin/ganttproject: [[: not found
/usr/local/bin/ganttproject: [[: not found

Searching for Java in /usr/local/share/ganttproject/runtime/bin/java
...missing or not executable
Searching for Java in /usr/local/openjdk16/bin/java/bin/java
...missing or not executable
Searching for Java in /usr/local/bin/java
...found openjdk version \"1.8.0_292\"
...this seems to be an old Java Runtime
JavaVM executable not found. You may want to set the path to the root of your Java Runtime installation in JAVA_HOME environment variable or pass it to ganttproject in --java-home argument
% pkg info -x openjdk
openjdk11-11.0.11+9.1
openjdk11-jre-11.0.11+9.1
openjdk16-16.0.1+9.1
openjdk8-8.292.10.1
%
Comment 1 Chris Moerz 2021-07-20 10:46:27 UTC
I'm afraid, you're right. That's a bug. I'll look into it and will do my best to post a patch by tonight.
Comment 2 Chris Moerz 2021-07-20 15:09:42 UTC
Created attachment 226571 [details]
Updated port diff
Comment 3 Chris Moerz 2021-07-20 15:10:09 UTC
I owe an apology to all users of this port... I must have posted an outdated diff, which did not include updates to the ganttproject shell script that starts the application.

I've now
* updated Makefile with PORTREVISION=1
* included patch for port, which also includes $PREFIX/bin/ganttproject patch, which makes the file way more bourne shell compatible.

Java can now be picked up via JAVA_HOME variable or "-j" parameter.

Portlint and portclippy both ok on updated Makefile.
Test on 12.2p6 and 12.2p9 were both ok.

This will fix the breaking issue at hand. I'm planning to improve the binary further to allow for a help output in the shell script and an optional man page, but would rather put that in a separate patch, if that's ok.
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2021-07-21 01:21:45 UTC
^Triage: Please set the maintainer-approval attachment flag (to +) on patches for ports you maintain to signify approval

Attachment -> Details -> maintainer-approval [+]
Comment 5 Chris Moerz 2021-07-21 12:01:48 UTC
Comment on attachment 226571 [details]
Updated port diff

added/updated maintainer approval. apologies for not setting this previously.
Comment 6 Kubilay Kocak freebsd_committer freebsd_triage 2021-07-21 12:31:29 UTC
(In reply to Chris Moerz from comment #5)

No need for apologies, the more we mention it the more people see and learn :)
Comment 7 Chris Moerz 2021-07-29 06:56:09 UTC
Just to be on the safe side: is there anything else I need to do? Otherwise I'll await any feedback and assume it'll get merged into ports eventually?
Thanks
Comment 8 Kubilay Kocak freebsd_committer freebsd_triage 2021-07-29 07:07:04 UTC
(In reply to Chris Moerz from comment #7)

I didn't review the patch earlier, but I can see hard coded LOCALBASE (/usr/local) and java versions that will need to be made variable:

  "/usr/local/openjfx14/lib"

Other than that, nothing specific is waiting or needed.

Having said that.. You mentioned 'Test on 12.2p6 and 12.2p9 were both ok'. 

If you can explicitly test with poudriere, that might prove handy (confidence) for committers looking at issues to close, and may indeed pick up additional issues.

I would test with a custom PREFIX (to see the failure when its not /usr/local), and probably with multiple java versions

If you need help with that: #freebsd-ports or #poudriere on Libera Chat IRC and we'd be happy to assist.
Comment 9 Chris Moerz 2021-07-29 17:32:23 UTC
Good catch on the /usr/local. Thanks. I'll save ourselves some future trouble by cleaning up my work procedure. I partially fixed that in the Makefile but didn't put the prefix in the patch...

I'm now building on poudriere; it says 255 packages. That'll take a while. Will post the result once it's done.
Comment 10 Chris Moerz 2021-07-29 17:33:26 UTC
Created attachment 226782 [details]
Updated

Will post approval once poudriere is through.
Comment 11 Chris Moerz 2021-07-31 07:48:07 UTC
Created attachment 226817 [details]
Updated port diff

Poudriere saved me from another blunder... somehow the PREFIX patch was not in the last file.
Comment 12 Chris Moerz 2021-07-31 07:48:49 UTC
Created attachment 226818 [details]
Poudriere Log for FreeBSD 12.2
Comment 13 Chris Moerz 2021-07-31 07:50:51 UTC
Created attachment 226819 [details]
Poudriere Log for FreeBSD 13.0

Please be advised, that the poudriere logs say PORTREVISION=2; that's because I had to increment due to another fix. 

I still set revision 1 on the patch file, because I assume I'm not supposed to jump revisions when it comes to merging with ports? If leaving out revisions is fine, please let me know and I'm happy to either provide a revision 2 file or keep the jumps in the future.
Comment 14 Chris Moerz 2021-07-31 07:55:57 UTC
Further feedback welcome, of course. I'm setting maintainer-feedback to (+) for the post; I assume this should confirm that I'm ok with the result so far.
Comment 15 Kubilay Kocak freebsd_committer freebsd_triage 2021-07-31 07:59:19 UTC
(In reply to Chris Moerz from comment #14)

PORTREVISION just needs to be incremented if/when 'the resulting package changes'. 

An increment per change is not needed, just an increment on the current port 

In this case given there wasnt a build failure, and the issue is at run time, the PORTREVISION bump is needed (wouldn't have been if all package builds had been failing).

PORTREVISION=1 per the patch is fine (if PORTREVISION doesn't currently exist)
Comment 16 Rene Ladan freebsd_committer freebsd_triage 2022-05-21 11:16:26 UTC
Note that openjdk16 expired today.
Comment 17 Chris Moerz 2023-10-26 16:35:38 UTC
Terribly sorry for dropping the ball on this. Just realized I had not completed this. I'm prepping an update to 3.2.3240 right now, that will fix this. It already works on my machine and I am waiting for poudriere to complete its run.

If everyone is ok with moving to the next version, I suggest we close this once the updated version is committed.