Bug 593175 - Temporary .xml2po.mo file breaks parallel builds
Temporary .xml2po.mo file breaks parallel builds
Status: RESOLVED FIXED
Product: xml2po
Classification: Other
Component: general
HEAD
Other Linux
: Normal normal
: ---
Assigned To: Danilo Segan
Danilo Segan
:
: 606282 (view as bug list)
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2009-08-26 14:59 UTC by Shaun McCance
Modified: 2010-01-07 21:14 UTC (History)
4 users (show)

See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to replace .xml2po.mo by a system temp file (4.68 KB, patch)
2009-09-14 20:24 UTC, Claude Paroz
none Details | Diff | Review
Fixed patch (3.65 KB, patch)
2009-09-14 20:34 UTC, Claude Paroz
committed Details | Diff | Review

Description Shaun McCance 2009-08-26 14:59:10 UTC
xml2po creates a temporary file .xml2po.mo when it merges a translation.  This breaks parallel builds, because the various translation merging processes clobber each other's temporary files.
Comment 1 Claude Paroz 2009-09-14 20:21:39 UTC
I'm considering removing the fixed .xml2po.mo temp file, replacing it with a system generated temp file. But I wonder if the .xml2po.mo is used as a cached mo file elsewhere in gnome-doc-utils. Shaunm, do you know that?
Comment 2 Claude Paroz 2009-09-14 20:24:26 UTC
Created attachment 143192 [details] [review]
Patch to replace .xml2po.mo by a system temp file 

Here is the patch, if you want to take a look.
Comment 3 Claude Paroz 2009-09-14 20:34:51 UTC
Created attachment 143193 [details] [review]
Fixed patch

The previous patch would delete the file passed in the -t argument. Not nice.
Comment 4 jfding 2009-10-14 08:59:50 UTC
I have encountered just the same problem in moblin building. Also I have prepared another similar patch for xml2po to avoid it.
Just for reminding, I noticed you haven't patched tools/gnome-doc-utils.make to clean up the tmp .mo files.
I do it like this:
diff --git a/tools/gnome-doc-utils.make b/tools/gnome-doc-utils.make
index ec8f698..cb7c662 100644
--- a/tools/gnome-doc-utils.make
+++ b/tools/gnome-doc-utils.make
@@ -393,9 +393,9 @@ clean-doc-lc:
 	  fi; \
 	done
 	@for lc in C $(_DOC_REAL_LINGUAS); do \
-	  if test -f "$$lc/.xml2po.mo"; then \
-	    echo "rm -f $$lc/.xml2po.mo"; \
-	    rm -f "$$lc/.xml2po.mo"; \
+	  if test -f "$$lc/.tmp*.xml2po.mo"; then \
+	    echo "rm -f $$lc/.tmp*.xml2po.mo"; \
+	    rm -f "$$lc/.tmp*.xml2po.mo"; \
 	  fi; \
 	done
 clean-doc-dir: clean-doc-lc
Comment 5 Claude Paroz 2009-10-14 09:15:05 UTC
I don't really understand your gnome-doc-utils.make change. In my patch, xml2po itself is caring for temporary file deletion:
+    if mofile_tmppath:
+        os.remove(mofile_tmppath)
Comment 6 jfding 2009-10-14 10:40:17 UTC
(In reply to comment #5)
> I don't really understand your gnome-doc-utils.make change. In my patch, xml2po
> itself is caring for temporary file deletion:
> +    if mofile_tmppath:
> +        os.remove(mofile_tmppath)

Sorry, I haven't describe it clearly. I means there's sth. related temp .xml2po.mo in gnome-doc-utils.make need to be modified. In my way, the created temp files will be in current dir, as the origin .xml2po.mo. In your patch, all the temp files will be in /tmp and will be cleaned, but maybe gnome-doc-utils.make still need some modification: e.g. removing the lines related .xml2po.mo.
Comment 7 Claude Paroz 2009-10-14 11:27:52 UTC
Yes, that section which cleans temp files in gnome-doc-utils.make could be removed. But I'd rather make it in a later revision, as there still might be some leftover .xml2po.mo files from older gnome-doc-utils.
Comment 8 jfding 2009-10-15 03:00:00 UTC
(In reply to comment #7)
> Yes, that section which cleans temp files in gnome-doc-utils.make could be
> removed. But I'd rather make it in a later revision, as there still might be
> some leftover .xml2po.mo files from older gnome-doc-utils.

Agree.

BTW. I am waiting for approval of your patch, and integration to release, then I can drop my local patch:)
Comment 9 Claude Paroz 2009-10-15 19:29:12 UTC
Comment on attachment 143193 [details] [review]
Fixed patch

Auto-approved :-P
Hopefully it's a good fix.
Comment 10 Claude Paroz 2010-01-07 21:14:37 UTC
*** Bug 606282 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.