On 5/3/26 11:07, Matthias Bläsing wrote:
> Am Sonntag, dem 26.04.2026 um 22:17 +0200 schrieb Michael Bien:
>> On 4/26/26 17:04, Matthias Bläsing wrote:
>>> Am Donnerstag, dem 23.04.2026 um 00:20 +0200 schrieb Michael Bien:
>>>> On 4/22/26 21:58, Matthias Bläsing wrote:
>>>>> [nb-javac can't build netbeans]
>>>> [I have testable branch targetting nbjavac to JDK 17]
> I tested the branch and with a few adjustments to the NetBeans codebase
> for using nbjavac:
>
> https://github.com/matthiasblaesing/netbeans/tree/target-jdk17-4
>
> and adjustments to the build process of nbjavac (updated documentation
> and build.sh):
>
> https://github.com/matthiasblaesing/nb-javac/tree/target-jdk17-4
>
> I was able to compile NetBeans with nb-javac again.

(excuse to resurrect the old thread - it's the same topic and everything
has been already said in this thread so I don't have to repeat it)


Hello devs,

I "bit the bullet" this Sunday when I tried to update editor support to
JDK 28 and rewrote the whole nb-javac build from scratch:

https://github.com/mbien/nb-javac/tree/bootstrap

The goal is to make maintenance as easy as possible. In fact I could
iterate on it fairly quickly and was even able to open the JDK 28 editor
update PR the same evening:

https://github.com/apache/netbeans/pull/9790


so what improved:

 - build is now a Java file. (make would be an option too, gradle
disqualified early + wanted to move away from ant)
 - it bootstraps the right way around. It builds upstream JDK and
actually backports the pieces using release=21
 - release 21 makes it trivial to maintain, javac code is basically on
21 level already. The delta to upstream will also remain constant since
it will move with NB's lower bound
 - build is reproducible. Wasn't really intended; was more like a "why
not" moment. Produces checksums right away too - verified by comparing
local with CI.
 - no extra dependencies. It compiles with javac, junit for tests (there
is one exception which was deferred to later, see issues).
 - significantly reduced Jackport transformation rules
 - remains CI friendly. The upstream JDK is cached, build remains at
about 2-3 mins. 15 mins on cache miss.

drive-by fixes:

 - big one: current nb-javac has ct.sym of JDK 24 in it. This got
automatically fixed by actually building the upstream jdk since that is
where it's from.
 - no multi release jar needed (-> less complex setup)
 - it is now semantically much closer to upstream javac. As shown in
past builds, just because the code is backported on the API level,
doesn't mean the semantics stayed the same. There is no javac guarantee
that a method on JDK 8 means the exact same as on JDK 28 - it's all
internal code after all.
 

issues i left open since they can wait:

 - it still ships some packages which don't exist anymore in upstream
JDKs (netbeans#9368)
 - I don't fully understand why the public API is shipped in two jars
but I didn't want to change too much at once and kept it (although I did
make minor changes, e.g. the api jar leaked javac internals like
LintMapper which is no longer the case)

It's essentially a somewhat faithful reconstruction of the same layout,
verified by comparing it with prior releases assisted by agents + green
NB CI and a short manual smoke test.

I am not proposing to integrate the branch into Jaroslav's repo - the
pragmatic choice is probably to change the GAV namespace slightly and
let both coexist; the artifact which shares the lower bound with NB
would be the supply chain artifact for NB.

Essentially everything technical is solved, I hope. What is left is to
gauge if there is support from other committers who would like to help
maintaining it + doing the first release. 
The idea is to sync CI with upstream JDK builds which happen ~bi-weekly
- and upload to central whenever we need a new build. So we can update
twice during an NB release cycle: early and before release.

Anyone interested in helping maintain a core component of the NB Java
editor support?

best regards,

michael

>
> Thank you
>
> Matthias
>  
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
> For further information about the NetBeans mailing lists, visit:
> https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



Reply via email to