RFR: JDK-8315278: Patch 'print-targets' target to print targets separated by new line
Cesar Soares Lucas
cslucas at openjdk.org
Wed Aug 30 16:38:39 UTC 2023
On Wed, 30 Aug 2023 14:07:47 GMT, Erik Joelsson <erikj at openjdk.org> wrote:
>> Currently 'make print-targets' print all targets on the same line separated by space. That isn't only terribly to read but hard to "grep". Printing each target on a separate line seems much better.
>>
>> Tested on: Linux x64, Windows x64 and MacOS AArch64
>
> I'm not sure about this change. There are three similar and somewhat related diagnostic targets `print-targets` `print-modules` and `print-tests` that currently behave in the same way. If we are to change that behavior, then I think it needs to be uniform. What is your usecase for `print-targets`? Are you using it to find appropriate targets using grep manually? If so, I can see why newline separation would be preferable. I just want to be sure that we aren't breaking some other common usecase.
>
> Historically, `print-targets` was first introduced to help support bash completion by having a way of communicating the full target list from Main.gmk to Init.gmk. That was changed in JDK-8076465 where we started caching the list of targets in a generated makefile to improve performance, and `print-targets` was left as a diagnostics tool.
Hi, @erikj79 . Thank you for reviewing.
> What is your usecase for print-targets? Are you using it to find appropriate targets using grep manually?
Yes, that's exactly how I often use print-targets and I end up always having to append a `tr ' ' '\n'`. I thought that others may have the same issue so I decided to create this patch.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15479#issuecomment-1699501407
More information about the build-dev
mailing list