Skip to content
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

unable to install c++ plugin #6979

Open
quantrpeter opened this issue Jan 20, 2024 · 34 comments
Open

unable to install c++ plugin #6979

quantrpeter opened this issue Jan 20, 2024 · 34 comments
Labels
C/C++ caused-by-plugin issue caused by a third party plugin Contribution welcome An issue or feature not currently being worked on, but a contribution would be welcomed! kind:bug Bug report or fix needs:discussion Requires discussion on the NetBeans dev mailing list

Comments

@quantrpeter
Copy link

Apache NetBeans version

Apache NetBeans 20

What happened

image

Language / Project Type / NetBeans Component

No response

How to reproduce

install c++ plugin

Did this work correctly in an earlier version?

No / Don't know

Operating System

Mac

JDK

21

Apache NetBeans packaging

Apache NetBeans provided installer

Anything else

nothing

Are you willing to submit a pull request?

No

@quantrpeter quantrpeter added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Jan 20, 2024
@bitrunner
Copy link

Like the dialog says, unpack200 is required to extract old netbeans modules like CND. Java 14 removed unpack200, so one way to resolve this is to install JDK 8 or 11 and then use the bottom left button to "Choose Unpack200..." on the dialog to select the unpack200 executable to complete the CND install.

@quantrpeter
Copy link
Author

thanks @bitrunner May I know where is the c++ plugin? may be i can help to revamp it

@bitrunner
Copy link

Mostly @vieiro (with some clueless flailing around help from me) has been working to bring CND back to life. You can find the current state on the cnd branch of the main netbeans repository here on github.

The module can be found in the cnd directory. There is some conflict/overlap with the newer cpplite module that has to be resolved before CND can be incorporated back into netbeans proper. There have been some discussions regarding that on the mailing list. All help is appreciated.

@neilcsmith-net
Copy link
Member

We will also have the issue that currently NB21 is the last release scheduled to support JDK11. NB22 is meant to support JDK17+. We will have to consider whether to update the version check in NB22, and whether installing the old CND will require running on JDK 11 and with the JDK check killswitch enabled.

https://github.com/apache/netbeans/blob/master/platform/o.n.bootstrap/src/org/netbeans/Main.java#L40

cc/ @mbien

@neilcsmith-net neilcsmith-net added needs:discussion Requires discussion on the NetBeans dev mailing list and removed needs:triage Requires attention from one of the committers labels Jan 23, 2024
@neilcsmith-net neilcsmith-net added this to the NB22 milestone Jan 23, 2024
@mbien
Copy link
Member

mbien commented Jan 23, 2024

NB 22 would be probably a good time to remove the old update center from NB? It already has modules which don't work anymore even without JDK bumps. e.g #6810

code ages, and we can't update any plugin on there

@mbien mbien added C/C++ caused-by-plugin issue caused by a third party plugin labels Jan 23, 2024
@matthiasblaesing
Copy link
Contributor

I agree with @mbien we can't stay in the past. If there is really someone caring, he/she can take the CND plugins, unpack200 them and create a new distribution.

@vieiro
Copy link
Contributor

vieiro commented Jan 23, 2024

Mostly @vieiro (with some clueless flailing around help from me) has been working to bring CND back to life. You can find the current state on the cnd branch of the main netbeans repository here on github.

The module can be found in the cnd directory. There is some conflict/overlap with the newer cpplite module that has to be resolved before CND can be incorporated back into netbeans proper. There have been some discussions regarding that on the mailing list. All help is appreciated.

Well, to be fair, many people have been pushing the cnd branch, including @matthiasblaesing and @jlahoda, among others. There're incompatibilities with cpplite, but the cnd branch can be built (using ant -Dcluster.config=cnd). I don't understand how cpplite is being used, so I really can't help improving it to make it compatible with cnd.

@jlahoda
Copy link
Contributor

jlahoda commented Jan 23, 2024

FWIW, I've started blending cpplite into cnd some time ago, but not quite done yet, I'm afraid.

@mbien
Copy link
Member

mbien commented Jan 24, 2024

Well, to be fair, many people have been pushing the cnd branch...

@vieiro yes which is great! I think what @neilcsmith-net meant was that if someone cared about the old release of CND, it would be possible to repack it without pack200 and upload it somewhere - without having to rebuild anything.

A module compressed with pack200 is a strong indication of it being an unmaintained plugin which hasn't been rebuild for over a decade. Installation itself will not remain the only problem - having decade old hibernate or struts 1 support (which had the last release 14 years ago) is questionable in itself (#6969, #6987, #6810).

here the plugin list of the pre-apache NetBeans 8.2 plugin portal:
image

For what it's worth, I tried to install C/C++ from plugin portal 8.2 on NB 20 running on JDK 17 (using pack200 from JDK 11) and got many exceptions like:

INFO [org.netbeans.updater]: 780: Unpacking org-netbeans-modules-cnd-antlr.nbm
INFO [org.netbeans.updater]: File installed /run/media/mbien/500GB 860EVO/nb_data/netbeans_20/cnd/config/Modules/org-netbeans-modules-cnd-antlr.xml@0
INFO [org.netbeans.updater]: Copied file /run/media/mbien/500GB 860EVO/nb_data/netbeans_20/cnd/update/download/org-netbeans-modules-cnd-antlr.nbm:netbeans/config/Modules/org-netbeans-modules-cnd-antlr.xml to /run/media/mbien/500GB 860EVO/nb_data/netbeans_20/cnd/config/Modules/org-netbeans-modules-cnd-antlr.xml
INFO [org.netbeans.updater]: File installed /run/media/mbien/500GB 860EVO/nb_data/netbeans_20/cnd/modules/locale/org-netbeans-modules-cnd-antlr_ja.jar.pack.gz@0
INFO [org.netbeans.updater]: Copied file /run/media/mbien/500GB 860EVO/nb_data/netbeans_20/cnd/update/download/org-netbeans-modules-cnd-antlr.nbm:netbeans/modules/locale/org-netbeans-modules-cnd-antlr_ja.jar.pack.gz to /run/media/mbien/500GB 860EVO/nb_data/netbeans_20/cnd/modules/locale/org-netbeans-modules-cnd-antlr_ja.jar.pack.gz
INFO [org.netbeans.updater]: Unpack /run/media/mbien/500GB 860EVO/nb_data/netbeans_20/cnd/modules/locale/org-netbeans-modules-cnd-antlr_ja.jar.pack.gz to /run/media/mbien/500GB 860EVO/nb_data/netbeans_20/cnd/modules/locale/org-netbeans-modules-cnd-antlr_ja.jar
INFO [org.netbeans.updater]: File /run/media/mbien/500GB 860EVO/nb_data/netbeans_20/cnd/modules/locale/org-netbeans-modules-cnd-antlr_ja.jar.pack.gz deleted.
INFO [org.netbeans.updater]: Ignore non-readable files 
java.io.FileNotFoundException: /run/media/mbien/500GB 860EVO/nb_data/netbeans_20/cnd/modules/locale/org-netbeans-modules-cnd-antlr_ja.jar (No such file or directory)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:216)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
	at org.netbeans.updater.UpdateTracking.getFileCRC(UpdateTracking.java:508)
[catch] at org.netbeans.updater.ModuleUpdater.unpack(ModuleUpdater.java:470)
	at org.netbeans.updater.ModuleUpdater.run(ModuleUpdater.java:118)

and installation failed with:

INFO [org.netbeans.modules.autoupdate.services.InstallSupportImpl]: Timeout waiting for loading module org.netbeans.modules.cnd.api.remote@1.29.5.1
INFO [org.netbeans.modules.autoupdate.ui.wizards.InstallStep]: timeout of loading C/C++ Remote Development API[org.netbeans.modules.cnd.api.remote/1.29.5.1]
org.netbeans.api.autoupdate.OperationException[INSTALL]: timeout of loading C/C++ Remote Development API[org.netbeans.modules.cnd.api.remote/1.29.5.1]
	at org.netbeans.modules.autoupdate.services.InstallSupportImpl$3.call(InstallSupportImpl.java:431)
	at org.netbeans.modules.autoupdate.services.InstallSupportImpl$3.call(InstallSupportImpl.java:291)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[catch] at java.base/java.lang.Thread.run(Thread.java:840)

So if someone would like to continue using the old release of the C/C++ support plugins. The easiest way to achieve this is to stick to NB 20 (soon NB 21 once released) and run NetBeans on JDK 11.

NetBeans 22 will only support running on JDK 17, 21 and 22 and will fail during C/C++ plugin installation as demonstrated above (assuming this can't be easily fixed - I wouldn't put too much effort into this, but if someone wants to take a look: Contribution welcome An issue or feature not currently being worked on, but a contribution would be welcomed! ;)).

And as previously mentioned I think it would be a opportunity to also remove the NB 8.2 plugin portal from the preset list of NB 22. I might open a draft PR later. edit: here it is: #6991

CND might make it back one day into NB in a properly supported manner, but work on that happens during spare time and the feature is not trivial to re-integrate.

@mbien mbien added the Contribution welcome An issue or feature not currently being worked on, but a contribution would be welcomed! label Jan 24, 2024
@bitrunner
Copy link

FWIW, I've started blending cpplite into cnd some time ago, but not quite done yet, I'm afraid.

@jlahoda, I would like to help get this done.

@jlahoda
Copy link
Contributor

jlahoda commented Jan 30, 2024

FWIW, my current sketch to blend cpplite into CND is here:
https://github.com/jlahoda/netbeans/tree/cnd-cpplite-blend

It removes the cpplite.editor (not strictly necessary, but since it is never used anymore, there's no big reason why we should keep it), and rebases cpplite.debugger on top of cnd.debugger.common2 (i.e. it is another frontend to cnd.debugger.common2, just as cnd.debugger.gdb2 is).

There may be an issue with the debugger - it is used in the VS Code extension, and the CND's debugger seems to require many dependencies. Which would make the extension even bigger than it is now, for a little benefit. One solution would be to try to limit the dependencies of the cnd.debugger.common2. Alternative might be to exclude the cpplite.debugger from the standard distro, and keep it only for the VS Code extension and/or other special uses. (Or we could move to java/java.lsp.server/nbcode, which might be cleaner.)

Some things that remain, from the top of my head:

  • on cpplite side:
    -- verify the native image debugging still works with cpplite.debugger and fix it as needed (unless the changes will be reverted)
    -- decide what to do with the Lightweight C/C++ project - it is sometimes useful as a "freeform" project, and as a base specialized projects, but we probably don't want to push that too much to our users
  • on CND side:
    -- support for ccls (this shouldn't really be difficult, and I am not clear why there's a pushback against this)
    -- cnd.lsp must allow other projects to provide the (location of the) compilation database. Besides the Lightweight project, the java/java.openjdk.project can provide the (location of the) compilation database.

@vieiro
Copy link
Contributor

vieiro commented Feb 1, 2024

* on CND side:
  -- support for ccls (this shouldn't really be difficult, and I am not clear why there's a pushback against this)
  -- cnd.lsp must allow other projects to provide the (location of the) compilation database. Besides the Lightweight project, the `java/java.openjdk.project` can provide the (location of the) compilation database.

cnd.lsp should be probably renamed to cnd.makeproject.lsp, as it's specific for make based projects. Adding support for ccls shouldn't be difficult. Currently a single clangd instance can support different projects, I'm not sure if ccls is able to that. IIRC ccls didn't support different projects last time I looked at it.

@bitrunner
Copy link

IMHO, it would be great if cnd.lsp wasn't specific to make based projects. I would like to use cnd.lsp with the meson project support I added too. Meson produces its own compilation database that should be fed to the server. Does it make any sense to separate the makefile specific compilation database generation from perhaps a more general cnd.lsp that would require a compilation database path to be given to it? I can work on that if there is consensus on that being a reasonable path forward.

Do we need some kind of plan to try to have some kind of CND available in NB 22 or is that just a waste of time and effort should be focused on finishing up Jan's work?

@vieiro
Copy link
Contributor

vieiro commented Mar 9, 2024

IMHO, it would be great if cnd.lsp wasn't specific to make based projects. I would like to use cnd.lsp with the meson project support I added too. Meson produces its own compilation database that should be fed to the server. Does it make any sense to separate the makefile specific compilation database generation from perhaps a more general cnd.lsp that would require a compilation database path to be given to it? I can work on that if there is consensus on that being a reasonable path forward.

Yep, that' s a good idea, I think. We could lay out things like so:

  • "cnd.makeproject.lsp", responsible for generating the compilation database for NetBeans "makeproject"-type projects.
  • "cnd.lsp", responsible for launching one or more LSP servers in background using "ide/lsp.client"
    • Projects should define the "flavor" of the LSP server they wan to run (say "clangd" or "ccls").
    • This could be as simple returning an implementation of an interface in the project's Lookup. This interface could return the flavor of the LSP server (ccls or clangd) and maybe the location of the compilation database relative to the project's root, for instance.
    • Some LSP servers can handle multiple projects, others cannot. This may require more investigation. AFAIK a single "clangd" process can handle different projects (cnd.lsp launches a single clangd process), whereas "ccls" requires a process per project. "cnd.lsp" should handle this gracefully.

BTW, "ide/lsp.client" will need some refactoring because of race conditions. The "rust-analyzer" LSP server is complaining that we're sending open document notifications when the server has not been initialized yet.

Do we need some kind of plan to try to have some kind of CND available in NB 22 or is that just a waste of time and effort should be focused on finishing up Jan's work?

I think we should wait to see if Jan can do some progress in improving cpplite with the cnd gdb debuggers. All help should go on Jan's work, I think.

Meanwhile I'll try to upgrade NB's "antlr4" support, drop the obsolete tomlj and move on the pending Rust PR as time permits (little time for this lately, I'm afraid).

@ebarboni ebarboni modified the milestones: NB22, NB23 Apr 18, 2024
@obspsr
Copy link

obspsr commented Jun 14, 2024

Hi NetBeans people,
I just suggest that you warn our NetBeans Users (to avoid time loss), in the C/C++ site section, that

  • due the deadline of JDK 11 --> Netbeans 21 is the last version usable for C++.
  • Added the fact that git-remote (which was essential in the devel process on distant
    32Bits industrial racks) is also working only in 21 version ...
    It seems that C/C++ is lost for a long time for NetBeans, very bad news, as NB has reached
    a really very high level for PHP devel ... :-(((
    Personally, I am moving all my C/C++ projects to KDevelop.
    Thanks for coop,
    Serge.

@X547
Copy link

X547 commented Jun 15, 2024

due the deadline of JDK 11 --> Netbeans 21 is the last version usable for C++.

I tried Netbeans 21 with JDK 11 and there are no option to install C++ support except CPPLite Kit.

@obspsr
Copy link

obspsr commented Jun 15, 2024

You have to go ... Tools -> Plugins and there Uninstall the C/C++ lite.
after that, go to Settings and Add a new portal as "NetBeans 8.2 Plugin Portal"
https://updates.netbeans.org/netbeans/updates/8.2/uc/final/distribution/catalog.xml.gz
and check his mark "Active"...

After that, in Available Plugins you will find the C++ Suite.
Install it and during the 2 minutes install you will have to accept and show the path of JDK-11/bin
(mine is /usr/java/jdk-11/bin/) where lives pack/unpack200 programs.
The installation finished you're done !
And the best, via the Services tab, you can create and work distant C/C++ projects with git-distant ...
Best regards,
Serge.

@F3llFr0mTh3Sky
Copy link

F3llFr0mTh3Sky commented Jun 21, 2024

I was trying to install the C/C++ plugin from NetBeans 8.2 Plugin Portal on NetBeans 22 and everytime I get this issue:
image
Manual activation returns this issue:
image
So basically C/C++ plugin might work on NetBeans 22 if those dependencies could be resolved.

EDIT:
Same issue on Netbeans 21.

@obspsr
Copy link

obspsr commented Jun 22, 2024

My full sequence works with Netbeans 21 ... and sure on LINUX (for M$ I don´t care !)
Regards, Serge

@F3llFr0mTh3Sky
Copy link

F3llFr0mTh3Sky commented Jun 23, 2024

The C/C++ plugin seems to work for me too but it appears disabled in NetBeans plugins list.
I already posted the activation error.
I'm on Linux too.

@mbien mbien modified the milestones: NB23, NB24 Jul 16, 2024
@bevin-hansson
Copy link

Just wondering if there's any more progress or guidance on this. I've been using cnd Netbeans for a long time because it's honestly some of the best C++ code intelligence I've used, and it's hard to move away from that. Now that projects are using more and more modern C++, (like features from C++17 and up), cnd starts breaking.

@obspsr
Copy link

obspsr commented Jul 18, 2024

Netbeans 21 C++ from "NetBeans 8.2 Plugin Portal" is perfectly usable with JDK-11 'pack200' ... why don't you use two versions the last 22 for fun and old 21 for C++ work ?!!

@X547
Copy link

X547 commented Jul 19, 2024

What is the status of https://github.com/apache/netbeans/tree/cnd branch? How to install it? Is it still a plugin or it become a core part of Netbeans? It seems have Meson support that I am interested in.

@vieiro
Copy link
Contributor

vieiro commented Jul 19, 2024

What is the status of https://github.com/apache/netbeans/tree/cnd branch? How to install it? Is it still a plugin or it become a core part of Netbeans? It seems have Meson support that I am interested in.

Make sure you have JDK11 (and bigger?) and ant (10.>) in your $PATH and then

$ git clone https://github.com/apache/netbeans.git
$ cd netbeans
netbeans$ ant -Dcluster.config=cnd
netbeans$ ant tryme

You should install a recent C/C++ LSP server such as clangd or ccls.

@bevin-hansson
Copy link

bevin-hansson commented Jul 19, 2024

You should install a recent C/C++ LSP server such as clangd or ccls.

Is the LSP requirement a later addition? The older C++ plugin doesn't seem to require anything like that, you just point it to the code and it works out of the box.

@vieiro
Copy link
Contributor

vieiro commented Jul 19, 2024

You should install a recent C/C++ LSP server such as clangd or ccls.

Is the LSP requirement a later addition? The older C++ plugin doesn't seem to require anything like that, you just point it to the code and it works out of the box.

The "older C++ plugin" cannot be incorporated directly into Apache NetBeans due to license constraints and code provenance issues. The LSP servers are substitute to those parts. And they're easier to maintain and more accurate.

@X547
Copy link

X547 commented Jul 19, 2024

The "older C++ plugin" cannot be incorporated directly into Apache NetBeans due to license constraints

Does it mean that license is proprietary/NDA or it is just incompatible with Apache Netbeans? If second, it can be developed in separate repo and packaged as plugin.

@vieiro
Copy link
Contributor

vieiro commented Jul 19, 2024

The "older C++ plugin" cannot be incorporated directly into Apache NetBeans due to license constraints

Does it mean that license is proprietary/NDA or it is just incompatible with Apache Netbeans? If second, it can be developed in separate repo and packaged as plugin.

To begin with not all modules in the original CND were donated to the ASF, so the code didn't even compile (that'd be the first commit in the cnd branch). Then there where license incompatibilities and obscure code provenance. Then also the difficulty of maintaining such an old/big codebase (which has been evident during the years).

You can see the whole history in both the "cnd" branch commit history and in the Apache NetBeans mailing list archives.

@X547
Copy link

X547 commented Jul 20, 2024

You should install a recent C/C++ LSP server such as clangd or ccls.

It worked for me for default Makefile based projects, but not for Meson projects. Is it not supported yet or I am missing something?

@matthiasblaesing
Copy link
Contributor

For meson have a look here: #6859

@mbien mbien modified the milestones: NB24, NB25 Oct 11, 2024
@mrechte

This comment was marked as off-topic.

@matthiasblaesing
Copy link
Contributor

@mrechte yes NB22 requires JDK17 but you can choose the path to unpack200 from JDK 11 to install older plugins.

@mrechte

This comment was marked as duplicate.

@mbien
Copy link
Member

mbien commented Oct 18, 2024

in summary:

CND might be salvaged one day under the NetBeans project but this is no trivial task so there is no ETA for that. The other plugins weren't donated to apache to my knowledge.

@mbien mbien removed this from the NB25 milestone Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C/C++ caused-by-plugin issue caused by a third party plugin Contribution welcome An issue or feature not currently being worked on, but a contribution would be welcomed! kind:bug Bug report or fix needs:discussion Requires discussion on the NetBeans dev mailing list
Projects
None yet
Development

No branches or pull requests