git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v2 5/7] artifacts-tar: respect NO_GETTEXT

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Jul 4, 2021, 22:52 UTC
Message-ID
<nycvar.QRO.7.76.6.2107050038520.8230@tvgsbejvaqbjf.bet>
In-Reply-To
<878s2m8ns9.fsf@evledraar.gmail.com>
Hi Ævar,
On Sun, 4 Jul 2021, Ævar Arnfjörð Bjarmason wrote:
Show 12 quoted lines
> On Sat, Jul 03 2021, Johannes Schindelin via GitGitGadget wrote:
>
> > From: Johannes Schindelin <johannes.schindelin@gmx.de>
> >
> > We obviously do not want to bundle `.mo` files during `make
> > artifacts-tar NO_GETTEXT`, but that was the case.
>
> Should be:
>
>     make artifacts-tar NO_GETTEXT=YesPlease
>
> (Without the =<something> we try to find a "NO_GETTEXT" target)
Correct. Will fix.
Show 5 quoted lines
> > To fix that, go a step beyond just fixing the symptom, and simply
> > define the lists of `.po` and `.mo` files as empty if `NO_GETTEXT` is
> > set.
>
> How about fixing the cause instead of the symptom...
Yes, from my point of view, I did that.
Show 52 quoted lines
> > Helped-by: Matthias Aßhauer <mha1993@live.de>
> > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> > ---
> >  Makefile | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/Makefile b/Makefile
> > index c3565fc0f8f..04e852be015 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -2675,10 +2675,13 @@ po/git.pot: $(GENERATED_H) FORCE
> >  .PHONY: pot
> >  pot: po/git.pot
> >
> > +ifdef NO_GETTEXT
> > +POFILES :=
> > +MOFILES :=
> > +else
> >  POFILES := $(wildcard po/*.po)
> >  MOFILES := $(patsubst po/%.po,po/build/locale/%/LC_MESSAGES/git.mo,$(POFILES))
> >
> > -ifndef NO_GETTEXT
> >  all:: $(MOFILES)
> >  endif
>
> ...i.e. this patch just seems like odd (ab)use of Makefile logic.
>
> Later on in the artifacts-tar rule we rely on our immediate dependency
> list in $^ to feed to "tar czf", and here we're going to set $(MOFILES)
> to an empty list, just to later interpolate that empty list into that
> list of dependencies.
>
> Wouldn't the mores straightforward thing to do be the diff I've got at
> the end here, perhaps with a preceding commit just for the split-up of
> the dependency list?
>
> This matches how we do things elsewhere, i.e. we don't ifdef e.g. this away:
>
>     LIB_PERL := $(wildcard perl/Git.pm perl/Git/*.pm perl/Git/*/*.pm perl/Git/*/*/*.pm)
>     LIB_PERL_GEN := $(patsubst perl/%.pm,perl/build/lib/%.pm,$(LIB_PERL))
>
> rather we keep the list as-is, and ifdef the actual addition of the
> dependency, e.g.:
>
>     ifndef NO_PERL
>     all:: $(LIB_PERL_GEN)
>     [...]
>     endif
>
> One reason we do it like this is because we *don't* want to forget what
> the MOFILES were, because you want e.g. "make clean" to clean them up
> (not that it matters in this case, we rm -rf po/build).

We don't need to be careful about cleaning files we did not generate in the first place.

Your suggestion amounts to unnecessary work. If we asked for NO_GETTEXT, why bother generating the list of `.po` files at all? (Rhetorical question; The answer is "we don't need to".)

Show 34 quoted lines
> Doesn't matter much here, but following this pattern leads to subtle
> "bugs", e.g. an outstanding issue in your 179227d6e21 (Optionally skip
> linking/copying the built-ins, 2020-09-21) (which I noted on-list in
> passing before, IIRC) where during a build we end up with stale
> built-ins from a previous build in the build directory, because we
> pruned the list during definition time, as opposed to adding an inverse
> "I should remove this then" rule.
>
> ("bug" because it doesn't have any actual effect I know of other than
> bothering me that I have e.g. a git-add in my build-dir still :)
>
> diff --git a/Makefile b/Makefile
> index c3565fc0f8f..7fb1d4b6caa 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -3146,9 +3146,18 @@ ifneq ($(INCLUDE_DLLS_IN_ARTIFACTS),)
>  OTHER_PROGRAMS += $(shell echo *.dll t/helper/*.dll)
>  endif
>
> -artifacts-tar:: $(ALL_COMMANDS_TO_INSTALL) $(SCRIPT_LIB) $(OTHER_PROGRAMS) \
> -		GIT-BUILD-OPTIONS $(TEST_PROGRAMS) $(test_bindir_programs) \
> -		$(MOFILES)
> +ARTIFACTS_TAR =
> +ARTIFACTS_TAR += GIT-BUILD-OPTIONS
> +ARTIFACTS_TAR += $(ALL_COMMANDS_TO_INSTALL)
> +ARTIFACTS_TAR += $(SCRIPT_LIB)
> +ARTIFACTS_TAR += $(OTHER_PROGRAMS)
> +ARTIFACTS_TAR += $(TEST_PROGRAMS)
> +ARTIFACTS_TAR += $(test_bindir_programs)
> +ifndef NO_GETTEXT
> +ARTIFACTS_TAR += $(MOFILES)
> +endif
> +
> +artifacts-tar:: $(ARTIFACTS_TAR)

Apart from going out of its way to retain the construction of the `.po` file list (which is totally pointless when operating under `NO_GETTEXT`), this is also a sore to my eyes. So I won't do that.

Thank you for trying to assist in improving this patch series, Dscho

Show 5 quoted lines
>  	$(QUIET_SUBDIR0)templates $(QUIET_SUBDIR1) \
>  		SHELL_PATH='$(SHELL_PATH_SQ)' PERL_PATH='$(PERL_PATH_SQ)'
>  	test -n "$(ARTIFACTS_DIRECTORY)"
>
>
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 22 of 41 in “ci: speed-up the Windows parts of our GitHub workflow”
  1. 0/6 ci: speed-up the Windows parts of our GitHub workflowJohannes Schindelin via GitGitGadget, Jun 23, 2021
  2. 2/6 ci (vs-build): use `cmd` to copy the DLLs, not `powershell`Johannes Schindelin via GitGitGadget, Jun 23, 2021
  3. 1/6 ci: use the new GitHub Action to download git-sdk-64-minimalJohannes Schindelin via GitGitGadget, Jun 23, 2021
  4. 5/6 ci(vs-build): build with NO_GETTEXTDennis Ameling via GitGitGadget, Jun 23, 2021
  5. Ævar Arnfjörð BjarmasonJul 4, 2021
  6. Ævar Arnfjörð BjarmasonJul 4, 2021
  7. Johannes SchindelinJul 13, 2021
  8. Philip OakleyJul 13, 2021
  9. Johannes SchindelinJul 14, 2021
  10. Ævar Arnfjörð BjarmasonJul 14, 2021
  11. 3/6 ci: upgrade to using actions/{up,down}load-artifacts v2Johannes Schindelin via GitGitGadget, Jun 23, 2021
  12. 4/6 ci(windows): transfer also the Git-tracked files to the test jobsJohannes Schindelin via GitGitGadget, Jun 23, 2021
  13. 6/6 ci: accelerate the checkoutJohannes Schindelin via GitGitGadget, Jun 23, 2021
  14. Junio C HamanoJul 1, 2021
  15. 0/7 ci: speed-up the Windows parts of our GitHub workflowJohannes Schindelin via GitGitGadget, Jul 3, 2021
  16. 2/7 ci (vs-build): use `cmd` to copy the DLLs, not `powershell`Johannes Schindelin via GitGitGadget, Jul 3, 2021
  17. 3/7 ci: upgrade to using actions/{up,down}load-artifacts v2Johannes Schindelin via GitGitGadget, Jul 3, 2021
  18. 1/7 ci: use the new GitHub Action to download git-sdk-64-minimalJohannes Schindelin via GitGitGadget, Jul 3, 2021
  19. 6/7 ci(vs-build): build with NO_GETTEXTDennis Ameling via GitGitGadget, Jul 3, 2021
  20. 5/7 artifacts-tar: respect NO_GETTEXTJohannes Schindelin via GitGitGadget, Jul 3, 2021
  21. Ævar Arnfjörð BjarmasonJul 4, 2021
  22. Johannes SchindelinJul 4, 2021
  23. Ævar Arnfjörð BjarmasonJul 5, 2021
  24. 7/7 ci: accelerate the checkoutJohannes Schindelin via GitGitGadget, Jul 3, 2021
  25. Ævar Arnfjörð BjarmasonJul 4, 2021
  26. Johannes SchindelinJul 4, 2021
  27. 4/7 ci(windows): transfer also the Git-tracked files to the test jobsJohannes Schindelin via GitGitGadget, Jul 3, 2021
  28. 0/7 ci: speed-up the Windows parts of our GitHub workflowJohannes Schindelin via GitGitGadget, Jul 4, 2021
  29. 1/7 ci: use the new GitHub Action to download git-sdk-64-minimalJohannes Schindelin via GitGitGadget, Jul 4, 2021
  30. Junio C HamanoJul 6, 2021
  31. 2/7 ci (vs-build): use `cmd` to copy the DLLs, not `powershell`Johannes Schindelin via GitGitGadget, Jul 4, 2021
  32. 3/7 ci: upgrade to using actions/{up,down}load-artifacts v2Johannes Schindelin via GitGitGadget, Jul 4, 2021
  33. 4/7 ci(windows): transfer also the Git-tracked files to the test jobsJohannes Schindelin via GitGitGadget, Jul 4, 2021
  34. 7/7 ci: accelerate the checkoutJohannes Schindelin via GitGitGadget, Jul 4, 2021
  35. 5/7 artifacts-tar: respect NO_GETTEXTJohannes Schindelin via GitGitGadget, Jul 4, 2021
  36. 6/7 ci(vs-build): build with NO_GETTEXTDennis Ameling via GitGitGadget, Jul 4, 2021
  37. Ævar Arnfjörð BjarmasonJul 5, 2021
  38. Johannes SchindelinJul 5, 2021
  39. Junio C HamanoJul 6, 2021
  40. Johannes SchindelinJul 14, 2021
  41. Junio C HamanoJul 6, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.