Message ID | 20250410-505-wire-up-sparse-via-meson-v2-4-acb45cc8a2e5@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | meson: add corresponding target for Makefile's hdr-check | expand |
Hi Karthik On 10/04/2025 12:30, Karthik Nayak wrote: > The 'hdr-check' target in meson and makefile is used to check if headers > can be compiled individually. The naming however isn't readable as 'hdr' > is not a common shortforme for 'header', neither is it an abbreviation. > > Let's introduce 'headers-check' as an alternative target for 'hdr-check' > and add a `TODO` to deprecate the latter after 2 releases. Since this > is an internal tool, we can use a shorter deprecation cycle. Can we call this "check-headers" to match the other "check-" targets in the Makefile please Thanks Phillip > Change existing usage of 'hdr-check' in 'ci/run-static-analysis.sh' to > also use 'headers-check'. > > Signed-off-by: Karthik Nayak <karthik.188@gmail.com> > --- > Makefile | 4 +++- > ci/run-static-analysis.sh | 2 +- > meson.build | 2 ++ > 3 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/Makefile b/Makefile > index ac32d2d0bd..0ac91e0af1 100644 > --- a/Makefile > +++ b/Makefile > @@ -3326,8 +3326,10 @@ HCC = $(HCO:hco=hcc) > $(HCO): %.hco: %.hcc $(GENERATED_H) FORCE > $(QUIET_HDR)$(CC) $(ALL_CFLAGS) -o /dev/null -c -xc $< > > -.PHONY: hdr-check $(HCO) > +# TODO: deprecate 'hdr-check' in lieu of 'headers-check' in Git 2.51+ > +.PHONY: hdr-check headers-check $(HCO) > hdr-check: $(HCO) > +headers-check: hdr-check > > .PHONY: style > style: > diff --git a/ci/run-static-analysis.sh b/ci/run-static-analysis.sh > index 0d51e5ce0e..2e51411d6e 100755 > --- a/ci/run-static-analysis.sh > +++ b/ci/run-static-analysis.sh > @@ -26,7 +26,7 @@ then > exit 1 > fi > > -make hdr-check || > +make headers-check || > exit 1 > > make check-pot > diff --git a/meson.build b/meson.build > index 6fce1aa618..74597283b9 100644 > --- a/meson.build > +++ b/meson.build > @@ -2099,7 +2099,9 @@ if headers.length() != 0 and compiler.get_argument_syntax() == 'gcc' > hco_targets += hco > endforeach > > + # TODO: deprecate 'hdr-check' in lieu of 'headers-check' in Git 2.51+ > alias_target('hdr-check', hco_targets) > + alias_target('headers-check', hco_targets) > endif > > foreach key, value : { >
Phillip Wood <phillip.wood123@gmail.com> writes: > On 10/04/2025 12:30, Karthik Nayak wrote: >> The 'hdr-check' target in meson and makefile is used to check if headers >> can be compiled individually. The naming however isn't readable as 'hdr' >> is not a common shortforme for 'header', neither is it an abbreviation. >> Let's introduce 'headers-check' as an alternative target for >> 'hdr-check' >> and add a `TODO` to deprecate the latter after 2 releases. Since this >> is an internal tool, we can use a shorter deprecation cycle. > > Can we call this "check-headers" to match the other "check-" targets > in the Makefile please Excellent suggestion. If we were to change things, we should get it right just once. Thanks.
Junio C Hamano <gitster@pobox.com> writes: > Phillip Wood <phillip.wood123@gmail.com> writes: > >> On 10/04/2025 12:30, Karthik Nayak wrote: >>> The 'hdr-check' target in meson and makefile is used to check if headers >>> can be compiled individually. The naming however isn't readable as 'hdr' >>> is not a common shortforme for 'header', neither is it an abbreviation. >>> Let's introduce 'headers-check' as an alternative target for >>> 'hdr-check' >>> and add a `TODO` to deprecate the latter after 2 releases. Since this >>> is an internal tool, we can use a shorter deprecation cycle. >> >> Can we call this "check-headers" to match the other "check-" targets >> in the Makefile please > > Excellent suggestion. If we were to change things, we should get it > right just once. > > Thanks. Yeah I agree too, I based it off 'coccicheck', but seems like 'check-*' is more consistent. Thanks
diff --git a/Makefile b/Makefile index ac32d2d0bd..0ac91e0af1 100644 --- a/Makefile +++ b/Makefile @@ -3326,8 +3326,10 @@ HCC = $(HCO:hco=hcc) $(HCO): %.hco: %.hcc $(GENERATED_H) FORCE $(QUIET_HDR)$(CC) $(ALL_CFLAGS) -o /dev/null -c -xc $< -.PHONY: hdr-check $(HCO) +# TODO: deprecate 'hdr-check' in lieu of 'headers-check' in Git 2.51+ +.PHONY: hdr-check headers-check $(HCO) hdr-check: $(HCO) +headers-check: hdr-check .PHONY: style style: diff --git a/ci/run-static-analysis.sh b/ci/run-static-analysis.sh index 0d51e5ce0e..2e51411d6e 100755 --- a/ci/run-static-analysis.sh +++ b/ci/run-static-analysis.sh @@ -26,7 +26,7 @@ then exit 1 fi -make hdr-check || +make headers-check || exit 1 make check-pot diff --git a/meson.build b/meson.build index 6fce1aa618..74597283b9 100644 --- a/meson.build +++ b/meson.build @@ -2099,7 +2099,9 @@ if headers.length() != 0 and compiler.get_argument_syntax() == 'gcc' hco_targets += hco endforeach + # TODO: deprecate 'hdr-check' in lieu of 'headers-check' in Git 2.51+ alias_target('hdr-check', hco_targets) + alias_target('headers-check', hco_targets) endif foreach key, value : {
The 'hdr-check' target in meson and makefile is used to check if headers can be compiled individually. The naming however isn't readable as 'hdr' is not a common shortforme for 'header', neither is it an abbreviation. Let's introduce 'headers-check' as an alternative target for 'hdr-check' and add a `TODO` to deprecate the latter after 2 releases. Since this is an internal tool, we can use a shorter deprecation cycle. Change existing usage of 'hdr-check' in 'ci/run-static-analysis.sh' to also use 'headers-check'. Signed-off-by: Karthik Nayak <karthik.188@gmail.com> --- Makefile | 4 +++- ci/run-static-analysis.sh | 2 +- meson.build | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-)