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

Re: [PATCH] Makefile: check that tcl/tk is installed

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 27, 2017, 01:13 UTC
Message-ID
<xmqqy3msfrr1.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20171126191510.GA1501@sigill>
Jeff King <peff@peff.net> writes:
Show 10 quoted lines
> ...
> I think your patch does say "consider setting NO_TCLTK" in that case,
> which is an improvement. But it might be nicer still if it Just Worked
> (either because we don't do tcl/tk by default, or because we respect
> NO_GETTEXT in the gitk/git-gui Makefiles, or because our msgfmt can
> fallback further to not even using tclsh).
>
> So I'm not really against this patch, but IMHO it doesn't make the
> interesting case (you don't care about tcl and are just trying to build
> git for the first time) all that much better.

I was in agreement with that line of argument while the patch was discussed, and I still think the above is true.

And if the primary thing we want to address with this patch is the build breakage for those who do not have tclsh nor msgfmt, perhaps it is a more direct fix to update this part in gitk/Makefile:

    ## po-file creation rules
    XGETTEXT   ?= xgettext
    ifdef NO_MSGFMT
            MSGFMT ?= $(TCL_PATH) po/po2msg.sh
    else
            MSGFMT ?= msgfmt
            ifneq ($(shell $(MSGFMT) --tcl -l C -d . /dev/null 2>/dev/null; echo $$?),0)
                    MSGFMT := $(TCL_PATH) po/po2msg.sh
            endif
    endif

There is an identical copy-and-pasted copy of this in git-gui/Makefile, and both of them silently assume that TCL_PATH points at something usable when msgfmt is not available.

Perhaps the "else" part of the above should become a bit more careful, something along the lines of...

    else
            MSGFMT ?= msgfmt
-           ifneq ($(shell $(MSGFMT) --tcl -l C -d . /dev/null 2>/dev/null; echo $$?),0)
-                   MSGFMT := $(TCL_PATH) po/po2msg.sh
-           endif
+           MSGFMT_DRYRUN = --tcl -l C -d . /dev/null 2>/dev/null
+            ifneq ($(shell $(MSGFMT) $(MSGFMT_DRYRUN); echo $$?),0)
+               ifneq ($(shell $(TCL_PATH) po/po2msg.sh $(MSGFMT_DRYRUN); echo $$?),0)
+                    MSGFMT := $(TCL_PATH) po/po2msg.sh
+               else
+                   $(error "no usable msgfmt to build gitk; set NO_TCLTK perhaps?")
+               endif
            endif
    endif

Another reason why I think the Makefiles in gitk and git-gui projects are better targets for the fix is because they are designed to be independent projects. We should be able to do

	cd git-gui && make

in our tree, but an update to our top-level Makefile does not help those people.

Previous: Jeff KingNext: Junio C Hamano
Message 8 of 25 in “Makefile: check that tcl/tk is installed”
  1. Makefile: check that tcl/tk is installedChristian Couder, Nov 20, 2017
  2. Christian CouderNov 20, 2017
  3. Jonathan NiederNov 20, 2017
  4. Christian CouderNov 20, 2017
  5. Jeff KingNov 26, 2017
  6. Christian CouderNov 26, 2017
  7. Jeff KingNov 27, 2017
  8. Junio C HamanoNov 27, 2017
  9. Junio C HamanoNov 27, 2017
  10. Jeff KingNov 27, 2017
  11. Todd ZullingerNov 27, 2017
  12. Christian CouderNov 27, 2017
  13. Jeff KingNov 27, 2017
  14. Junio C HamanoNov 27, 2017
  15. Junio C HamanoNov 28, 2017
  16. travis-ci: avoid new tcl/tk build requirementTodd Zullinger, Nov 28, 2017
  17. Christian CouderNov 28, 2017
  18. Todd ZullingerNov 28, 2017
  19. Junio C HamanoNov 28, 2017
  20. Junio C HamanoNov 27, 2017
  21. Christian CouderNov 25, 2017
  22. Junio C HamanoNov 26, 2017
  23. Christian CouderNov 26, 2017
  24. Ramsay JonesNov 26, 2017
  25. Christian CouderNov 26, 2017

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.