GNOME Bugzilla – Bug 593175
Temporary .xml2po.mo file breaks parallel builds
Last modified: 2019-03-25 23:13:27 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.
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?
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.
Created attachment 143193 [details] [review] Fixed patch The previous patch would delete the file passed in the -t argument. Not nice.
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
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)
(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.
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.
(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 on attachment 143193 [details] [review] Fixed patch Auto-approved :-P Hopefully it's a good fix.
*** Bug 606282 has been marked as a duplicate of this bug. ***