On Mon, 11 Aug 2025 14:17:26 GMT, Magnus Ihse Bursie <i...@openjdk.org> wrote:

>> make/ModuleWrapper.gmk line 82:
>> 
>>> 80:     TARGETS += $(LAUNCHERS_LIST)
>>> 81:   endif
>>> 82: endif
>> 
>> I think it would be cleaner if this could be kept in LauncherCommon.gmk and 
>> avoid having ModuleWrapper.gmk involved in this. I think it can be done 
>> relatively easily. In SetupBuildLauncherBody, instead of constructing the 
>> variable `$(MODULE)_INCLUDED_LAUNCHERS`, declare dependencies for 
>> `$(LAUNCHER_LIST)`, something like this:
>> 
>> $(LAUNCHER_LIST): $$($1)
>> TARGETS += $(LAUNCHER_LIST)
>> 
>> 
>> Then put the the recipe for `$(LAUNCHER_LIST)` at the end of 
>> LauncherCommon.gmk. The $(LAUNCHER_LIST) value will sometimes be added to 
>> TARGETS multiple times, but that's ok I think.
>
> Hm. I put it there since it was the only place where we could be sure we know 
> *all* launchers for a module. I could have each launcher add itself to the 
> list, but then I either need to check if it is already there, or we will just 
> append to the list each time we rebuild. And we risk a race when several 
> launchers build at the same time.

I could also create a separate file for each launcher with a name pattern and 
gather up all these files in StaticLibs.gmk, but then I will get problems with 
left-over such files, for e.g. if incrementally building after removing a 
launcher. Not a common scenario, I agree, but it seems like a worse solution.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24380#discussion_r2266924514

Reply via email to