RFR: 8366899: SetupExecute should add the command line to vardeps
Magnus Ihse Bursie
ihse at openjdk.org
Thu Sep 18 14:43:35 UTC 2025
On Wed, 17 Sep 2025 19:40:12 GMT, Erik Joelsson <erikj at openjdk.org> wrote:
>> If the command line changes, it is reason to re-run the command.
>
> make/common/Execute.gmk line 153:
>
>> 151: $1_VARDEPS := $$($1_COMMAND) $$($1_PRE_COMMAND) $$($1_POST_COMMAND)
>> 152: $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS)
>> 153: $1_DEPS += $$($1_VARDEPS_FILE)
>
> `$1_DEPS` is an input parameter. Should we really be appending to it inside the macro body?
I think we usually do that? I mean, if I were programming in a proper language, I'd be horrified at the thought of changing a function argument. But with the limited expressiveness of make, I think this is okay.
What alternative would you prefer otherwise? That we create a new `$1_EXTRA_DEPS`, add the vardeps file to it, and insert `$$($1_EXTRA_DEPS)` wherever we have `$$($1_DEPS)`? Or explicitly adding the `$$($1_VARDEPS_FILE)` everywhere instead? I don't think any of these are necessarily better.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27348#discussion_r2359665410
More information about the build-dev
mailing list