You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by "William L. Thomson Jr." <wl...@o-sinc.com> on 2017/11/25 17:29:30 UTC

Packaging Netbeans 9 on Gentoo

Greetings all,

Just starting a thread here since I did on the old mailing list. Just
to recap for those who missed it. I am packaging Netbeans in abnormal
ways using Gentoo packaging system. I am not using Netbeans ant build
system. That was in use on Gentoo but is to cumbersome.

This new approach is going well and I am close to an initial something.
I had some startup issues due to missing resources and may still.
https://github.com/Obsidian-StudiosInc/os-xtoo/tree/master/dev-util/netbeans

netbeans- packages are libraries used in the previous meta one
https://github.com/Obsidian-StudiosInc/os-xtoo/tree/master/dev-java/

Gentoo netbeans eclass, where I do specific stuff, process bundles,
copy resources, etc.
https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/eclass/java-netbeans.eclass

Presently stuck at

java.lang.AssertionError: Has to be NbRepository:
org.openide.filesystems.Repository@3ab8ef5a
        at org.netbeans.core.startup.Main.start(Main.java:281)
        at
org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)
        at java.base/java.lang.Thread.run(Thread.java:844)

Which I came across this but does not resolve that for me.
https://forums.netbeans.org/topic65009.html

Basically think I am close to something along these lines
https://platform.netbeans.org/tutorials/nbm-runtime-container.html

I can post my initial from the other list. It was a bit long. Not sure
if there is an archive of the old list so I can provide a link for
reference. But I covered the basics here :)

Thanks in advance!

-- 
William L. Thomson Jr.

Re: Packaging Netbeans 9 on Gentoo

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
I was missing openide.filesystems.compat8

With that I get new errors, proress!!!

On Sat, 25 Nov 2017 12:29:30 -0500
"William L. Thomson Jr." <wl...@o-sinc.com> wrote:
>
> Presently stuck at
> 
> java.lang.AssertionError: Has to be NbRepository:
> org.openide.filesystems.Repository@3ab8ef5a
>         at org.netbeans.core.startup.Main.start(Main.java:281)
>         at
> org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)
>         at java.base/java.lang.Thread.run(Thread.java:844)
> 
> Which I came across this but does not resolve that for me.
> https://forums.netbeans.org/topic65009.html



-- 
William L. Thomson Jr.

Re: Packaging Netbeans 9 on Gentoo

Posted by Antonio <an...@vieiro.net>.

El 26/11/17 a las 10:33, William L. Thomson Jr. escribió:
> 
>> But before digging into that, how are you going to build the patched
>> external binaries NetBeans requires to run? Have you given a thought
>> to that?
> 
> Which ones do you mean? Worse case I can package those as well.
> 

Some NetBeans modules use external binaries that live in each the 
module's "external" directory. From there they're renamed attending to 
nbproject/project.* rules into some other directories.

Some of those binaries are patched to solve bugs, or fit NetBeans 
requirements, or to provide functionality that is not included in 
NetBeans nor the JDK (spawning system processes, for instance).

Cheers,
Antonio

Re: Initial success!!! was -> Packaging Netbeans 9 on Gentoo

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
On Mon, 27 Nov 2017 06:40:14 -0500
Emilian Bold <em...@protonmail.ch> wrote:

> Congrats! Keep us posted. I'm really enjoying it.

Thanks, I very much appreciate the assistance even just pointers. I
would be no where without annotation processing that is for sure :)

> I thought about using Gentoo but somehow the install phase seemed too
> much work versus Ubuntu. So... I'm stuck with Ubuntu. Perhaps I
> should give it another try.

Its hard for me to recommend to people. Its pretty neglected these
days. The community is not very warm or welcoming sadly. FreeBSD has
prospered very well compared to Gentoo. Just not sure about their Java
stuff. In a nutshell though with Gentoo you get out what you put in. It
takes a good deal of work. Though being a rolling distro that time can
be made up in the long run. Its a great developer distro. I have ran
Gentoo for over a decade and a half, no other distro short of dev vms.

Java tools and what not is what I really liked about Gentoo. At a time
when maven was not widely used and gradle not on anyones radar. I do
not think ivy was a thing. Dealing with dependencies was a pain. Plus
everything bundled jars etc.

What I liked was tools like java-config[1], that manged system/user vm,
java home, classpath various things to easy your Java life on a *nix
system. But that has changed for many and there are tools now. I ported
java-config to jem[2], but also sdkman[3] or jenv[4]. Though bit
different than java-config/jem. Still more options where there was few
before.

Still I really like Java on Gentoo. Single jar, vs many versions
ideally. Worse case a couple slots. Long term I would like to make a
fake local maven repo. Not sure about gradle. I will create symlinks
and pom.xml to replicate a local maven repo. But linking to jar
locations. Unless I change that from /usr/share to like /usr/lib. I
think most use /usr/lib/jars or something.

Gentoo puts jars in /usr/share/<package><-slot>/lib/<package>.jar. I
made a script gen2nblib[5] for Netbeans that ads all those to your
library :)

Happy to help anyone get going on Gentoo. But it is work and will take
time. I recommend having a 2nd system as the first one may be down for
a bit during install.

Java wise the packages in Gentoo are pretty neglected. I am replacing
all Java packages in Gentoo. For the record I am also an infamous
former Gentoo Dev[6], part of the Java Team, Foundation, etc. My entire
overlay should be in tree. As I complete work on Java 9 and Netbeans 9,
they may wish my overlay was in tree. Given the amount of work, not
sure Java on Gentoo will improve outside of my overlay.

There is also Funtoo. Its another way to from the creator of Gentoo
Daniel Robbins. It has better Gnome support. Gentoo is mostly KDE. I
use Enlightenment from my overlay, I maintain all those E packages for
my own needs. Funtoo has some great stuff that Gentoo should also have
like mix-ins vs having a single profile selected in Gentoo. Its not as
popular but a good community. Daniel is usually around and helps. If I
did not have so many running Gentoo I may switch to Funtoo. Or FreeBSD,
but then need to re-do all my packages and java stuff.

However you do not have to install Gentoo to run Gentoo. You could play
with it on your distro or OS via Prefix. Basically a Gentoo install on
your system, and you can run stuff from there. Not sure about GUI apps,
but possible I guess.
https://wiki.gentoo.org/wiki/Project:Prefix


1. https://github.com/gentoo/java-config
2. https://github.com/Obsidian-StudiosInc/jem
3. https://github.com/sdkman/sdkman-cli
4. https://github.com/gcuisinier/jenv
5. https://github.com/Obsidian-StudiosInc/gen2nblib 
6. https://bugs.gentoo.org/show_bug.cgi?id=135927

-- 
William L. Thomson Jr.

Re: Initial success!!! was -> Packaging Netbeans 9 on Gentoo

Posted by Emilian Bold <em...@protonmail.ch>.
Congrats! Keep us posted. I'm really enjoying it.

I thought about using Gentoo but somehow the install phase seemed too much work versus Ubuntu. So... I'm stuck with Ubuntu. Perhaps I should give it another try.

--emi


>-------- Original Message --------
>Subject: Re: Initial success!!! was -> Packaging Netbeans 9 on Gentoo
>Local Time: November 27, 2017 3:56 AM
>UTC Time: November 27, 2017 1:56 AM
>From: wlt-ml@o-sinc.com
>To: dev@netbeans.incubator.apache.org
>
>Finally making some progress!!!
>
>http://www.enlightenment.org/ss/e-5a1b6f9f3dc736.75685030.jpg
>
> Getting lots of popups, exceptions to deal with still. I had to stop
> using the ActionProcessor for now. Like the StaticResources one. They
> seem to not find resources. I even turned on -verbose, and I could see
> paths. But it was still not finding them.
>
> I would say jdk bug with multiple processors but all others work fine
> when combined.
>https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/eclass/java-netbeans.eclass#L109
>
> Seems the api.intent processor and filesystems made biggest differences
> but maybe loaders as well. Likely still more. Going to keep at it till
> no more errors.
>
> Super stoked though. Sorry for all the noise! Thank you VERY much for
> any assistance. I know this seems insane. Though given most any issue I
> came across I saw others using the regular build system and/or making
> projects using the platform running into the same. As shown by some
> links.
>
>William L. Thomson Jr.
>

Re: Initial success!!! was -> Packaging Netbeans 9 on Gentoo

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
Finally making some progress!!!

http://www.enlightenment.org/ss/e-5a1b6f9f3dc736.75685030.jpg

Getting lots of popups, exceptions to deal with still. I had to stop
using the ActionProcessor for now. Like the StaticResources one. They
seem to not find resources. I even turned on -verbose, and I could see
paths. But it was still not finding them.

I would say jdk bug with multiple processors but all others work fine
when combined.
https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/eclass/java-netbeans.eclass#L109

Seems the api.intent processor and filesystems made biggest differences
but maybe loaders as well. Likely still more. Going to keep at it till
no more errors.

Super stoked though. Sorry for all the noise! Thank you VERY much for
any assistance. I know this seems insane. Though given most any issue I
came across I saw others using the regular build system and/or making
projects using the platform running into the same. As shown by some
links.

-- 
William L. Thomson Jr.

Re: Packaging Netbeans 9 on Gentoo

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
On Sun, 26 Nov 2017 18:11:45 -0500
"William L. Thomson Jr." <wl...@o-sinc.com> wrote:

> On Sun, 26 Nov 2017 17:18:15 -0500
> "William L. Thomson Jr." <wl...@o-sinc.com> wrote:
> 
> > On Sun, 26 Nov 2017 14:11:18 -0500
> > "William L. Thomson Jr." <wl...@o-sinc.com> wrote:
> >  
> > > There is also a StaticProcessor but seems only used by 1 class for
> > > icons. Also a LayerProcessor, which I assume generates layer info
> > > in manifest.mf. There were not many others. The others are in odd
> > > packages that are further down the dependency chain if not
> > > optional packages.     
> > 
> > Working with more processors, this is like the error I got from
> > StaticResourceProcessor.
> > 
> > This is from ActionProcessor
> > 
> > src/org/netbeans/core/windows/design/DesignView.java:130: error:
> > Cannot find resource org/netbeans/core/windows/design/DesignView.png
> > @ActionRegistration(iconBase =
> > "org/netbeans/core/windows/design/DesignView.png",  
> 
> Turns out I added the folder to classpath incorrectly. When I got that
> right it found the file. But then I got a new error...
> 
> src/org/netbeans/core/windows/actions/ResetWindowsAction.java:60:
> error: Cannot find resource
> org/netbeans/core/windows/actions/Bundle.properties public static
> ActionListener reset() {
>                               ^
> 
> Not sure why pointing to reset. Seems the issue is it cannot find the
> Bundles.properties resource. Which only happens when using the
> ActionProcessor. Otherwise it is found. The path that fixes the icon
> for ActionProcessor seems to not help for this, despite the
> Bundle.properties being there.
> 
> Playing with paths now.
> https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/eclass/java-netbeans.eclass#L126

These annotation processors are a real nightmare. I am not sure why
people insist on using them. They have some very strange issues with
path resolution. I got it to build once. I did not save the path I
used. I went to slim it down and now I cannot get it to build again. I
really cannot believe how stupid this regarding finding files. When I
am passing absolute paths to the classpath.

Seems it has gone on for years like this....
https://duckduckgo.com/?q=java+processor+"error%3A+Cannot+find+resource"

This one is crazy, changes with different JDK versions
https://forums.netbeans.org/post-132249.html
https://forums.netbeans.org/post-122635.html

Jersey relies heavily on annotation processing and does not have this
sort of madness to build or run. Really need to revisit this stuff in
Netbeans. There is no reason to cause problems like this for so many.

I have generated Java code using a whole variety of things. I have
never seen anything so problematic on trivial things like paths to
files or resources....

Super frustrating!!!! Wasting tons of time on trial and error on very
small things. I can package hundreds of things then get stuck on stupid
issues like this. Which makes me think its a horribly engineered
concept that should not be used.

At the moment via absolute paths I am passing the root directory, src
directory and src/org, Its not finding it in any of those absolute
paths... Soon as I drop ActionProcessor. It is found and the Action
stuff just isn't processed. Why processors mess with others paths. Also
makes no sense.

I myself will avoid annotation processors in my own code like the plague

-- 
William L. Thomson Jr.

Re: Packaging Netbeans 9 on Gentoo

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
The fix for most resource issues like below is 

--source-path src

Once I added that, resources were found :)

On Sun, 26 Nov 2017 18:11:45 -0500
"William L. Thomson Jr." <wl...@o-sinc.com> wrote:

> On Sun, 26 Nov 2017 17:18:15 -0500
> "William L. Thomson Jr." <wl...@o-sinc.com> wrote:
> 
> > On Sun, 26 Nov 2017 14:11:18 -0500
> > "William L. Thomson Jr." <wl...@o-sinc.com> wrote:
> >  
> > > There is also a StaticProcessor but seems only used by 1 class for
> > > icons. Also a LayerProcessor, which I assume generates layer info
> > > in manifest.mf. There were not many others. The others are in odd
> > > packages that are further down the dependency chain if not
> > > optional packages.     
> > 
> > Working with more processors, this is like the error I got from
> > StaticResourceProcessor.
> > 
> > This is from ActionProcessor
> > 
> > src/org/netbeans/core/windows/design/DesignView.java:130: error:
> > Cannot find resource org/netbeans/core/windows/design/DesignView.png
> > @ActionRegistration(iconBase =
> > "org/netbeans/core/windows/design/DesignView.png",  
> 
> Turns out I added the folder to classpath incorrectly. When I got that
> right it found the file. But then I got a new error...
> 
> src/org/netbeans/core/windows/actions/ResetWindowsAction.java:60:
> error: Cannot find resource
> org/netbeans/core/windows/actions/Bundle.properties public static
> ActionListener reset() {
>                               ^



-- 
William L. Thomson Jr.

Re: Packaging Netbeans 9 on Gentoo

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
On Sun, 26 Nov 2017 17:18:15 -0500
"William L. Thomson Jr." <wl...@o-sinc.com> wrote:

> On Sun, 26 Nov 2017 14:11:18 -0500
> "William L. Thomson Jr." <wl...@o-sinc.com> wrote:
>
> > There is also a StaticProcessor but seems only used by 1 class for
> > icons. Also a LayerProcessor, which I assume generates layer info in
> > manifest.mf. There were not many others. The others are in odd
> > packages that are further down the dependency chain if not optional
> > packages.   
> 
> Working with more processors, this is like the error I got from
> StaticResourceProcessor.
> 
> This is from ActionProcessor
> 
> src/org/netbeans/core/windows/design/DesignView.java:130: error:
> Cannot find resource org/netbeans/core/windows/design/DesignView.png
> @ActionRegistration(iconBase =
> "org/netbeans/core/windows/design/DesignView.png",

Turns out I added the folder to classpath incorrectly. When I got that
right it found the file. But then I got a new error...

src/org/netbeans/core/windows/actions/ResetWindowsAction.java:60:
error: Cannot find resource
org/netbeans/core/windows/actions/Bundle.properties public static
ActionListener reset() {
                              ^

Not sure why pointing to reset. Seems the issue is it cannot find the
Bundles.properties resource. Which only happens when using the
ActionProcessor. Otherwise it is found. The path that fixes the icon
for ActionProcessor seems to not help for this, despite the
Bundle.properties being there.

Playing with paths now.
https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/eclass/java-netbeans.eclass#L126

-- 
William L. Thomson Jr.

Re: Packaging Netbeans 9 on Gentoo

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
On Sun, 26 Nov 2017 14:11:18 -0500
"William L. Thomson Jr." <wl...@o-sinc.com> wrote:
>
> > There are many processors, see ServiceProviderProcessor for
> > @ServiceProvider annotations then we have annotations for actions,
> > etc.  
> 
> I grepped for AbstractProcessor usage. I only found a couple. I added
> the ServiceProccesors to core.startup. It only generated services but
> not named services despite having that processor. So I just generate
> the others manually via echo. Using the contents from what was in the
> ones from 8.2.
> https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/dev-java/netbeans-core-startup/netbeans-core-startup-9999.ebuild#L27
> 
> There is also a StaticProcessor but seems only used by 1 class for
> icons. Also a LayerProcessor, which I assume generates layer info in
> manifest.mf. There were not many others. The others are in odd
> packages that are further down the dependency chain if not optional
> packages. 

Working with more processors, this is like the error I got from
StaticResourceProcessor.

This is from ActionProcessor

src/org/netbeans/core/windows/design/DesignView.java:130: error: Cannot
find resource org/netbeans/core/windows/design/DesignView.png
@ActionRegistration(iconBase =
"org/netbeans/core/windows/design/DesignView.png",

It makes no sense as the file DesignView.png is literally in the same
folder as DesignView.java and the next file in order. I tried adding
the folder to the classpath and no luck. I ended up removing usage of
StaticResourceProcessor which was likely not correct but just in
quicksearch. There is likely more ActionRegistrations I rather not
remove and further break things down the road at runtime.

-- 
William L. Thomson Jr.

Re: Packaging Netbeans 9 on Gentoo

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
Latest road block, maybe a missing java module not sure.

org.xml.sax.SAXException: java.net.MalformedURLException: unknown
protocol: nbres
        at org.netbeans.core.startup.layers.ParsingLayerCacheManager.startElement(ParsingLayerCacheManager.java:210)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
        at java.xml/com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:746)
        at java.xml/com.sun.org.apache.xerc
....

I have in jar like 8.2 jars that work
META-INF/namedservices/URLStreamHandler/nbresloc/java.net.URLStreamHandler
META-INF/namedservices/URLStreamHandler/nbres/java.net.URLStreamHandler

Seems its not handling the 2nd one though given the exception. Must be
doing something wrong there.

On Sun, 26 Nov 2017 04:59:07 -0500
Emilian Bold <em...@protonmail.ch> wrote:

> You should compare your output JAR with the NetBeans output JAR and
> see which files you are missing. Most of them will be from annotation
> processors.

That is what I am doing. How I discovered I was missing those files.
Though most seem to have what upstream ones do. Still more to compare.
I have a working 8.2 install and I grabbed a zip of 8.2. I have been
removing jars from the zip to try to break it. I have platform down to
all the same jars I have. So it must be down to contents and manifests.

> There are many processors, see ServiceProviderProcessor for
> @ServiceProvider annotations then we have annotations for actions,
> etc.

I grepped for AbstractProcessor usage. I only found a couple. I added
the ServiceProccesors to core.startup. It only generated services but
not named services despite having that processor. So I just generate
the others manually via echo. Using the contents from what was in the
ones from 8.2.
https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/dev-java/netbeans-core-startup/netbeans-core-startup-9999.ebuild#L27

There is also a StaticProcessor but seems only used by 1 class for
icons. Also a LayerProcessor, which I assume generates layer info in
manifest.mf. There were not many others. The others are in odd packages
that are further down the dependency chain if not optional packages.
 
> We have various 3rd party dependencies in NetBeans references in
> the /external/ folder (eg. libs.asm/external/asm-all-5.0.1.jar). Some
> of those dependencies we use as-is. Some we also *patch*. Your build
> system should take these into account.

I haven't come across that stuff yet. But thanks for the heads up. I
will keep that in mind. Worse case I can see about packaging that,
applying those packages to already packaged stuff via USE flag for
netbeans or other.

I am getting closer though. Having problems with it finding and loading
modules from module directory. For now i just toss them all in library
folder for now. Just to get it running and then I will address other
issues.

Numerous warnings like the following 2 I removed and classpath from
the following startup output

WARNING [org.netbeans.core.modules]: module
org.netbeans.api.annotations.common does not declare
OpenIDE-Module-Public-Packages in its manifest, so all packages are
considered public by default:
http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/api.html#how-vers

WARNING [org.netbeans.core.startup.ModuleList]: Note - failed to parse
MultiFileObject@c647c11[Modules/org-openide-explorer.xml] the quick
way, falling back on XMLReader



-------------------------------------------------------------------------------
>Log Session: Sunday, November 26, 2017 at 2:04:54 PM Eastern Standard Time
>System Info:
  Product Version         = NetBeans Platform 8.2 (Build 9.0_alpha_rc2-os-xtoo)
  Operating System        = Linux version 4.13.11-gentoo running on amd64
  Java; VM; Vendor        = 9.0.1; Java HotSpot(TM) 64-Bit Server VM 9.0.1+11; Oracle Corporation
  Runtime                 = Java(TM) SE Runtime Environment 9.0.1+11
  Java Home               = /opt/oracle-jdk-bin-9.0.1
  System Locale; Encoding = en_US (nb); UTF-8
  Home Directory          = /home/wlt
  Current Directory       = /home/wlt/.netbeans
  User Directory          = /home/wlt/.netbeans/dev
  Cache Directory         = /home/wlt/.cache/netbeans/dev
  Installation            = /usr/share/netbeans-9
  Boot & Ext. Classpath   =
  Application Classpath   = 
  Startup Classpath       =
-------------------------------------------------------------------------------
org.xml.sax.SAXException: java.net.MalformedURLException: unknown protocol: nbres
        at org.netbeans.core.startup.layers.ParsingLayerCacheManager.startElement(ParsingLayerCacheManager.java:210)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
        at java.xml/com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:746)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1394)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2706)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:601)
        at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:531)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:885)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:821)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
        at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1140)
        at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:651)
        at org.netbeans.core.startup.layers.ParsingLayerCacheManager.createRoot(ParsingLayerCacheManager.java:144)
Caused: java.lang.IllegalStateException: Can't overwrite cause with org.xml.sax.SAXException: java.net.MalformedURLException: unknown protocol: nbres
        at java.base/java.lang.Throwable.initCause(Throwable.java:462)
        at org.netbeans.core.startup.layers.ParsingLayerCacheManager.createRoot(ParsingLayerCacheManager.java:159)
Caused: java.io.IOException
        at org.netbeans.core.startup.layers.ParsingLayerCacheManager.createRoot(ParsingLayerCacheManager.java:169)
        at org.netbeans.core.startup.layers.ParsingLayerCacheManager.store(ParsingLayerCacheManager.java:106)
[catch] at org.netbeans.core.startup.layers.LayerCacheManager$1Updater.run(LayerCacheManager.java:146)
        at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:102)
        at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:494)
        at org.openide.filesystems.FileUtil.runAtomicAction(FileUtil.java:396)
        at org.netbeans.core.startup.layers.LayerCacheManager.store(LayerCacheManager.java:166)
        at org.netbeans.core.startup.layers.ModuleLayeredFileSystem.setURLs(ModuleLayeredFileSystem.java:239)
        at org.netbeans.core.startup.layers.ModuleLayeredFileSystem.addURLs(ModuleLayeredFileSystem.java:261)
        at org.netbeans.core.startup.NbInstaller.loadLayers(NbInstaller.java:614)
        at org.netbeans.core.startup.NbInstaller.loadImpl(NbInstaller.java:328)
        at org.netbeans.core.startup.NbInstaller.access$000(NbInstaller.java:77)
        at org.netbeans.core.startup.NbInstaller$1.run(NbInstaller.java:318)
        at org.openide.filesystems.FileUtil$2.run(FileUtil.java:412)
        at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:102)
        at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:494)
        at org.openide.filesystems.FileUtil.runAtomicAction(FileUtil.java:396)
        at org.openide.filesystems.FileUtil.runAtomicAction(FileUtil.java:416)
        at org.netbeans.core.startup.NbInstaller.load(NbInstaller.java:315)
        at org.netbeans.ModuleManager.enable(ModuleManager.java:1343)
        at org.netbeans.ModuleManager.enable(ModuleManager.java:1148)
        at org.netbeans.core.startup.ModuleList.installNew(ModuleList.java:315)
        at org.netbeans.core.startup.ModuleList.trigger(ModuleList.java:251)
        at org.netbeans.core.startup.ModuleSystem.restore(ModuleSystem.java:276)
        at org.netbeans.core.startup.Main.getModuleSystem(Main.java:156)
        at org.netbeans.core.startup.Main.getModuleSystem(Main.java:125)
        at org.netbeans.core.startup.Main.start(Main.java:282)
        at org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)
        at java.base/java.lang.Thread.run(Thread.java:844)
INFO [org.netbeans.core.startup.NbEvents]: Turning on modules:
        org.openide.windows [6.77 9.0_alpha_rc2-os-xtoo]
        org.openide.util.ui [9.8 9.0_alpha_rc2-os-xtoo]
        org.openide.util.lookup [8.34 9.0_alpha_rc2-os-xtoo]
        org.openide.util [9.8 9.0_alpha_rc2-os-xtoo]
        org.openide.text [6.68 9.0_alpha_rc2-os-xtoo]
        org.openide.options [6.38 9.0_alpha_rc2-os-xtoo]
        org.openide.nodes [7.46 9.0_alpha_rc2-os-xtoo]
        org.openide.modules [7.49 9.0_alpha_rc2-os-xtoo]
        org.openide.loaders [7.67 9.0_alpha_rc2-os-xtoo]
        org.openide.io [1.50 9.0_alpha_rc2-os-xtoo]
        org.openide.filesystems.nb [9.11 9.0_alpha_rc2-os-xtoo]
        org.openide.filesystems [9.11 9.0_alpha_rc2-os-xtoo]
        org.openide.explorer [6.63 9.0_alpha_rc2-os-xtoo]
        org.openide.execution [9.4 9.0_alpha_rc2-os-xtoo]
        org.openide.dialogs [7.43 9.0_alpha_rc2-os-xtoo]
        org.openide.compat [6.41 9.0_alpha_rc2-os-xtoo]
        org.openide.awt [7.68 9.0_alpha_rc2-os-xtoo]
        org.openide.actions [6.40 9.0_alpha_rc2-os-xtoo]
        org.netbeans.upgrader [4.36 9.0_alpha_rc2-os-xtoo]
        org.netbeans.swing.tabcontrol [1.57 9.0_alpha_rc2-os-xtoo]
        org.netbeans.swing.plaf [1.42 9.0_alpha_rc2-os-xtoo]
        org.netbeans.swing.outline [1.35 9.0_alpha_rc2-os-xtoo]
        org.netbeans.spi.quicksearch [1.28 9.0_alpha_rc2-os-xtoo]
        org.netbeans.modules.templates [1.8 9.0_alpha_rc2-os-xtoo]
        org.netbeans.modules.settings [1.50 9.0_alpha_rc2-os-xtoo]
        org.netbeans.modules.sendopts/2 [2.37 9.0_alpha_rc2-os-xtoo]
        org.netbeans.modules.sampler [1.15 9.0_alpha_rc2-os-xtoo]
        org.netbeans.modules.queries [1.44 9.0_alpha_rc2-os-xtoo]
        org.netbeans.modules.options.keymap [1.38 9.0_alpha_rc2-os-xtoo]
        org.netbeans.modules.options.api [1.46 9.0_alpha_rc2-os-xtoo]
        org.netbeans.modules.masterfs.ui [ 9.0_alpha_rc2-os-xtoo]
        org.netbeans.modules.masterfs.nio2 [1.16 9.0_alpha_rc2-os-xtoo]
        org.netbeans.modules.masterfs.linux [1.14 9.0_alpha_rc2-os-xtoo]
        org.netbeans.modules.masterfs [ 9.0_alpha_rc2-os-xtoo]
        org.netbeans.modules.keyring [1.25 9.0_alpha_rc2-os-xtoo]
        org.netbeans.modules.editor.mimelookup [1.41 9.0_alpha_rc2-os-xtoo]
        org.netbeans.libs.asm [5.4 9.0_alpha_rc2-os-xtoo]
        org.netbeans.core.windows [2.83 9.0_alpha_rc2-os-xtoo]
        org.netbeans.core.ui [1.46 9.0_alpha_rc2-os-xtoo]
        org.netbeans.core.startup.base [ 9.0_alpha_rc2-os-xtoo]
        org.netbeans.core.startup [ 9.0_alpha_rc2-os-xtoo]
        org.netbeans.core.output2 [1.43 9.0_alpha_rc2-os-xtoo]
        org.netbeans.core.osgi [1.23 9.0_alpha_rc2-os-xtoo]
        org.netbeans.core.network [1.12 9.0_alpha_rc2-os-xtoo]
        org.netbeans.core.multiview [1.45 9.0_alpha_rc2-os-xtoo]
        org.netbeans.core.multitabs [ 9.0_alpha_rc2-os-xtoo]
        org.netbeans.core.io.ui [1.31 9.0_alpha_rc2-os-xtoo]
        org.netbeans.core.ide [1.42 9.0_alpha_rc2-os-xtoo]
        org.netbeans.core.execution [1.42 9.0_alpha_rc2-os-xtoo]
        org.netbeans.core [3.52 9.0_alpha_rc2-os-xtoo]
        org.netbeans.bootstrap [2.77 9.0_alpha_rc2-os-xtoo]
        org.netbeans.api.templates [1.9 9.0_alpha_rc2-os-xtoo]
        org.netbeans.api.progress.nb [1.48 9.0_alpha_rc2-os-xtoo]
        org.netbeans.api.progress [1.48 9.0_alpha_rc2-os-xtoo]
        org.netbeans.api.java [1.66 9.0_alpha_rc2-os-xtoo]
        org.netbeans.api.io [1.4 9.0_alpha_rc2-os-xtoo]
        org.netbeans.api.intent [1.3 9.0_alpha_rc2-os-xtoo]
        org.netbeans.api.annotations.common [1.28 9.0_alpha_rc2-os-xtoo]
SEVERE [global]
java.lang.NullPointerException
        at java.base/java.io.FilterOutputStream.write(FilterOutputStream.java:103)
        at org.netbeans.core.startup.layers.LayerCacheManager$1Updater.flushCaches(LayerCacheManager.java:123)
        at org.netbeans.Stamps$Store.store(Stamps.java:708)
[catch] at org.netbeans.Stamps$Worker.run(Stamps.java:876)



-- 
William L. Thomson Jr.

Re: Packaging Netbeans 9 on Gentoo

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
On Sun, 26 Nov 2017 14:11:18 -0500
"William L. Thomson Jr." <wl...@o-sinc.com> wrote:
>
> 9.0_alpha_rc2-os-xtoo] org.netbeans.api.progress.nb [1.48
> 9.0_alpha_rc2-os-xtoo] org.netbeans.api.progress [1.48
> 9.0_alpha_rc2-os-xtoo] org.netbeans.api.java [1.66
> 9.0_alpha_rc2-os-xtoo] org.netbeans.api.io [1.4
> 9.0_alpha_rc2-os-xtoo] org.netbeans.api.intent [1.3
> 9.0_alpha_rc2-os-xtoo] org.netbeans.api.annotations.common [1.28
> 9.0_alpha_rc2-os-xtoo] SEVERE [global] java.lang.NullPointerException
> at
> java.base/java.io.FilterOutputStream.write(FilterOutputStream.java:103)
> at
> org.netbeans.core.startup.layers.LayerCacheManager$1Updater.flushCaches(LayerCacheManager.java:123)
> at org.netbeans.Stamps$Store.store(Stamps.java:708) [catch] at
> org.netbeans.Stamps$Worker.run(Stamps.java:876)

Forgot to mention, at this point Netbeans Platform seems to be running.
There is a java process. But no Window/UI. But seems it is running till
I hit ctrl-c. So I am pretty close to something. What I have no idea :)

-- 
William L. Thomson Jr.

Re: Packaging Netbeans 9 on Gentoo

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
On Sun, 26 Nov 2017 17:41:20 -0500
Emilian Bold <em...@protonmail.ch> wrote:

> It's not moot how they are generated. If you copy-paste by hand then
> will get out of sync when the NetBeans sources change.

Why do some sources have them in the first place then? Seems they
should be generated always. I guess needed for some bootstrapping or
something like that. Or default values if generation fails. Just odd
to see some generated, and some in sources. I would think it would be
all one way or another.

> Instead of manually editing .ebuild files you might as well just copy
> the whole static META-INF/ including subfolders.

I am doing that but seems most if not all projects have manifest.mf in
the root folder not in META-INF.
https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/eclass/java-netbeans.eclass#L63

> The point being that even if you don't use ant you have to get those
> annotation processors right.

Yes I am working on that now.
https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/eclass/java-netbeans.eclass#L97


-- 
William L. Thomson Jr.

Re: Packaging Netbeans 9 on Gentoo

Posted by Emilian Bold <em...@protonmail.ch>.
It's not moot how they are generated. If you copy-paste by hand then will get out of sync when the NetBeans sources change.

Instead of manually editing .ebuild files you might as well just copy the whole static META-INF/ including subfolders.

The point being that even if you don't use ant you have to get those annotation processors right.

--emi

>-------- Original Message --------
>Subject: Re: Packaging Netbeans 9 on Gentoo
>Local Time: November 26, 2017 9:14 PM
>UTC Time: November 26, 2017 7:14 PM
>From: wlt-ml@o-sinc.com
>To: dev@netbeans.incubator.apache.org
>
>On Sun, 26 Nov 2017 14:11:18 -0500
> "William L. Thomson Jr." wlt-ml@o-sinc.com wrote:
>>>There are many processors, see ServiceProviderProcessor for
>>> @ServiceProvider annotations then we have annotations for actions,
>>> etc.
>>>I grepped for AbstractProcessor usage. I only found a couple. I added
>> the ServiceProccesors to core.startup. It only generated services but
>> not named services despite having that processor. So I just generate
>> the others manually via echo. Using the contents from what was in the
>> ones from 8.2.
>>https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/dev-java/netbeans-core-startup/netbeans-core-startup-9999.ebuild#L27
>>
>> Before processor I was creating those files by hand. I see others
>> already have them in src/META-INF. Not sure if those need be
>> re-generated or used as is in sources.
>>https://github.com/Obsidian-StudiosInc/os-xtoo/commit/7df638bb8df6ef4ab06ed2eaab5278a94abb6a38#diff-cb1024e8ec8f26e74fb46039237652b6
>>
>> How they are created seems moot. Not sure contents change based on
>> compile, so that makes it even more moot to be generated vs static in
>> some form.
>>
>> --
>> William L. Thomson Jr.

Re: Packaging Netbeans 9 on Gentoo

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
On Sun, 26 Nov 2017 14:11:18 -0500
"William L. Thomson Jr." <wl...@o-sinc.com> wrote:
>
> 
> > There are many processors, see ServiceProviderProcessor for
> > @ServiceProvider annotations then we have annotations for actions,
> > etc.  
> 
> I grepped for AbstractProcessor usage. I only found a couple. I added
> the ServiceProccesors to core.startup. It only generated services but
> not named services despite having that processor. So I just generate
> the others manually via echo. Using the contents from what was in the
> ones from 8.2.
> https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/dev-java/netbeans-core-startup/netbeans-core-startup-9999.ebuild#L27

Before processor I was creating those files by hand. I see others
already have them in src/META-INF. Not sure if those need be
re-generated or used as is in sources.
https://github.com/Obsidian-StudiosInc/os-xtoo/commit/7df638bb8df6ef4ab06ed2eaab5278a94abb6a38#diff-cb1024e8ec8f26e74fb46039237652b6

How they are created seems moot. Not sure contents change based on
compile, so that makes it even more moot to be generated vs static in
some form.

-- 
William L. Thomson Jr.

Re: Packaging Netbeans 9 on Gentoo

Posted by Emilian Bold <em...@protonmail.ch>.
You should compare your output JAR with the NetBeans output JAR and see which files you are missing. Most of them will be from annotation processors.

There are many processors, see ServiceProviderProcessor for @ServiceProvider annotations then we have annotations for actions, etc.

We have various 3rd party dependencies in NetBeans references in the /external/ folder (eg. libs.asm/external/asm-all-5.0.1.jar). Some of those dependencies we use as-is. Some we also *patch*. Your build system should take these into account.

--emi


>-------- Original Message --------
>Subject: Re: Packaging Netbeans 9 on Gentoo
>Local Time: November 26, 2017 11:33 AM
>UTC Time: November 26, 2017 9:33 AM
>From: wlt-ml@o-sinc.com
>To: dev@netbeans.incubator.apache.org
>
>On Sun, 26 Nov 2017 07:33:35 +0100
> Antonio antonio@vieiro.net wrote:
>>That's because you're not running the annotation processors.
>>
>> I am using NbBundleProcessor. Is there another? I can look. The static
>> one used in 1 place for 2 icons I bypassed. It was having problems
>> finding the icons in its own sources.
>>
>> But before digging into that, how are you going to build the patched
>> external binaries NetBeans requires to run? Have you given a thought
>> to that?
>>
>> Which ones do you mean? Worse case I can package those as well.
>>
>> Cheers,
>> Antonio
>>El 26/11/17 a las 02:28, William L. Thomson Jr. escribió:
>>>On Sat, 25 Nov 2017 12:29:30 -0500
>>> "William L. Thomson Jr." wlt-ml@o-sinc.com wrote:
>>>>Presently stuck at
>>>>java.lang.AssertionError: Has to be NbRepository:
>>>> org.openide.filesystems.Repository@3ab8ef5a
>>>> at org.netbeans.core.startup.Main.start(Main.java:281)
>>>> at
>>>> org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)
>>>> at java.base/java.lang.Thread.run(Thread.java:844)
>>>>Finally made it past that error. I grabbed missing stuff from 8.2.
>>>It turns out I was missing stuff from core.startup. I do not have
>>> any service files for some reason. These files
>>>$ ls META-INF/
>>> MANIFEST.MF namedservices ervices
>>>$ ls services/
>>> org.netbeans.CLIHandler
>>> 'org.netbeans.core.startup.base.LayerFactory$Provider'
>>> org.openide.filesystems.Repository
>>> org.openide.LifecycleManager
>>> org.openide.modules.InstalledFileLocator
>>> org.openide.modules.Places
>>> org.openide.util.NbPreferences$Provider
>>>I am not finding those in the sources. Not sure what generates
>>> those, but seems I do need them. That is causing the main startup
>>> issues. Though I still have some others to resolve.
>>
>
>William L. Thomson Jr.
>

Re: Packaging Netbeans 9 on Gentoo

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
On Sun, 26 Nov 2017 07:33:35 +0100
Antonio <an...@vieiro.net> wrote:

> That's because you're not running the annotation processors.

I am using NbBundleProcessor. Is there another? I can look. The static
one used in 1 place for 2 icons I bypassed. It was having problems
finding the icons in its own sources.

> But before digging into that, how are you going to build the patched 
> external binaries NetBeans requires to run? Have you given a thought
> to that?

Which ones do you mean? Worse case I can package those as well.

> Cheers,
> Antonio
> 
> El 26/11/17 a las 02:28, William L. Thomson Jr. escribió:
> > On Sat, 25 Nov 2017 12:29:30 -0500
> > "William L. Thomson Jr." <wl...@o-sinc.com> wrote:  
> >>
> >> Presently stuck at
> >>
> >> java.lang.AssertionError: Has to be NbRepository:
> >> org.openide.filesystems.Repository@3ab8ef5a
> >>          at org.netbeans.core.startup.Main.start(Main.java:281)
> >>          at
> >> org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)
> >>          at java.base/java.lang.Thread.run(Thread.java:844)  
> > 
> > Finally made it past that error. I grabbed missing stuff from 8.2.
> > 
> >   It turns out I was missing stuff from core.startup. I do not have
> > any service files for some reason. These files
> > 
> > $ ls META-INF/
> > MANIFEST.MF namedservices ervices
> > 
> > $ ls services/
> >   org.netbeans.CLIHandler
> >   'org.netbeans.core.startup.base.LayerFactory$Provider'
> > org.openide.filesystems.Repository
> > org.openide.LifecycleManager
> > org.openide.modules.InstalledFileLocator
> > org.openide.modules.Places
> > org.openide.util.NbPreferences$Provider
> > 
> > I am not finding those in the sources. Not sure what generates
> > those, but seems I do need them. That is causing the main startup
> > issues. Though I still have some others to resolve.
> >   



-- 
William L. Thomson Jr.

Re: Packaging Netbeans 9 on Gentoo

Posted by Antonio <an...@vieiro.net>.
That's because you're not running the annotation processors.

But before digging into that, how are you going to build the patched 
external binaries NetBeans requires to run? Have you given a thought to 
that?

Cheers,
Antonio

El 26/11/17 a las 02:28, William L. Thomson Jr. escribió:
> On Sat, 25 Nov 2017 12:29:30 -0500
> "William L. Thomson Jr." <wl...@o-sinc.com> wrote:
>>
>> Presently stuck at
>>
>> java.lang.AssertionError: Has to be NbRepository:
>> org.openide.filesystems.Repository@3ab8ef5a
>>          at org.netbeans.core.startup.Main.start(Main.java:281)
>>          at
>> org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)
>>          at java.base/java.lang.Thread.run(Thread.java:844)
> 
> Finally made it past that error. I grabbed missing stuff from 8.2.
> 
>   It turns out I was missing stuff from core.startup. I do not have any
>   service files for some reason. These files
> 
> $ ls META-INF/
> MANIFEST.MF namedservices ervices
> 
> $ ls services/
>   org.netbeans.CLIHandler
>   'org.netbeans.core.startup.base.LayerFactory$Provider'
> org.openide.filesystems.Repository
> org.openide.LifecycleManager
> org.openide.modules.InstalledFileLocator
> org.openide.modules.Places
> org.openide.util.NbPreferences$Provider
> 
> I am not finding those in the sources. Not sure what generates those,
> but seems I do need them. That is causing the main startup issues.
> Though I still have some others to resolve.
> 

Re: Packaging Netbeans 9 on Gentoo

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
On Sat, 25 Nov 2017 12:29:30 -0500
"William L. Thomson Jr." <wl...@o-sinc.com> wrote:
>
> Presently stuck at
> 
> java.lang.AssertionError: Has to be NbRepository:
> org.openide.filesystems.Repository@3ab8ef5a
>         at org.netbeans.core.startup.Main.start(Main.java:281)
>         at
> org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)
>         at java.base/java.lang.Thread.run(Thread.java:844)

Finally made it past that error. I grabbed missing stuff from 8.2.

 It turns out I was missing stuff from core.startup. I do not have any
 service files for some reason. These files

$ ls META-INF/
MANIFEST.MF namedservices ervices

$ ls services/
 org.netbeans.CLIHandler
 'org.netbeans.core.startup.base.LayerFactory$Provider' 
org.openide.filesystems.Repository
org.openide.LifecycleManager
org.openide.modules.InstalledFileLocator
org.openide.modules.Places 
org.openide.util.NbPreferences$Provider

I am not finding those in the sources. Not sure what generates those,
but seems I do need them. That is causing the main startup issues.
Though I still have some others to resolve.

-- 
William L. Thomson Jr.

Re: Packaging Netbeans 9 on Gentoo

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
On Sat, 25 Nov 2017 22:24:38 +0100
Antonio <an...@vieiro.net> wrote:
> 
> _ALL_ the files. This includes nested directories and their contents. 
> META-INF/services/* is key for NetBeans to run. There may be some
> other files there as well. Keep the structure as is.

I am copying them over as they exist in src/.  Just less *.java files.

> Don't mess with manifest.mf entries contents. Just pass the "-M"
> option to jar and avoid specifying a custom manifest.

I am pretty sure I have to add at minimum 
OpenIDE-Module-Build-Version

Not sure why I added 
OpenIDE-Module-Implementation-Version

That may not be necessary.

-- 
William L. Thomson Jr.

Re: Packaging Netbeans 9 on Gentoo

Posted by Antonio <an...@vieiro.net>.

El 25/11/17 a las 22:09, William L. Thomson Jr. escribió:
> On Sat, 25 Nov 2017 22:03:06 +0100
> Antonio <an...@vieiro.net> wrote:
> 
>> El 25/11/17 a las 21:46, William L. Thomson Jr. escribió:
>>> Great thanks, but that is not needed as much as other stuff. Though
>>> I may need to know what modules I should link into a default minimal
>>> install. Still working on getting that started. No UI atm. Though I
>>> think I know why. Duplicate entry in manifest maybe causing things
>>> to not start.
>>
>> NetBeans manifests hold very important information needed at
>> _runtime_, not just at compile time.
> 
> Yes thus far that has been the biggest issue. Runtime resources.
> https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/eclass/java-netbeans.eclass#L61
> 
> My main gripe thus far with Netbeans is mixing in sources with
> resources. I have to copy that over and remove java files not idea.
> https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/eclass/java-netbeans.eclass#L81
> 
>> Try to keep all the files under meta-inf/* directories intact, and
>> include those in the your "jar" tasks (jar has an 'm' option, IIRC,
>> to specify the manifest to use). If you just "jar" then the
>> meta-inf/manifest.mf entry will be overwritten and nothing will work.

_ALL_ the files. This includes nested directories and their contents. 
META-INF/services/* is key for NetBeans to run. There may be some other 
files there as well. Keep the structure as is.

Don't mess with manifest.mf entries contents. Just pass the "-M" option 
to jar and avoid specifying a custom manifest.

Cheers,
Antonio

Re: Packaging Netbeans 9 on Gentoo

Posted by Antonio <an...@vieiro.net>.
Upload one or more resulting jars, for we to review.

Our pleasure helping out! :-)

El 25/11/17 a las 22:39, William L. Thomson Jr. escribió:
> On Sat, 25 Nov 2017 22:33:17 +0100
> Antonio <an...@vieiro.net> wrote:
> 
>> Hi,
>>
>> Please upload the result somewhere so we can take a look by tomorrow.
> 
> Upload what? My repo changes or the actual jars produced? I can push
> out changes. I can send link to live jars on my system. Either way.
> 
> Thanks for the assistance and feedback. Much appreciated!
> 

Re: Packaging Netbeans 9 on Gentoo

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
On Sat, 25 Nov 2017 22:33:17 +0100
Antonio <an...@vieiro.net> wrote:

> Hi,
> 
> Please upload the result somewhere so we can take a look by tomorrow.

Upload what? My repo changes or the actual jars produced? I can push
out changes. I can send link to live jars on my system. Either way.

Thanks for the assistance and feedback. Much appreciated!

-- 
William L. Thomson Jr.

Re: Packaging Netbeans 9 on Gentoo

Posted by Antonio <an...@vieiro.net>.
Hi,

Please upload the result somewhere so we can take a look by tomorrow.

Cheers,
Antonio

El 25/11/17 a las 22:29, William L. Thomson Jr. escribió:
> Fixed warning, but still fails. Thinking something is missing from
> /usr/share/netbeans-9/config/Modules/
> 
> Or its not seeing modules in
> /usr/share/netbeans-9/modules/
> 
>   I put the auto files when they exist in
>   /usr/share/netbeans-9/config/ModuleAutoDep/
> 
> Not sure but clearly something is missing or off. Jar missing resources
> or missing a needed jar.
> 

Re: Packaging Netbeans 9 on Gentoo

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
Fixed warning, but still fails. Thinking something is missing from
/usr/share/netbeans-9/config/Modules/

Or its not seeing modules in 
/usr/share/netbeans-9/modules/

 I put the auto files when they exist in
 /usr/share/netbeans-9/config/ModuleAutoDep/

Not sure but clearly something is missing or off. Jar missing resources
or missing a needed jar.

-- 
William L. Thomson Jr.

Re: Packaging Netbeans 9 on Gentoo

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
On Sat, 25 Nov 2017 22:03:06 +0100
Antonio <an...@vieiro.net> wrote:

> El 25/11/17 a las 21:46, William L. Thomson Jr. escribió:
> > Great thanks, but that is not needed as much as other stuff. Though
> > I may need to know what modules I should link into a default minimal
> > install. Still working on getting that started. No UI atm. Though I
> > think I know why. Duplicate entry in manifest maybe causing things
> > to not start.  
> 
> NetBeans manifests hold very important information needed at
> _runtime_, not just at compile time.

Yes thus far that has been the biggest issue. Runtime resources.
https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/eclass/java-netbeans.eclass#L61

My main gripe thus far with Netbeans is mixing in sources with
resources. I have to copy that over and remove java files not idea.
https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/eclass/java-netbeans.eclass#L81

> Try to keep all the files under meta-inf/* directories intact, and 
> include those in the your "jar" tasks (jar has an 'm' option, IIRC,
> to specify the manifest to use). If you just "jar" then the 
> meta-inf/manifest.mf entry will be overwritten and nothing will work.

I use jar with the mM options, to include and not generate one. It was
due to issues there that prevented initial startup and maybe still
causing the following due to the warning before. I am adding that value
when it does not exist. Or should be. I was adding it regardless
before. Now removing and replacing. Though may need to grep then sed.

The OpenIDE-Module-Implementation-Version is something I add via
https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/eclass/java-netbeans.eclass#L74

Newer version not yet pushed deletes
OpenIDE-Module-Implementation-Version before adding it back

This the warning, but maybe causing the startup to fail afterward. Or
missing jars. Working on masterfs-linux and nio2. Not sure if they are
needed with masterfs. Since the following exact error seems resolved
with that per
https://forums.netbeans.org/topic65009.html

Nov 25, 2017 3:48:09 PM java.util.jar.Attributes read
WARNING: Duplicate name in Manifest:
OpenIDE-Module-Implementation-Version. Ensure that the manifest does
not have duplicate entries, and that blank lines separate individual
sections in both your manifest and in the META-INF/MANIFEST.MF entry in
the jar file. java.lang.AssertionError: Has to be NbRepository:
org.openide.filesystems.Repository@61d9dfd1 at
org.netbeans.core.startup.Main.start(Main.java:281) at
org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98) at
java.base/java.lang.Thread.run(Thread.java:844)


-- 
William L. Thomson Jr.

Re: Packaging Netbeans 9 on Gentoo

Posted by Antonio <an...@vieiro.net>.

El 25/11/17 a las 21:46, William L. Thomson Jr. escribió:
> Great thanks, but that is not needed as much as other stuff. Though I
> may need to know what modules I should link into a default minimal
> install. Still working on getting that started. No UI atm. Though I
> think I know why. Duplicate entry in manifest maybe causing things to
> not start.

NetBeans manifests hold very important information needed at _runtime_, 
not just at compile time.

Try to keep all the files under meta-inf/* directories intact, and 
include those in the your "jar" tasks (jar has an 'm' option, IIRC, to 
specify the manifest to use). If you just "jar" then the 
meta-inf/manifest.mf entry will be overwritten and nothing will work.

Cheers,
Antonio

Re: Packaging Netbeans 9 on Gentoo

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
On Sat, 25 Nov 2017 21:13:26 +0100
Antonio <an...@vieiro.net> wrote:
> 
> The problem when trying to compile NetBeans modules is handling 
> dependencies properly. You need to compile some modules before some
> others.

Yes but that works itself out. As I build one piece, it needs stuff
from another. I just keep packaging other stuff till I can build that
piece. I also have a tool I use to update/bump the package. Which is
where order matters.
https://github.com/Obsidian-StudiosInc/ebuild-bumper/blob/master/bump_pkgs/netbeans

> Extracting this information from the NetBeans sources may be, by
> itself, a difficult task. Keeping it in sync with the NetBeans repo
> should be done automatically.

I do not bother looking at sources. Sometimes pom.xml etc. I just see
what it needs to actually build by building it. See what imports are
missing during any compile. Rinse and repeat.

> I see. Then I imagine you're extracting NetBeans inter-module 
> dependencies and are translating those to Gentoo package
> dependencies. Otherwise your packages may compile, but the final
> result may fail at runtime.

Yes, Gentoo handles dependency order. That is normal for Gentoo in
general, nothing Java specific there. Why Maven and Gradle conflict
with Gentoo vs help. Ivy + Ant is easier, as you can comment out Ivy
and keep Ant. If going that route.

But then patching, fiddling with build.xml, sed, re-writing. Just
creates more work.
 
> I've worked a little bit with NetBeans module dependencies 
> (https://github.com/vieiro/nbp-demo) so let me know if you need help 
> generating this information.

Great thanks, but that is not needed as much as other stuff. Though I
may need to know what modules I should link into a default minimal
install. Still working on getting that started. No UI atm. Though I
think I know why. Duplicate entry in manifest maybe causing things to
not start.

> I am not sure you'll end up with a simpler build and packaging
> system, nor with simpler package mainteinance. But I don't know
> Gentoo, so I'm not sure.

I have dealt with packaging stuff on Gentoo for over  a decade, mostly
Java, but not all. In my experience, this is a much easier route with
less overhead for recurring maintenance over the long term.

Packaging in general is pretty thankless and fruitless, but necessary.
 
> If I were to build a package for Debian or FreeBSD I'll reuse the 
> existing NetBeans build system. Compile NetBeans as per NetBeans
> build system and then package that to a platform specific package.

If I did not have to integrate with a build system that needs to build
from source all the time for the user. Then it would heavily simplify
things. It is MUCH easier to package for binary distributions. Build
once, and do what ever to ensure the result is what you want. That is
not so easy with a build it on demand system for anyone. With their own
preferences. It adds in levels of complexity you do not have on binary
based operating systems.

> FreeBSD's NetBeans port [1], for instance, just checksums a NetBeans 
> binary and then extracts the binaries to a specific system-wide 
> directory, after some file modificatiosns [2].

Gentoo was inspired by BSD, thus portage, related to ports.

There are -bin packages on Gentoo. They are not really preferred. Its a
slippery slope. Once you put in 1 bin, why not 2? Why not then make
the whole OS binary vs from source. Usually from source distros like
FreeBSD and Gentoo do that when it is to difficult to package.

That is where I come in. I make the difficult simple :) 

-- 
William L. Thomson Jr.

Re: Packaging Netbeans 9 on Gentoo

Posted by Antonio <an...@vieiro.net>.
Hi,

Some comments inlined below.

El 25/11/17 a las 20:20, William L. Thomson Jr. escribió:
> On Sat, 25 Nov 2017 18:59:47 +0100
> Antonio <an...@vieiro.net> wrote:
> 
>> Hi,
>>
>> I'm afraid I'm confused.
>>
>> The subject of your email says "Packaging NetBeans 9 on Gentoo" but
>> then you're not packaging NetBeans 9 on Gentoo, but packaging
>> NetBeans in "abnormal ways" using the Gentoo packaging system.
>>
>> Why are you packaging NetBeans in "abnormal ways"?
> 
> It is difficult to use normal Java build systems with Gentoo's portage
> packaging system. They overlap in many ways, and require lots of
> complex code to integrate. Even ant requires a custom Gentoo eclass,
> xml re-writters written in some language, atm python. Its cumbersome.

Mmmm... If ant is difficult to integrate ant then integrating NetBeans 
must be indeed very complicated.

> 
>> What are these  "abnormal ways"?
> 
> Basically using custom shell scripts. That get a list of all java
> files, pass that to javac. Then a folder of resources that is combined
> with classes and passed to jar. Pretty basic, just javac and jar.
> 
> Gets a bit trickier when needing to generate Java code but that is not
> that hard to do via the simple route.
> https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/eclass/java-pkg-simple.eclass#L110
> 
> I make hundreds of packages that way. Presently trying to get rid of
> ant entirely. For numerous reasons.
> 

The problem when trying to compile NetBeans modules is handling 
dependencies properly. You need to compile some modules before some others.

Extracting this information from the NetBeans sources may be, by itself, 
a difficult task. Keeping it in sync with the NetBeans repo should be 
done automatically.

>> Are you trying to package NetBeans modules as Gentoo packages?
> 
> Core modules yes, all 570 projects in repo, NO. Stuff that can be
> downloaded into a users directory via the modules/plugin manager. I
> will not package. I am just looking to package the core IDE and maybe
> some common modules, but not all.

I see. Then I imagine you're extracting NetBeans inter-module 
dependencies and are translating those to Gentoo package dependencies. 
Otherwise your packages may compile, but the final result may fail at 
runtime.

I've worked a little bit with NetBeans module dependencies 
(https://github.com/vieiro/nbp-demo) so let me know if you need help 
generating this information.

> 
>> If so, why? In order to achieve what,  exactly?
> 
> To support Java 9. To have Netbeans 9. To have a simpler build and
> packaging process on Gentoo. To reduce package maintenance all around.
> To provide a level of customization that is presently not available by
> default. To be able to manage all of this by myself efficiently :)
> 

I am not sure you'll end up with a simpler build and packaging system, 
nor with simpler package mainteinance. But I don't know Gentoo, so I'm 
not sure.

If I were to build a package for Debian or FreeBSD I'll reuse the 
existing NetBeans build system. Compile NetBeans as per NetBeans build 
system and then package that to a platform specific package.

FreeBSD's NetBeans port [1], for instance, just checksums a NetBeans 
binary and then extracts the binaries to a specific system-wide 
directory, after some file modificatiosns [2].

Cheers,
Antonio


[1] https://svnweb.freebsd.org/ports/head/java/netbeans/
[2] 
https://svnweb.freebsd.org/ports/head/java/netbeans/Makefile?revision=418767&view=markup


Re: Packaging Netbeans 9 on Gentoo

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
On Sat, 25 Nov 2017 18:59:47 +0100
Antonio <an...@vieiro.net> wrote:

> Hi,
> 
> I'm afraid I'm confused.
> 
> The subject of your email says "Packaging NetBeans 9 on Gentoo" but
> then you're not packaging NetBeans 9 on Gentoo, but packaging
> NetBeans in "abnormal ways" using the Gentoo packaging system.
> 
> Why are you packaging NetBeans in "abnormal ways"? 

It is difficult to use normal Java build systems with Gentoo's portage
packaging system. They overlap in many ways, and require lots of
complex code to integrate. Even ant requires a custom Gentoo eclass,
xml re-writters written in some language, atm python. Its cumbersome.

> What are these  "abnormal ways"?

Basically using custom shell scripts. That get a list of all java
files, pass that to javac. Then a folder of resources that is combined
with classes and passed to jar. Pretty basic, just javac and jar.

Gets a bit trickier when needing to generate Java code but that is not
that hard to do via the simple route.
https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/eclass/java-pkg-simple.eclass#L110

I make hundreds of packages that way. Presently trying to get rid of
ant entirely. For numerous reasons.

>Are you trying to package NetBeans modules as Gentoo packages?

Core modules yes, all 570 projects in repo, NO. Stuff that can be
downloaded into a users directory via the modules/plugin manager. I
will not package. I am just looking to package the core IDE and maybe
some common modules, but not all.

>If so, why? In order to achieve what,  exactly?

To support Java 9. To have Netbeans 9. To have a simpler build and
packaging process on Gentoo. To reduce package maintenance all around.
To provide a level of customization that is presently not available by
default. To be able to manage all of this by myself efficiently :)

-- 
William L. Thomson Jr.

Re: Packaging Netbeans 9 on Gentoo

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
On Sat, 25 Nov 2017 13:15:51 -0500
Emilian Bold <em...@protonmail.ch> wrote:

> Antonio, he's not using our ant build system at all. Basically trying
> to build NetBeans using only our sources and the Gentool build
> scripts/-specific tools.
> 
> It's extra work but doable in the end. Might be interesting if it
> works.

It is actually less work. Integrating Netbeans ant build system with
Gentoo's build system is not trivial. It cannot fully integrate with
Gentoo's ant build system. As it re-writes source/target. Which fails
half way through some of Netbeans files. I was reverting to sed in
fixing it to build under 9 but ran into issues I did not using ant
outside of Gentoo's build system.

Like this sed
https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/dev-java/netbeans-platform/netbeans-platform-8.2-r11.ebuild#L113

Look at any of these. The URLs alone can be a PITA. It becomes
difficult to use system installed libraries. Which maybe newer than
what Netbeans ships. I end up with duplicate stuff in Libraries, old
stuff Netbeans ships with it needs to build or fails. Or new stuff I
added.

https://github.com/gentoo/gentoo/blob/master/dev-java/netbeans-apisupport/netbeans-apisupport-8.2.ebuild
https://github.com/gentoo/gentoo/blob/master/dev-java/netbeans-cnd/netbeans-cnd-8.2.ebuild
https://github.com/gentoo/gentoo/blob/master/dev-java/netbeans-dlight/netbeans-dlight-8.2.ebuild
https://github.com/gentoo/gentoo/blob/master/dev-java/netbeans-enterprise/netbeans-enterprise-8.2-r1.ebuild
https://github.com/gentoo/gentoo/blob/master/dev-java/netbeans-ergonomics/netbeans-ergonomics-8.2.ebuild
https://github.com/gentoo/gentoo/blob/master/dev-java/netbeans-extide/netbeans-extide-8.2.ebuild
https://github.com/gentoo/gentoo/blob/master/dev-java/netbeans-groovy/netbeans-groovy-8.2.ebuild
https://github.com/gentoo/gentoo/blob/master/dev-java/netbeans-harness/netbeans-harness-8.2.ebuild
https://github.com/gentoo/gentoo/blob/master/dev-java/netbeans-ide/netbeans-ide-8.2.ebuild
https://github.com/gentoo/gentoo/blob/master/dev-java/netbeans-java/netbeans-java-8.2.ebuild
https://github.com/gentoo/gentoo/blob/master/dev-java/netbeans-javacard/netbeans-javacard-8.2.ebuild
https://github.com/gentoo/gentoo/blob/master/dev-java/netbeans-javadoc/netbeans-javadoc-8.2.ebuild
https://github.com/gentoo/gentoo/blob/master/dev-java/netbeans-javafx/netbeans-javafx-8.2.ebuild
https://github.com/gentoo/gentoo/blob/master/dev-java/netbeans-mobility/netbeans-mobility-8.2.ebuild
https://github.com/gentoo/gentoo/blob/master/dev-java/netbeans-nb/netbeans-nb-8.2.ebuild
https://github.com/gentoo/gentoo/blob/master/dev-java/netbeans-php/netbeans-php-8.2.ebuild
https://github.com/gentoo/gentoo/blob/master/dev-java/netbeans-platform/netbeans-platform-8.2.ebuild
https://github.com/gentoo/gentoo/blob/master/dev-java/netbeans-profiler/netbeans-profiler-8.2.ebuild
https://github.com/gentoo/gentoo/blob/master/dev-java/netbeans-webcommon/netbeans-webcommon-8.2.ebuild
https://github.com/gentoo/gentoo/blob/master/dev-java/netbeans-websvccommon/netbeans-websvccommon-8.2.ebuild

In a fraction of the time, I have some 50+ netbeans packages, and can
crank out more quickly. Each ebuild is trivial. The eclass even is
smaller than most Netbeans ant ebuilds.

https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/dev-java/netbeans-core-windows/netbeans-core-windows-9999.ebuild
https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/dev-util/netbeans/netbeans-9999.ebuild
https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/eclass/java-netbeans.eclass

-- 
William L. Thomson Jr.

Re: Packaging Netbeans 9 on Gentoo

Posted by Emilian Bold <em...@protonmail.ch>.
Antonio, he's not using our ant build system at all. Basically trying to build NetBeans using only our sources and the Gentool build scripts/-specific tools.

It's extra work but doable in the end. Might be interesting if it works.

--emi
​
>-------- Original Message --------
>Subject: Re: Packaging Netbeans 9 on Gentoo
>Local Time: November 25, 2017 7:59 PM
>UTC Time: November 25, 2017 5:59 PM
>From: antonio@vieiro.net
>To: dev@netbeans.incubator.apache.org
>
>Hi,
>
> I'm afraid I'm confused.
>
> The subject of your email says "Packaging NetBeans 9 on Gentoo" but then
> you're not packaging NetBeans 9 on Gentoo, but packaging NetBeans in
> "abnormal ways" using the Gentoo packaging system.
>
> Why are you packaging NetBeans in "abnormal ways"? What are these
> "abnormal ways"? Are you trying to package NetBeans modules as Gentoo
> packages? If so, why? In order to achieve what, exactly?
>
> Cheers,
> Antonio
>
> El 25/11/17 a las 18:29, William L. Thomson Jr. escribió:
>>Greetings all,
>>Just starting a thread here since I did on the old mailing list. Just
>> to recap for those who missed it. I am packaging Netbeans in abnormal
>> ways using Gentoo packaging system. I am not using Netbeans ant build
>> system. That was in use on Gentoo but is to cumbersome.
>>This new approach is going well and I am close to an initial something.
>> I had some startup issues due to missing resources and may still.
>>https://github.com/Obsidian-StudiosInc/os-xtoo/tree/master/dev-util/netbeans
>>netbeans- packages are libraries used in the previous meta one
>>https://github.com/Obsidian-StudiosInc/os-xtoo/tree/master/dev-java/
>>Gentoo netbeans eclass, where I do specific stuff, process bundles,
>> copy resources, etc.
>>https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/eclass/java-netbeans.eclass
>>Presently stuck at
>>java.lang.AssertionError: Has to be NbRepository:
>> org.openide.filesystems.Repository@3ab8ef5a
>> at org.netbeans.core.startup.Main.start(Main.java:281)
>> at
>> org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)
>> at java.base/java.lang.Thread.run(Thread.java:844)
>>Which I came across this but does not resolve that for me.
>>https://forums.netbeans.org/topic65009.html
>>Basically think I am close to something along these lines
>>https://platform.netbeans.org/tutorials/nbm-runtime-container.html
>>I can post my initial from the other list. It was a bit long. Not sure
>> if there is an archive of the old list so I can provide a link for
>> reference. But I covered the basics here :)
>>Thanks in advance!
>

Re: Packaging Netbeans 9 on Gentoo

Posted by Antonio <an...@vieiro.net>.
Hi,

I'm afraid I'm confused.

The subject of your email says "Packaging NetBeans 9 on Gentoo" but then 
you're not packaging NetBeans 9 on Gentoo, but packaging NetBeans in 
"abnormal ways" using the Gentoo packaging system.

Why are you packaging NetBeans in "abnormal ways"? What are these 
"abnormal ways"? Are you trying to package NetBeans modules as Gentoo 
packages? If so, why? In order to achieve what, exactly?

Cheers,
Antonio

El 25/11/17 a las 18:29, William L. Thomson Jr. escribió:
> Greetings all,
> 
> Just starting a thread here since I did on the old mailing list. Just
> to recap for those who missed it. I am packaging Netbeans in abnormal
> ways using Gentoo packaging system. I am not using Netbeans ant build
> system. That was in use on Gentoo but is to cumbersome.
> 
> This new approach is going well and I am close to an initial something.
> I had some startup issues due to missing resources and may still.
> https://github.com/Obsidian-StudiosInc/os-xtoo/tree/master/dev-util/netbeans
> 
> netbeans- packages are libraries used in the previous meta one
> https://github.com/Obsidian-StudiosInc/os-xtoo/tree/master/dev-java/
> 
> Gentoo netbeans eclass, where I do specific stuff, process bundles,
> copy resources, etc.
> https://github.com/Obsidian-StudiosInc/os-xtoo/blob/master/eclass/java-netbeans.eclass
> 
> Presently stuck at
> 
> java.lang.AssertionError: Has to be NbRepository:
> org.openide.filesystems.Repository@3ab8ef5a
>          at org.netbeans.core.startup.Main.start(Main.java:281)
>          at
> org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98)
>          at java.base/java.lang.Thread.run(Thread.java:844)
> 
> Which I came across this but does not resolve that for me.
> https://forums.netbeans.org/topic65009.html
> 
> Basically think I am close to something along these lines
> https://platform.netbeans.org/tutorials/nbm-runtime-container.html
> 
> I can post my initial from the other list. It was a bit long. Not sure
> if there is an archive of the old list so I can provide a link for
> reference. But I covered the basics here :)
> 
> Thanks in advance!
> 

Re: Packaging Netbeans 9 on Gentoo

Posted by "William L. Thomson Jr." <wl...@o-sinc.com>.
On Sat, 25 Nov 2017 16:48:59 -0500
"William L. Thomson Jr." <wl...@o-sinc.com> wrote:

> I was missing openide.filesystems.compat8
> 
> With that I get new errors, proress!!!

False alarm... That just caused an exception with asm missing. Once I
added that, back to error... grrrr :(

java.lang.AssertionError: Has to be NbRepository:
org.openide.filesystems.Repository@47af979c at
org.netbeans.core.startup.Main.start(Main.java:281) at
org.netbeans.core.startup.TopThreadGroup.run(TopThreadGroup.java:98) at
java.base/java.lang.Thread.run(Thread.java:844)

Guess I will keep packaging and trying stuff out. I may drop the value
I add to manifest.mf and see if that makes a difference or not.

-- 
William L. Thomson Jr.