Bug 270158 - editors/openoffice-4 Error 65280 - build fails during l10ntools module
Summary: editors/openoffice-4 Error 65280 - build fails during l10ntools module
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Don Lewis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-12 14:56 UTC by Ken Gunderson
Modified: 2023-03-14 23:12 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (office)


Attachments
poudriere openoffice-4 failed build log (699 bytes, text/plain)
2023-03-12 14:56 UTC, Ken Gunderson
no flags Details
openoffice-4.1.14 fail log snippet (24.06 KB, text/plain)
2023-03-12 20:39 UTC, Ken Gunderson
no flags Details
testlucene.java (51 bytes, text/plain)
2023-03-14 01:16 UTC, Don Lewis
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ken Gunderson 2023-03-12 14:56:34 UTC
Created attachment 240794 [details]
poudriere openoffice-4 failed build log

Poudrier logs whinge thusly:
Comment 1 Don Lewis freebsd_committer freebsd_triage 2023-03-12 17:50:36 UTC
The actual error is someplace earlier in the log, possibly much earlier if this a parallel build.  Either search backwards from the end of the log file for "error:" to find the compiler error, or:

# poudriere testport -j JAILNAME -i -o editors/openoffice-4
[snip]
# bash
# cd /wrkdirs/usr/ports/editors/openoffice-4/work/aoo-4.1.14/main
# . FreeBSDAMDEnv.Set.sh
# cd l10ntools
# build --from l10ntools
Comment 2 Ken Gunderson 2023-03-12 19:03:24 UTC
I tried attaching the entire log from the OO build, followed by a smaller snippet, but Bugzilla rejected the post so I figured I'd keep it brief and provide more info as requested.  Would you please email me privately with an address which will accept as an attachment?  

Thanks for your timely attention to this. :)
Comment 3 Ken Gunderson 2023-03-12 20:39:40 UTC
Created attachment 240802 [details]
openoffice-4.1.14 fail log snippet

If at first you do not succeed... let's try posting just a snippet again.
Comment 4 Don Lewis freebsd_committer freebsd_triage 2023-03-13 07:21:59 UTC
I think the relevant details are lost here:

gu-IN he hi-IN hr hu it ja ka km kn ko ku lo lt lv mk
...skipping...
  adding: test/testtools/bridgetest/XBridgeTest.class (deflated 50%)
Comment 5 Ken Gunderson 2023-03-13 13:59:48 UTC
Compressed the entire log and sent to truckman.  Hope this helps.  Thx for delving into this.
Comment 6 Don Lewis freebsd_committer freebsd_triage 2023-03-13 18:13:12 UTC
HelpIndexerTool.java:35: error: package org.apache.lucene.analysis.cjk does not
exist
import org.apache.lucene.analysis.cjk.CJKAnalyzer;
                                     ^
HelpIndexerTool.java:187: error: cannot find symbol
            Analyzer analyzer = aLanguageStr.equals("ja") ? (Analyzer)new CJKAna
lyzer(Version.LUCENE_29) : (Analyzer)new StandardAnalyzer(Version.LUCENE_29);
                                                                          ^
  symbol:   class CJKAnalyzer
  location: class HelpIndexerTool



Looks like you are doing something to make it want to generate Japanese help.  For this it looks like it would need:
  https://lucene.apache.org/core/7_2_0/analyzers-common/org/apache/lucene/analysis/cjk/package-summary.html

I'm not really sure where things are going wrong, since our textproc/lucene port supplies this class:

tar tfz lucene-analyzers-3.6.2.jar | grep apache | grep lucene | grep cjk

org/apache/lucene/analysis/cjk/
org/apache/lucene/analysis/cjk/CJKAnalyzer$DefaultSetHolder.class
org/apache/lucene/analysis/cjk/CJKAnalyzer.class
org/apache/lucene/analysis/cjk/CJKBigramFilter.class
org/apache/lucene/analysis/cjk/CJKTokenizer.class
org/apache/lucene/analysis/cjk/CJKWidthFilter.class

BTW, our textproc/lucene port is way out of date.
Comment 7 Don Lewis freebsd_committer freebsd_triage 2023-03-13 19:15:51 UTC
I wonder if your lucene package is corrupt or truncated.

ls -l  /usr/local/share/java/classes/lucene-analyzers-3.6.2.jar
-rw-r--r--  1 root  wheel  1173785 Mar  6 17:46 /usr/local/share/java/classes/lucene-analyzers-3.6.2.jar

sha256 /usr/local/share/java/classes/lucene-analyzers-3.6.2.jar
SHA256 (/usr/local/share/java/classes/lucene-analyzers-3.6.2.jar) = 98eed83b72456b2b9f957419071597c5fa461fb5e5bbe027aa0ca9e5b8a62709
Comment 8 Ken Gunderson 2023-03-13 19:29:19 UTC
The sole lucene related package on my system is clucene-2.3.3.4_20

/usr/local/share/java/classes/ dir is empty.

Should I install textproc/lucene?  If so, which version from ports?

TIA-- o/
Comment 9 Don Lewis freebsd_committer freebsd_triage 2023-03-13 20:45:03 UTC
It's a build-only dependency, so it only gets installed in the poudriere jail for the openoffice build.  It's package gets built as a dependency, so it should be available locally.

The easiest way to take a peek at it is to temporarily install it on the host.

I'm not having much luck figuring out what language translations are built.  The l10ntools stuff is very convoluted.  I don't see why "ja" would be broken, though.
Comment 10 Ken Gunderson 2023-03-13 21:00:09 UTC
textproc/clucene is evidently installed as libreoffice dep.  I deleted it and tried rebuilding OO - Makefile specs textproc/lucene as build dep but the OO build does not even try to pull that in, for whatever reason.  An attempt to build solo textproc/lucene does not proceed - bails with no package built.

I am building  textproc/lucene5 presently.  I'll play around a bit and keep you posted.

As for Japanese, no clue there.  I do have some CJK fonts installed so Kangi and  such displays in browser and email but never configured any LC stuff to pull that into my env.
Comment 11 Don Lewis freebsd_committer freebsd_triage 2023-03-13 21:54:29 UTC
The build should be pulling textproc/lucene into the poudriere jail for the openoffice build.  If I run poudriere testport -i -o editors/openoffice4, I get a jail shell prompt at the conclusion of the build:

root@14CURRENTamd64-default:~ # pkg info | grep lucene
lucene-3.6.2                   Full-text search engine for Java


The standalone build of textproc/lucene won't do anything because you have already build the package as a build dependency.  You should be able to pkg install it.
Comment 12 Don Lewis freebsd_committer freebsd_triage 2023-03-13 22:09:31 UTC
You can't get the hash, but you can at least get the size of the .jar file I'm wondering about, from the .pkg file:

tvfz /var/poudriere/data/packages/14CURRENTamd64-default/All/lucene-3.6.2.pkg | grep 'analyze.*jar'
                                  ^^^^^^^^^^^^^^^^^^^^^^ adjust for your setup
-rw-r--r--  0 root   wheel 1173785 Mar  6 17:46 /usr/local/share/java/classes/lucene-analyzers-3.6.2.jar
Comment 13 Don Lewis freebsd_committer freebsd_triage 2023-03-13 22:49:58 UTC
It's really looking like you lucene package is corrupt.  The java class import does not depend on the language, it is unconditional.  The import fails in your build, but I do not see that error.

I'd suggest running
  poudriere bulk -C textproc/lucene
to rebuild the package, then re-trying the openoffice build.
Comment 14 Don Lewis freebsd_committer freebsd_triage 2023-03-14 01:00:17 UTC
The

  Analyzer analyzer = aLanguageStr.equals("ja") ? (Analyzer)new CJKAna
lyzer(Version.LUCENE_29) : (Analyzer)new StandardAnalyzer(Version.LUCENE_29);

error is also a compile time error.  I tried all sorts of ways to print the language selection and got no output.  I even added an exit before this statement and the error still occurs.  Finally I noticed that this error is coming from javac, which is the java compiler.

This points more strongly to a problem with lucene.
Comment 15 Don Lewis freebsd_committer freebsd_triage 2023-03-14 01:16:04 UTC
Created attachment 240833 [details]
testlucene.java

Install textproc/lucene

Save this attachment as testlucene.java

Run:
  javac -classpath /usr/local/share/java/classes/lucene-analyzers-3.6.2.jar testlucene.java

It should produce no output.
Comment 16 Ken Gunderson 2023-03-14 18:19:16 UTC
(In reply to Don Lewis from comment #15)

And herein we have now finally found THE cluebat.

Cutting to the chase: The default OPTIONS for the Lucene port does NOT build and install the "contributed jars".  Hence no lucene-analyzer:

===> The following configuration options are available for lucene-3.6.2:
     CONTRIB=off: Install contributed jars
     DOCS=on: Build and/or install documentation
     EXAMPLES=on: Build and/or install examples
===> Use 'make config' to modify these settings


So I enabled the contributed jars option:

===> The following configuration options are available for lucene-3.6.2:
     CONTRIB=on: Install contributed jars
     DOCS=on: Build and/or install documentation
     EXAMPLES=on: Build and/or install examples
===> Use 'make config' to modify these settings


A few hours later... OO is now able to build.

So I guess there maybe should be some kind of pkg message/warning?  Else, while I generally eschew the "everything and the kitchen sink" approach, maybe tweak the default opts on the lucene port?  

fwiw, the default opts for the lucene5 port also has the contrib jars disabled - So if changing the defaults gets the nod then maybe make the lucene ports consistent?

===> The following configuration options are available for lucene5-5.5.5:
     CONTRIB=off: Install contributed jars
     DOCS=on: Build and/or install documentation
     EXAMPLES=on: Build and/or install examples
===> Use 'make config' to modify these settings




Thanks bunches for your help and perseverance.
Comment 17 Don Lewis freebsd_committer freebsd_triage 2023-03-14 18:50:34 UTC
Very interesting ... I would have expected a more helpful error from javac if the .jar file was missing.

I was unaware of the lucene options, but the default *is* to include the contrib files:

OPTIONS_DEFINE= CONTRIB DOCS EXAMPLES
CONTRIB_DESC=   Install contributed jars
OPTIONS_DEFAULT=        CONTRIB

It would be nice if we could mark a port broken based on the options for another port, but I don't think that is possible.  Since the build dependencies are installed before the configure step, probably the best we can do is look for the jar file in question before running configure and fail with a helpful message if we don't see it.
Comment 18 commit-hook freebsd_committer freebsd_triage 2023-03-14 21:20:30 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=1cd93b0423e1a07753ad87f7357cf60cac27b9d3

commit 1cd93b0423e1a07753ad87f7357cf60cac27b9d3
Author:     Don Lewis <truckman@FreeBSD.org>
AuthorDate: 2023-03-14 21:15:14 +0000
Commit:     Don Lewis <truckman@FreeBSD.org>
CommitDate: 2023-03-14 21:19:46 +0000

    textproc/lucene: Openoffice requires CONTRIB

    Note that editors/openoffice-* requires the CONTRIB option,
    which is enabled by default.

    Pet portlint.

    PR:             270158
    Reported by:    Ken Gunderson <kgunders@teamcool.net>

 textproc/lucene/Makefile | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
Comment 19 commit-hook freebsd_committer freebsd_triage 2023-03-14 21:20:31 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e0a892ced94cf2502b2f8401b24c358bd3f7f6a1

commit e0a892ced94cf2502b2f8401b24c358bd3f7f6a1
Author:     Don Lewis <truckman@FreeBSD.org>
AuthorDate: 2023-03-14 20:56:42 +0000
Commit:     Don Lewis <truckman@FreeBSD.org>
CommitDate: 2023-03-14 21:19:45 +0000

    editors/openoffice-*: test for required jar file

    Test for a required jar file that is optionally installed by
    textproc/lucene and fail at the configure step with a helpful message
    if we don't find it.  If the jar file is missing, javac fails during
    the build of l10ntools module with an unhelpful error message that does
    not pinpoint the cause of the problem.
    PR:             270158
    Reported by:    Ken Gunderson <kgunders@teamcool.net>

 editors/openoffice-4/Makefile     | 8 ++++++++
 editors/openoffice-devel/Makefile | 9 +++++++++
 2 files changed, 17 insertions(+)
Comment 20 Don Lewis freebsd_committer freebsd_triage 2023-03-14 23:12:34 UTC
Not a bug in OpenOffice, but we could handle the missing dependency in a more user friendly way with a helpful error message instead of failing mysteriously mid-build.