Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 570600 - dev-db/mysql-workbench - Doesn't actually call antlr and would fail if it did
Summary: dev-db/mysql-workbench - Doesn't actually call antlr and would fail if it did
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Hans de Graaff
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-02 14:38 UTC by James Le Cuirot
Modified: 2016-01-14 22:30 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Le Cuirot gentoo-dev 2016-01-02 14:38:18 UTC
I was curious when graaff said that he'd unbundled antlr from mysql-workbench so I took a look. This is what I found:

* The jar path is being passed to cmake without using java-pkg-2.eclass to properly set the correct JVM beforehand.
* It isn't including stringtemplate, a dependency, in the classpath.
* antlr-runtime.jar is being given, which does nothing by itself.
* None of this is being used anyway because pregenerated files are included in the tarball and GENERATE_FILES in library/mysql.parser/grammar/build-parser is false.

Assuming you still want to generate the files, the simplest and safest way to deal with this is not to use java-pkg-2.eclass but to patch build-parser to use our antlr launcher script instead. The important lines should look like this.

antlr3.5 -make $SOURCE_FILE -o $TARGET_DIRECTORY -Xmaxswitchcaselabels 30
antlr3.5 -make $SOURCE_FILE2 -o $TARGET_DIRECTORY -Xmaxswitchcaselabels 30

I didn't want to install the long list of dependencies to actually try the build but I was able to run build-parser manually anyway. Both antlr3.5 and antlr3 spit out tons of warnings but they seem to generate the files regardless. The only way to know for sure whether either of them are compatible is to build the rest of the package. Please use 3.5 over 3 if it works.

I note that antlr-c is still bundled in ext/antlr-runtime but I also note that CMakeLists.txt says the upstream 3.5 is buggy. I've looked into this and the fixes went into 3.5.2. We have dev-java/antlr-3.5.2 in the tree but only dev-libs/antlr-c-3.5. I was working on antlr-c-3.5.2 but got sidetracked. I'll get moving on this if you're interested.
Comment 1 Hans de Graaff gentoo-dev Security 2016-01-11 20:12:38 UTC
(In reply to James Le Cuirot from comment #0)

> I note that antlr-c is still bundled in ext/antlr-runtime but I also note
> that CMakeLists.txt says the upstream 3.5 is buggy. I've looked into this
> and the fixes went into 3.5.2. We have dev-java/antlr-3.5.2 in the tree but
> only dev-libs/antlr-c-3.5. I was working on antlr-c-3.5.2 but got
> sidetracked. I'll get moving on this if you're interested.

Yes, please! Due to the way antlr-c is bundled we currently need to restrict the build to -j1 which has a big impact on build time.
Comment 2 Hans de Graaff gentoo-dev Security 2016-01-11 21:00:12 UTC
(In reply to James Le Cuirot from comment #0)

> * None of this is being used anyway because pregenerated files are included
> in the tarball and GENERATE_FILES in
> library/mysql.parser/grammar/build-parser is false.

Thanks for the analysis. I've confirmed that this is not actually needed for mysql-workbench 6.3.4 by building the package. I've dropped the dependency.
Comment 3 James Le Cuirot gentoo-dev 2016-01-12 23:25:03 UTC
antlr-c has now been bumped to 3.5.2. :)
Comment 4 James Le Cuirot gentoo-dev 2016-01-14 22:30:50 UTC
Now my part is done, I'll close this to let bug #507838 finish the journey.