GNOME Bugzilla – Bug 159846
make dist fails in builddir/po/ if builddir != srcdir
Last modified: 2005-01-21 21:44:58 UTC
Trying to make dist in epiphany with a builddir != srcdir setup, make dist fails in builddir/po/ with this error: INTLTOOL_EXTRACT=../intltool-extract ../intltool-update --gettext-package epiphany --pot intltool-update: POTFILES.in not found. (Intltool cvs HEAD from 2004-11-29, automake 1.9, autoconf 2.59, epiphany HEAD). If I do "intltool-update --pot" in srcdir/po, make dist succeeds in builddir/po, so I don't think this is the same as bug 69947. Looking at intltool-update, it does $SRCDIR = $ENV{"srcdir"} if $ENV{"srcdir"}; $POTFILES_in = "<$SRCDIR/POTFILES.in"; so apparently it expects make to set srcdir env var, but that env var isn't set. If I do srcdir=../.. make dist, intltool-update fails with /usr/bin/xgettext: error while opening "../../po/../embed/downloader-view.c" for reading: No such file or directory but ../../po/../embed/downloader-view.c does exist.
How are you setting builddir != srcdir? Doing "builddir=./foo make dist" doesn't do anything special that I can tell.
Rodney, it's probably doing: $ mkdir ~/tmp/epi && cd ~/tmp/epi $ /path/to/cvs/epiphany/autogen.sh That's how I can reproduce this. Instead of running entire "make dist", it's enough that you do "cd po && make epiphany.pot" afterwards.
OK. I got a builddir != srcdir environment set up for testing. However, make dist seems to work fine for me. It's distcheck that fails. And it's failing because it can't find one of the files listed in POTFILES, rather than not finding POTFILES.in.
Rodney, make sure you remove epiphany.pot from epiphany/po/epiphany.pot (original CVS source) before trying this. I actually reproduced this, and it seems the problem is the following. intltool-update puts into POTFILES.in.temp files with path relative to top_builddir, except in some cases where it puts files relative to top_builddir/po (or rather, current directory): this happens with srcdir set to PO directory of the srcdir (see below). So, I added srcdir=$(srcdir) to MSGMERGE and GENPOT rules in Makefile.in.in (from intltool), which gets me past POTFILES.in not found. But, because of this, resulting POTFILES.in.temp looks like data/GNOME_Epiphany_Automation.server.in.h data/bme.desktop.in.h ... ../../epiphany/po/../embed/downloader-view.c ../../epiphany/po/../embed/ephy-encodings.c (first are generated files). I have managed to go around this by passing --directory=. instead of --directory=.. to xgettext (look at @xgettext_argument), and outputting ../ for generated file names as well (around line 654). Here're the patches inline (I'm not sure if they're the best way out, but since we need path direct to POTFILES.in, we can only introduce another variable and pass top_srcdir using that if we want to keep current xgettext parameters and POTFILE.in.temp format the same): --- intltool-update~ 2004-11-29 18:20:00.000000000 +0100 +++ intltool-update 2004-11-29 18:27:18.000000000 +0100 @@ -651,7 +651,7 @@ elsif (/\.($xml_support|$ini_support)$/ || /^\[/) { s/^\[.*]\s*//; - print OUTFILE "$_.h\n"; + print OUTFILE "../$_.h\n"; push @temp_headers, "../$_.h"; $gettext_code = &TextFile_DetermineEncoding ("../$_.h") if ($gettext_support_nonascii and not defined $forced_gettext_code); } @@ -703,7 +703,7 @@ unlink "$MODULE.pot"; my @xgettext_argument=("$XGETTEXT", "--add-comments", - "--directory\=\.\.", + "--directory\=\.", "--output\=$MODULE\.pot", "--files-from\=\.\/POTFILES\.in\.temp"); my $XGETTEXT_KEYWORDS = &FindPOTKeywords; --- Makefile.in.in~ 2004-11-28 12:35:09.000000000 +0100 +++ Makefile.in.in 2004-11-29 18:20:32.000000000 +0100 @@ -46,8 +46,8 @@ XGETTEXT = @XGETTEXT@ INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ -MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist -GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot +MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist +GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) srcdir=$(srcdir) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot DEFS = @DEFS@ CFLAGS = @CFLAGS@
Comment 2 correctly details the steps to build out of srcdir. Re comment 3, it's important that srcdir/po/epiphany.pot does NOT exist. I couldn't get the patch in comment 4 to apply, so I can't test it -- could you attach it please?
Created attachment 34474 [details] [review] Put path relative to po/ subdirectory in POTFILES.in.temp Sure, here it goes. Sorry for not doing it right away, I was a bit lazy, and only four lines are changed after all. :)
Thanks. I can confirm that the patch fixes the "make epiphany.pot" problem in builddir/po. However, there are still problems with make dist in builddir/po: * updating the gettext files fails: intltool-update: epiphany.pot does not exist. msgmerge for am.gmo failed! [same for all linguas] * at the end of make dist in builddir/po, I get for file in $dists; do \ ln ../../po/$file ../epiphany-1.5.2.90/po 2> /dev/null \ || cp -p ../../po/$file ../epiphany-1.5.2.90/po; \ done cp: cannot stat `../../po/epiphany.pot': No such file or directory (epiphany.pot is in builddir/po, not in srcdir/po)
OK. Well, I'm confirming the bug now. And hopefully I'll get time to look at Danilo's patch more closely and see if I can't fix the whole problem, this weekend.
Created attachment 36320 [details] [review] Patch to fix builddir != srcdir issues This patch obsoletes the previous patch from Danilo by fixing more problems. One of the issues seems to be that we were supposed to be rming $(GETTEXT_PACKAGE).pot, but there was a typo, so it didn't get removed, and we were also trying to dist the file. Since the file gets generated in builddir, and the other disted files all come from srcdir, this posed some other problems. I've tested this patch with a simple piece of code i've started working on, and both make dist and distcheck work from the builddir. Can someone please test this patch so that I can commit it tonight, and get a new release out soon? Thanks.
Created attachment 36321 [details] [review] New revision of previous patch to fix more issues Here is an updated version of the patch that fixes some more issues that were found after the previous patch was made. This patch fixes intltool to work correctly when doing make dist and distcheck for when builddir != srcdir, and when builddir == srcdir as well. The previous patch fixed the former, but also broke the latter. As a consequence of this patch, update-po is no longer done at dist time. This means that when people do make dist, and then commit, po files will not be updated. I think I will mail desktop-devel-list about this before committing, but in general, I think the i18n people will be happy with it. :)
Well. Nobody has replied to my mail after several hours, so I've committed this now. Yay me.