lahodaj opened a new pull request, #7201:
URL: https://github.com/apache/netbeans/pull/7201

   Currently, when a module sets `requires.nb.javac`, it cannot have 
`javac.source`/`javac.target` > 8, and the use of `--release` is disabled for 
it. This is because the `requires.nb.javac` is implemented using 
`-Xbootclasspath/p:`, which is incompatible with both `javac.source`  > 8 and 
`--release`.
   
   As NetBeans now practically only supports JDK 17 as the build/runtime JDK, 
this is becoming increasingly troublesome. JDK 17 includes things like Text 
Blocks, which would be immensely useful for writing tests, but we cannot use 
that because `javac.source` is stuck on `8` for the javac-based modules.
   
   There are multiple ways out of this, but the one in this patch is that we 
run the compilation with `--limit-modules` setup in such a way that 
`java.compiler` and `jdk.compiler` are disabled. The correct javac is then 
pulled from the classpath as any ordinary library. This is a bit tricky, as it 
means we need to list modules that should be enabled. This is achieved using a 
custom Ant task, which may run a probe on the target JDK, determining modules 
that are neither `java.compiler` nor `jdk.compiler`, and do not depend either 
of these.
   
   Some alternatives:
    - using `--patch-module`, and replace the content of the module (which may 
be tricky, as this does not remove the all module content)
    - having more precise dependencies on JDK modules inside `project.xml`, and 
specifically setup the system module paths to only include these modules. This 
would work, but is a lot of more work. So, while we may do that in the long 
run, the patch here still seems reasonable for now to me.
   
   There is an obvious relation to https://github.com/apache/netbeans/pull/7188 
- either this or that patch will need tweaks to accommodate changes from the 
other. I am completely fine with doing that here, assuming there's a reasonable 
timeline.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
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