{"thread":{"id":"46577","subject":"NO_MSGFMT","startedAt":"2017-08-12T13:50:03Z","lastAt":"2017-11-12T17:32:50Z","messageCount":4,"participants":["Dominik Mahrer (Teddy)","Jeff King","Christian Couder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"326217","messageId":"b6b12040-100f-5965-6dfd-344c84dddf96@teddy.ch","threadId":"46577","inReplyTo":null,"subject":"NO_MSGFMT","fromName":"Dominik Mahrer (Teddy)","fromEmail":"teddy@teddy.ch","sentAt":"2017-08-12T13:44:17Z","receivedAt":"2017-08-12T13:50:03Z","isPatch":false,"sender":{"key":"teddy@teddy.ch","avatar":null},"body":"Hi all\n\nI'm compiling git from source code on a mashine without msgfmt. This \nleads to compile errors. To be able to compile git I created a patch \nthat at least works for me:\n\ndiff -Naur ../git-2.14.1.orig/Makefile ./Makefile\n--- ../git-2.14.1.orig/Makefile\t2017-08-09 21:54:31.000000000 +0200\n+++ ./Makefile\t2017-08-12 15:22:06.000000000 +0200\n@@ -2261,7 +2261,11 @@\n  endif\n\n  po/build/locale/%/LC_MESSAGES/git.mo: po/%.po\n+ifndef NO_MSGFMT\n  \t$(QUIET_MSGFMT)mkdir -p $(dir $@) && $(MSGFMT) -o $@ $<\n+else\n+\t@echo Skipping file $@\n+endif\n\n  FIND_SOURCE_FILES = ( \\\n  \tgit ls-files \\\n@@ -2523,7 +2527,9 @@\n  endif\n  ifndef NO_TCLTK\n  \t$(MAKE) -C gitk-git install\n-\t$(MAKE) -C git-gui gitexecdir='$(gitexec_instdir_SQ)' install\n+\tifndef NO_MSGFMT\n+\t\t$(MAKE) -C git-gui gitexecdir='$(gitexec_instdir_SQ)' install\n+\tendif\n  endif\n  ifneq (,$X)\n  \t$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) \n$(BUILT_INS) git$X)), test '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p' -ef \n'$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p$X' || $(RM) \n'$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p';)\n\n\n\nIt would be great if it (or something similar) could be included in git.\n\nRegards\nTeddy\n"},{"id":"326232","messageId":"20170813045813.i42mgwn3dmm6u52o@sigill.intra.peff.net","threadId":"46577","inReplyTo":"b6b12040-100f-5965-6dfd-344c84dddf96@teddy.ch","subject":"Re: NO_MSGFMT","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-08-13T04:58:13Z","receivedAt":"2017-08-13T04:58:21Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Aug 12, 2017 at 03:44:17PM +0200, Dominik Mahrer (Teddy) wrote:\n\n> Hi all\n> \n> I'm compiling git from source code on a mashine without msgfmt. This leads\n> to compile errors. To be able to compile git I created a patch that at least\n> works for me:\n\nTry:\n\n  make NO_MSGFMT=Nope NO_GETTEXT=Nope\n\nThis also works:\n\n  make NO_GETTEXT=Nope NO_TCLTK=Nope\n\nThe flags to avoid gettext/msgfmt are sadly different between git itself\nand git-gui/gitk, which we include as a subproject. It would be a useful\npatch to harmonize though (probably by accepting both in all places for\ncompatibility).\n\n-Peff\n"},{"id":"332320","messageId":"20171112115725.c2pjhpwpcjeh4xbr@sigill.intra.peff.net","threadId":"46577","inReplyTo":"20170813045813.i42mgwn3dmm6u52o@sigill.intra.peff.net","subject":"Re: NO_MSGFMT","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-11-12T11:57:25Z","receivedAt":"2017-11-12T11:57:34Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Aug 13, 2017 at 12:58:13AM -0400, Jeff King wrote:\n\n> On Sat, Aug 12, 2017 at 03:44:17PM +0200, Dominik Mahrer (Teddy) wrote:\n> \n> > Hi all\n> > \n> > I'm compiling git from source code on a mashine without msgfmt. This leads\n> > to compile errors. To be able to compile git I created a patch that at least\n> > works for me:\n> \n> Try:\n> \n>   make NO_MSGFMT=Nope NO_GETTEXT=Nope\n> \n> This also works:\n> \n>   make NO_GETTEXT=Nope NO_TCLTK=Nope\n> \n> The flags to avoid gettext/msgfmt are sadly different between git itself\n> and git-gui/gitk, which we include as a subproject. It would be a useful\n> patch to harmonize though (probably by accepting both in all places for\n> compatibility).\n\nI saw somebody else today run into problems about gettext, so I thought\nI'd revisit this and write that patch. It turns out the situation is\nslightly different than I thought. So no patch, but I wanted to report\nhere what I found.\n\nIt's true that the option is called NO_GETTEXT in git.git, but NO_MSGFMT\nin the tcl programs we pull in. So I figured to start with a patch that\nturns on NO_MSGFMT automatically when NO_GETTEXT is set. But it's\nnot necessary.\n\nThe gitk and git-gui tests actually check that msgfmt is available.\nIf it isn't, they automatically fall back to using a pure-tcl\nimplementation. So there's generally no need to set NO_MSGFMT at\nall.\n\nBut that fallback is implemented using tcl. So if you _also_ don't have\ntcl installed (and I don't), you get quite a confusing output from make:\n\n  $ make -j1 \n    SUBDIR git-gui\n    MSGFMT po/pt_pt.msg Makefile:252: recipe for target 'po/pt_pt.msg' failed\nmake[1]: *** [po/pt_pt.msg] Error 127\n\nIf you run with V=1, you can see that it's not running msgfmt at all,\nbut:\n\n  tclsh po/po2msg.sh --statistics --tcl -l pt_pt -d po/ po/pt_pt.po \n\nSo my takeaways are:\n\n  1. You should never need to set NO_MSGFMT; it falls back\n     automatically.\n\n  2. If you don't have gettext, you should set NO_GETTEXT to tell the\n     rest of git not to use it.\n\n  3. If you see msgfmt errors even after NO_GETTEXT, try NO_TCLTK.\n\n-Peff\n"},{"id":"332351","messageId":"CAP8UFD2gKTourXUdB_9_FZ3AEECTDc1Fx1NFKzeaTZDWHC3jxA@mail.gmail.com","threadId":"46577","inReplyTo":"20171112115725.c2pjhpwpcjeh4xbr@sigill.intra.peff.net","subject":"Re: NO_MSGFMT","fromName":"Christian Couder","fromEmail":"christian.couder@gmail.com","sentAt":"2017-11-12T17:32:11Z","receivedAt":"2017-11-12T17:32:50Z","isPatch":false,"sender":{"key":"christian.couder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/208954?v=4"},"body":"On Sun, Nov 12, 2017 at 12:57 PM, Jeff King <peff@peff.net> wrote:\n> On Sun, Aug 13, 2017 at 12:58:13AM -0400, Jeff King wrote:\n>\n>> On Sat, Aug 12, 2017 at 03:44:17PM +0200, Dominik Mahrer (Teddy) wrote:\n>>\n>> > Hi all\n>> >\n>> > I'm compiling git from source code on a mashine without msgfmt. This leads\n>> > to compile errors. To be able to compile git I created a patch that at least\n>> > works for me:\n>>\n>> Try:\n>>\n>>   make NO_MSGFMT=Nope NO_GETTEXT=Nope\n>>\n>> This also works:\n>>\n>>   make NO_GETTEXT=Nope NO_TCLTK=Nope\n>>\n>> The flags to avoid gettext/msgfmt are sadly different between git itself\n>> and git-gui/gitk, which we include as a subproject. It would be a useful\n>> patch to harmonize though (probably by accepting both in all places for\n>> compatibility).\n>\n> I saw somebody else today run into problems about gettext, so I thought\n> I'd revisit this and write that patch. It turns out the situation is\n> slightly different than I thought. So no patch, but I wanted to report\n> here what I found.\n>\n> It's true that the option is called NO_GETTEXT in git.git, but NO_MSGFMT\n> in the tcl programs we pull in. So I figured to start with a patch that\n> turns on NO_MSGFMT automatically when NO_GETTEXT is set. But it's\n> not necessary.\n>\n> The gitk and git-gui tests actually check that msgfmt is available.\n> If it isn't, they automatically fall back to using a pure-tcl\n> implementation. So there's generally no need to set NO_MSGFMT at\n> all.\n>\n> But that fallback is implemented using tcl. So if you _also_ don't have\n> tcl installed (and I don't), you get quite a confusing output from make:\n>\n>   $ make -j1\n>     SUBDIR git-gui\n>     MSGFMT po/pt_pt.msg Makefile:252: recipe for target 'po/pt_pt.msg' failed\n> make[1]: *** [po/pt_pt.msg] Error 127\n>\n> If you run with V=1, you can see that it's not running msgfmt at all,\n> but:\n>\n>   tclsh po/po2msg.sh --statistics --tcl -l pt_pt -d po/ po/pt_pt.po\n>\n> So my takeaways are:\n>\n>   1. You should never need to set NO_MSGFMT; it falls back\n>      automatically.\n>\n>   2. If you don't have gettext, you should set NO_GETTEXT to tell the\n>      rest of git not to use it.\n>\n>   3. If you see msgfmt errors even after NO_GETTEXT, try NO_TCLTK.\n\nI wonder if something like following patch could help, as anyway the\nbuild will fail if Tcl/Tk is not installed and people often prefer\nbuilds failing at the beginning rather than towards the end.\n\ndiff --git a/Makefile b/Makefile\nindex ee9d5eb11e..9789027739 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -1636,6 +1636,13 @@ ifeq ($(TCLTK_PATH),)\n NO_TCLTK = NoThanks\n endif\n\n+ifndef NO_TCLTK\n+       has_tcltk := $(shell type $(TCLTK_PATH) 2>/dev/null)\n+       ifndef has_tcltk\n+$(error \"Tcl/Tk is not installed ('$(TCLTK_PATH)' not found).\nConsider setting NO_TCLTK or installing it\")\n+       endif\n+endif\n+\n ifeq ($(PERL_PATH),)\n NO_PERL = NoThanks\n endif\n"}]}