This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 190111 - Moving CND.ANTLR3 to IDE cluster (including rename to ide.antlr3)
Summary: Moving CND.ANTLR3 to IDE cluster (including rename to ide.antlr3)
Status: RESOLVED FIXED
Alias: None
Product: ide
Classification: Unclassified
Component: libs (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal (vote)
Assignee: nnnnnk
URL:
Keywords:
Depends on: 193651
Blocks: 181264
  Show dependency tree
 
Reported: 2010-09-02 14:50 UTC by Rastislav Komara
Modified: 2010-12-24 10:48 UTC (History)
3 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Possible patch for extra cluster + JG01 (2.76 KB, patch)
2010-10-06 13:09 UTC, Jesse Glick
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rastislav Komara 2010-09-02 14:50:51 UTC
There is need for ANTLR runtime in Java cluster. There is antlr runtime of required version in cnd cluster. So it is natural to move it to ide cluster and share this library between cnd and java cluster. And also made it available for other clusters/modules.
Comment 1 Jaroslav Tulach 2010-09-02 19:25:42 UTC
Y01 Why ANTLR is needed in Java cluster? Can't it be replaced by other, more lightweight solution?
Comment 2 Rastislav Komara 2010-09-03 06:53:30 UTC
(In reply to comment #1)
> Y01 Why ANTLR is needed in Java cluster? Can't it be replaced by other, more
> lightweight solution?

See blocked issues. If by more lightweight solution you mean using hand crafted lexer or regexp I disagree. 

On the other hand, this change is not about #181264 but about general simplification of lexer based feature development within whole IDE. It brings simplicity and better manageability of implementation and also allows us to better manage memory footprint by providing single unified and verified instance of ANTLR for Java, CND, JavaFX/Client Java and other modules.
Comment 3 Jaroslav Tulach 2010-09-03 21:06:33 UTC
OK, I checked bug 181264. I see no reason to bring new library into ide or java cluster. Don't do it (not even for an unspecified overall benefit that it will have in future) stick with classical JRE tools like regexp. 

I shall probably delete the "_FAST" part of the keyword as a sign that I disagree with proposed implementation. The next steps include calling a meeting review with four voting reviewers (I'd like to be one of them, and I suggest Miloslav Metelka as another good candidate), where we can speed up absorption of multiple inputs, resolve all outstanding issues and formulate TCR and TCA constraints for the implementation (I am using terminology from http://wiki.netbeans.org/APIReviewSteps). In case you insist on bringing the antlr framework into heart of "tools platform", let's have a meeting and let decide by vote. As soon as the "_FAST" suffix is deleted, it is your responsibility to organize the meeting and invite reviewers. I'll delete it on beginning of next week, if you don't change your mind.
Comment 4 Jaroslav Tulach 2010-09-07 10:33:13 UTC
Please find next three reviewers and call a meeting to judge the benefit of bringing 3Mb + 150Kb into ide cluster to parse a command line.
Comment 5 Rastislav Komara 2010-09-09 11:47:31 UTC
The meeting was held today (09-sept-2010) and all participants accepted this issue. The following suggestion need to be fulfilled:

* move ANTLR (cnd.antlr3) from CND into IDE cluster and consolidate usage in CND.
* divide ANTLR into runtime and compile time parts and put only runtime to IDE cluster and allows accessibility of compile time part during execution of build script.

As we make agreement before with Vladimir, his team will be responsible for making this change to prevent CND cluster breaking.
Comment 6 Vladimir Voskresensky 2010-09-09 13:45:58 UTC
Nikolay, please, help with this activity
Comment 8 Vladimir Voskresensky 2010-10-06 08:03:52 UTC
remove run-time dependency to prevent load of module
http://hg.netbeans.org/cnd-main?cmd=changeset;node=712bf26cc629
Comment 9 Jaroslav Tulach 2010-10-06 08:06:03 UTC
(In reply to comment #5)
> * divide ANTLR into runtime and compile time parts and put only runtime to IDE
> cluster and allows accessibility of compile time part during execution of build
> script.

3.2M is still in the distribution as netbeans/ide/modules/ext/antlr-3.1.3.jar. This is not state we can release with.
Comment 10 nnnnnk 2010-10-06 10:33:20 UTC
Hello Jaroslav,

Sorry. Actually I don't now how to make it :)
Is there some other module I could look at as example?

Regards,
Nikolay.
Comment 11 Jaroslav Tulach 2010-10-06 12:40:38 UTC
Jesse may have some simple advice. I would use <build-prerequisite/>, but no <runtime-dependency/>. I am not sure how that would work with cluster system, however.
Comment 12 Jesse Glick 2010-10-06 13:07:38 UTC
(In reply to comment #11)
> I am not sure how that would work with cluster system, however.

I think it suffices to remove the devel module from any cluster. You will have to try it with a clean build to be sure.


[JG01] ide.kit should not depend on either of these modules. They are autoloads; dependencies should only be from regular modules which actually need them.


[JG02] the usual naming is org.netbeans.libs.*, not org.netbeans.modules.libs.*; probably not too late to fix that.


[JG03] I would also expect the non-runtime lib to be called org.netbeans.libs.antlr3.devel or similar, and to not include the org.antlr.runtime.* packages (it may or may not need to declare a dep on the runtime lib).
Comment 13 Jesse Glick 2010-10-06 13:09:16 UTC
Created attachment 102280 [details]
Possible patch for extra cluster + JG01
Comment 14 nnnnnk 2010-10-07 15:18:07 UTC
fixed:
renamed to libs.antlr3.devel and libs.antlr3.runtime
removed libs.antlr3.devel dependency from ide

http://hg.netbeans.org/cnd-main?cmd=changeset;node=52c257bb9abb

I've left libs.antlr3.devel in ide cluster, because I can not build modelimpl in other case.
Comment 15 Jesse Glick 2010-10-07 15:30:57 UTC
Please learn to use 'hg mv' (or 'hg addrem -s') rather than 'mv' + 'hg add' + 'hg rm'; if your diff before commit (or before 'hg out -pv') shows identical (or nearly identical) files being deleted from one path and added to another path, you are using Mercurial incorrectly.


JG01 was not fully addressed; ide.kit should not have a dep on even the runtime lib, I think.


"I cannot build [cnd.]modelimpl [unless libs.antlr3.devel remains in the ide cluster]" - what exactly went wrong? It seemed to work when I tried it, though I did not start from a fully clean build (I did first delete what appeared to be relevant generated metadata files).
Comment 16 Quality Engineering 2010-10-08 03:23:13 UTC
Integrated into 'main-golden', will be available in build *201010080000* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/712bf26cc629
User: Vladimir Voskresensky <vv159170@netbeans.org>
Log: remove runtime dependency; extra fix for #190111: Moving CND.ANTLR3 to IDE cluster (including rename to ide.antlr3)
Comment 17 Jaroslav Tulach 2010-12-20 14:35:39 UTC
I've just reported bug 193651 to track the 

> * divide ANTLR into runtime and compile time parts and put only runtime to IDE
> cluster and allows accessibility of compile time part during execution of build
> script.

request. I am not sure if I shall reopen this issue too, when it is not fully implemented...
Comment 18 Jaroslav Tulach 2010-12-22 20:10:32 UTC
I'd like to point out that not all TCRs were fixed when integrating this change and as the discussion in bug 193651 shows, some teams believe it is not easy to implement the contraints under which this change request was approved.
Comment 19 David Konecny 2010-12-22 20:27:22 UTC
I would like to ask the same question as Jesse in comment #15 - "what exactly went wrong?" If you share the answer then somebody might be able to help you.
Comment 20 Vladimir Voskresensky 2010-12-23 00:34:37 UTC
Nik is busy now. I will have a look
Comment 21 Vladimir Voskresensky 2010-12-23 05:57:32 UTC
(In reply to comment #19)
> I would like to ask the same question as Jesse in comment #15 - "what exactly
> went wrong?" If you share the answer then somebody might be able to help you.

after http://hg.netbeans.org/cnd-main/rev/8fb3b7fcd0d4
localy all builds fine, but on hudson build is broken:
http://bertram.netbeans.org/hudson/job/cnd-main/4849/
Comment 22 Jaroslav Tulach 2010-12-23 09:45:19 UTC
The #4849 build seems to succeed with compilation and even runs few tests. Then it fails, but I don't know which target it is executing. Please check configuration of your job to find that out and reproduce the problem locally.
Comment 23 Vladimir Voskresensky 2010-12-23 15:57:19 UTC
see http://netbeans.org/bugzilla/show_bug.cgi?id=193651#c7