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

Re: NO_MSGFMT

From
Jeff King <peff@peff.net>
Date
Nov 12, 2017, 11:57 UTC
Message-ID
<20171112115725.c2pjhpwpcjeh4xbr@sigill.intra.peff.net>
In-Reply-To
<20170813045813.i42mgwn3dmm6u52o@sigill.intra.peff.net>
On Sun, Aug 13, 2017 at 12:58:13AM -0400, Jeff King wrote:
Show 20 quoted lines
> On Sat, Aug 12, 2017 at 03:44:17PM +0200, Dominik Mahrer (Teddy) wrote:
> 
> > Hi all
> > 
> > I'm compiling git from source code on a mashine without msgfmt. This leads
> > to compile errors. To be able to compile git I created a patch that at least
> > works for me:
> 
> Try:
> 
>   make NO_MSGFMT=Nope NO_GETTEXT=Nope
> 
> This also works:
> 
>   make NO_GETTEXT=Nope NO_TCLTK=Nope
> 
> The flags to avoid gettext/msgfmt are sadly different between git itself
> and git-gui/gitk, which we include as a subproject. It would be a useful
> patch to harmonize though (probably by accepting both in all places for
> compatibility).

I saw somebody else today run into problems about gettext, so I thought I'd revisit this and write that patch. It turns out the situation is slightly different than I thought. So no patch, but I wanted to report here what I found.

It's true that the option is called NO_GETTEXT in git.git, but NO_MSGFMT in the tcl programs we pull in. So I figured to start with a patch that turns on NO_MSGFMT automatically when NO_GETTEXT is set. But it's not necessary.

The gitk and git-gui tests actually check that msgfmt is available. If it isn't, they automatically fall back to using a pure-tcl implementation. So there's generally no need to set NO_MSGFMT at all.

But that fallback is implemented using tcl. So if you _also_ don't have tcl installed (and I don't), you get quite a confusing output from make:

  $ make -j1 
    SUBDIR git-gui
    MSGFMT po/pt_pt.msg Makefile:252: recipe for target 'po/pt_pt.msg' failed
make[1]: *** [po/pt_pt.msg] Error 127

If you run with V=1, you can see that it's not running msgfmt at all, but:

  tclsh po/po2msg.sh --statistics --tcl -l pt_pt -d po/ po/pt_pt.po 
So my takeaways are:
  1. You should never need to set NO_MSGFMT; it falls back
     automatically.
  2. If you don't have gettext, you should set NO_GETTEXT to tell the
     rest of git not to use it.
  3. If you see msgfmt errors even after NO_GETTEXT, try NO_TCLTK.
-Peff
Previous: Jeff KingNext: Christian Couder
Message 3 of 4 in “NO_MSGFMT”
  1. Dominik Mahrer (Teddy)Aug 12, 2017
  2. Jeff KingAug 13, 2017
  3. Jeff KingNov 12, 2017
  4. Christian CouderNov 12, 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.