Bug 50630

Summary: packimages: images not found
Product: LibreOffice Reporter: Korrawit Pruegsanusak <detective.conan.1412>
Component: LibreofficeAssignee: David Tardon <dtardon>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: medium CC: dtardon, LibreOffice
Version: Master old -3.6   
Hardware: All   
OS: All   
Whiteboard: target:3.6.0.0.beta1
i915 platform: i915 features:
Attachments: screenshot showing localhelp file missing image

Description Korrawit Pruegsanusak 2012-06-03 02:44:34 UTC
Taken from http://nabble.documentfoundation.org/packimages-many-files-not-found-td3677146.html

From a tinderbox success build log <http://tinderbox.libreoffice.org/cgi-bin/gunzip.cgi?tree=MASTER&brief-log=1327111210.13104> of master branch, we have these errors:

packimages: file ´/Volumes/Raid0/core/icon-themes/galaxy/res/addresspilot.png´ not found
packimages: file ´/Volumes/Raid0/core/icon-themes/galaxy/scanner/handle.png´ not found
packimages: file ´/Volumes/Raid0/core/icon-themes/galaxy/scanner/minus.png´ not found
packimages: file ´/Volumes/Raid0/core/icon-themes/galaxy/scanner/plus.png´ not found
packimages: file ´/Volumes/Raid0/core/icon-themes/galaxy/ui/onlineupdate_16.png´ not found
packimages: file ´/Volumes/Raid0/core/icon-themes/galaxy/ui/onlineupdate_26.png´ not found

The correct path to files should be:

icon-themes/galaxy/extensions/res/addresspilot.png -- missing extensions/
icon-themes/galaxy/extensions/source/scanner/* -- missing extensions/source/
icon-themes/galaxy/extensions/source/update/ui/* -- missing extensions/source/update/

And checking in the images.zip after finished building, these images are not found in the archive.

More investigation coming ...
Comment 1 Korrawit Pruegsanusak 2012-06-03 02:53:09 UTC
The packimages.pl script is called from packimages/CustomTarget_images.mk line 41 <http://opengrok.libreoffice.org/xref/core/packimages/CustomTarget_images.mk#41>

It reads image list from $(OUTDIR)/res/img which contains lots of *.ilst files

The problematic files in $(OUTDIR)/res/img/:

* abpen-US.ilst: %MODULE%\res\addresspilot.png

* scnen-US.ilst: %MODULE%\scanner\handle.png, %MODULE%\scanner\plus.png, %MODULE%\scanner\minus.png

* updchken-US.ilst: %MODULE%\ui\onlineupdate_16.png, %MODULE%\ui\onlineupdate_26.png
Comment 2 Korrawit Pruegsanusak 2012-06-03 03:23:02 UTC
These *ilst files come from "Resource Compiler" in $(OUTDIR)/bin/rsc.exe, which compiled from rsc/source/rsc/rsc.cxx

And *ilst files come in `make extensions`:
> [ build RES ] abpen-US    <<< problematic
> [ build RES ] biben-US
> [ build RES ] dbpen-US
> [ build RES ] pcren-US
> [ build RES ] scnen-US    <<< problematic
> [ build RES ] upden-US
> [ build RES ] updchken-US <<< problematic

which invoke the AllLangResTarget.mk line 326 <http://opengrok.libreoffice.org/xref/core/solenv/gbuild/AllLangResTarget.mk#326>

The point which create problem is the parameter -subMODULE (line 344) -- it is
> -subMODULE=$S/icon-themes/galaxy/extensions/

This will make aSearch in rsc.cxx line 1095 to be
> d:\libo\icon-themes\galaxy\extensions
and aSearchIn (line 1096) to be
> d:\libo\icon-themes\galaxy\extensions\res\addresspilot.png

The next code is to make a tailing string of aSearchIn from aSearch, ie you get rImagePath (line 1108, 1126) as
> res/addresspilot.png

and then it will be transformed to be
> %MODULE%\res\addresspilot.png
as in abpen-US.ilst
Comment 3 Korrawit Pruegsanusak 2012-06-03 03:40:44 UTC
So, how this come?
> The point which create problem is the parameter -subMODULE (line 344) -- it is
> > -subMODULE=$S/icon-themes/galaxy/extensions/
> 
> This will make aSearch in rsc.cxx line 1095 to be
> > d:\libo\icon-themes\galaxy\extensions

it comes from rsc.cxx line 174-187, m_aReplacements will have a ::std::pair of
> "MODULE" => "d:\libo\icon-themes\galaxy\extensions"

then, line 1095 will get the second element of this pair into aSearch.


If I try replacing
> -subMODULE=$S/icon-themes/galaxy/extensions/
with
> -subMODULE=$S/icon-themes/galaxy/

in the command line invoking, this solves the problem.


Back to AllLangResTarget.mk line 344,
> -subMODULE=$(dir $(gb_ResTarget_DEFIMAGESLOCATION)$(RESLOCATION)) \

the $(RESLOCATION) is "extensions/"

I'm not sure if we can remove $(RESLOCATION) or not.


Comparing with another non-problematic files:
[ build RES ] biben-US use -subMODULE= (blank)
[ build RES ] pcren-US use -subMODULE=$S/icon-themes/galaxy/


Any idea how to fix this bug? Thanks!
Comment 4 David Tardon 2012-06-04 01:22:26 UTC
The definition of -subMODULE in AllLangResTarget.mk was changed as fix for https://issues.apache.org/ooo/show_bug.cgi?id=116298 , but I do not even understand what that bug is supposed to be about... Anyway, I think it is wrong.
Comment 5 Korrawit Pruegsanusak 2012-06-04 01:47:56 UTC
Thanks for the information.

Anyway, is this bug really FIXED?
If you apply this patch (generated on old master, sorry), you will see the warning for missing images.

diff --git a/solenv/bin/packimages.pl b/solenv/bin/packimages.pl
index 12eb3ea..1cd6a04 100755
--- a/solenv/bin/packimages.pl
+++ b/solenv/bin/packimages.pl
@@ -362,7 +362,7 @@ sub create_zip_archive
                 print_error("can't add file '$path' to image zip archive: $!", 5);
             }
         } else {
-                print_message("file '$path' not found");
+                print_warning("file '$path' not found");
         }
     }
     my $status = $zip->writeToFileNamed($tmp_out_file);
Comment 6 Korrawit Pruegsanusak 2012-06-04 02:03:44 UTC
Created attachment 62492 [details]
screenshot showing localhelp file missing image

Also, testing with official Alpha 1 release, on Windows XP, will show you that the images are still missing.

Steps:
1. Install libo and local helppack
2. Help > LODev Help
3. Index > "updates;checking manually"
4. See the missing image as attached screenshot (compare with 3.5.3)

5. Searching in path-to-install/share/config/images*.zip/extensions/res/, the images listed in comment 0 are not found.
Comment 7 Not Assigned 2012-06-04 05:41:37 UTC
David Tardon committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=52cd118b4e460787059aeab90bdbe5bc9ef33cbd

fdo#50630 set correct path to images' module dir
Comment 8 Not Assigned 2012-06-04 08:18:19 UTC
Korrawit Pruegsanusak committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5d1ea0b2253d9d09aad96f0b6b0251d20d063856

related fdo#50630: use print_warning when image not found
Comment 9 David Tardon 2012-06-04 21:39:17 UTC
> Anyway, is this bug really FIXED?
> If you apply this patch (generated on old master, sorry), you will see the
> warning for missing images.

RESOLVED/FIXED status in bugzilla does not necessarily mean the fix has been pushed to master already. You should have some patience.

> Created attachment 62492 [details]
> screenshot showing localhelp file missing image
> 
> Also, testing with official Alpha 1 release, on Windows XP, will show you that
> the images are still missing.

Alpha 1 was built several days ago. Sorry, but I am not able to apply a patch retroactively.
Comment 10 Korrawit Pruegsanusak 2012-06-04 23:20:16 UTC
Sorry :-( and thanks for the fix.
Comment 11 Korrawit Pruegsanusak 2012-06-06 02:23:15 UTC
VIRIFIED on Windows XP with build from tinderbox Win-x86@6-fast, pull
time 2012-06-05 23:16:58, core: b255de87082d11a42d7af7860dcc4e971342df0

Thanks again :)
Comment 12 Rainer Bielefeld Retired 2012-08-03 09:21:33 UTC
We need exact and correct target information for automated lists in Wiki and LibO Web Site.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.