[lworld] RFR: 8376088: [lworld] value class creation in CompileJavaModules.gmk leaves unnecessary files
David Beaumont
duke at openjdk.org
Thu Jan 22 20:39:17 UTC 2026
On Thu, 22 Jan 2026 20:31:23 GMT, David Beaumont <duke at openjdk.org> wrote:
> This is a tidying up of the value class generation and management.
> It solves JDK-8376088, but also simplifies the two-step process for creating the `META-INF/preview` class files.
>
> Short description of changes:
> 1. Remove JAR file creation (no longer needed, this is the proximal fix for JDK-8376088).
> 2. Stop adding the "intermediate" target for the compilation to the TARGETS list (rely on the subsequent move).
> 3. Move directories directly from the output directory to the preview directory (does not move marker files).
> 4. Make the marker file appear alongside other markers for the module compilation.
> 5. Rename marker file to be consistent with other sibling marker files.
>
> The marker files in `build/linux-x64/jdk/modules/java.base/` are now:
>
>
> _the.java.base_batch
> _the.java.base_batch.cmdline
> _the.java.base_batch.filelist
> _the.java.base_batch.log
> _the.java.base_batch.modfiles
> _the.java.base_batch.modfiles.fixed
> _the.java.base.config_vardeps
> _the.java.base_internalapi
> _the.java.base-javacserver.conf
> _the.java.base_pubapi
> _the.java.base.valueclasses <-- moved/renamed mark file
> _the.java.base.vardeps
>
>
> I've added a couple of notes where there could be choices about the implementation.
make/CompileJavaModules.gmk line 174:
> 172: ))
> 173:
> 174: # Don't add '$($(MODULE)-$(VALUECLASSES_STR))' to TARGETS (it's transient).
I think this is a technically correct statement, but I'm happy to clarify it.
The intent is to "hide" the intermediate state and just see this as the valueclasses target doing one action.
make/CompileJavaModules.gmk line 182:
> 180: $(MODULE_OUTPUTDIR)/_the.java.base.valueclasses: $($(MODULE)-$(VALUECLASSES_STR))
> 181: $(MKDIR) -p $(@D)/META-INF/preview
> 182: $(MV) $(TEMP_OUTPUTDIR)/$(MODULE)/*/ $(@D)/META-INF/preview
This could also be a `$(CP) -r` (with slight adjustment), but I'd want to still avoid copying the marker files.
The root module directory shouldn't contain any files we care about, so using '*/' suffix just copies directories and ignores marker files.
I *think* that because TARGETS doesn't have the compilation marker added to it, once the compilation marker files are created, they only serve to support other targets that depend upon them, which is only the valueclasses target.
If however, the Java compilation macro does have side effects visible to the rest of the build, this might not be a safe assumption. Please let me know if you think I've made an error here, and what your preferences are.
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/1949#discussion_r2718535383
PR Review Comment: https://git.openjdk.org/valhalla/pull/1949#discussion_r2718546548
More information about the valhalla-dev
mailing list