Comparing the exe made without/with renaming the lib/auto/Glib, lib/auto/Gtk2, lib/auto/Pango
Without renaming GLib-GObject-CRITICAL **: g_boxed_type_register_static: assertion `g_type_from_name (name) == 0' failed at C:/strawberry/perl/lib/DynaLoader.pm line 210. cannot register alias Gtk2::Pango::Attribute for the unregistered type (null) at C:/strawberry/perl/lib/DynaLoader.pm line 210. Compilation failed in require at script/simple.pl line 12. BEGIN failed--compilation aborted at script/simple.pl line 12. Adding C:\Users\rappazf\AppData\Local\Temp\par-72617070617a66\cache-4bb65b91bb192b62bf21122f83dfb014a10cbd14 to the path With renaming Can't locate loadable object for module Glib in @INC (@INC contains: C:\Users\rappazf\AppData\Local\Temp\par-72617070617a66\cache-c4da599a70a5b23ad01cab4f5d3b75e95393de36\inc\lib C:\Users\rappazf\AppData\Local\Temp\par-72617070617a66\cache-c4da599a70a5b23ad01cab4f5d3b75e95393de36\inc CODE(0x32a485c) CODE(0x32a4a54)) at C:/strawberry/perl/site/lib/PAR/Heavy.pm line 99. Compilation failed in require at Gtk2.pm line 30. BEGIN failed--compilation aborted at Gtk2.pm line 30. Compilation failed in require at script/simple.pl line 12. BEGIN failed--compilation aborted at script/simple.pl line 12. Adding C:\Users\rappazf\AppData\Local\Temp\par-72617070617a66\cache-c4da599a70a5b23ad01cab4f5d3b75e95393de36 to the path If I run depends.exe with adding the path above for both exe UserDir C:\Users\rappazf\AppData\Local\Temp\... \ UserDir C:\Users\rappazf\AppData\Local\Temp\... \inc\shlib\MSWin32-x86-multi-thread-64int\ depends.exe /oc:out_dwi.txt /d:dwp.txt simple_al2.exe The output shows that 3 system dll are not found, Seems to be the same dll for both exe Status,Module,File Time Stamp,Link Time Stamp,File Size,Attr.,Link Checksum,Real Checksum,CPU,Subsystem,Symbols,Preferred Base,Actual Base,Virtual Size,Load Order,File Ver,Product Ver,Image Ver,Linker Ver,OS Ver,Subsystem Ver ?,"ADVAPI32.DLL","Error opening file. The system cannot find the file specified (2).",,,,,,,,,,,,,,,,,, ?,"KERNEL32.DLL","Error opening file. The system cannot find the file specified (2).",,,,,,,,,,,,,,,,,, ?,"MSVCRT.DLL","Error opening file. The system cannot find the file specified (2).",,,,,,,,,,,,,,,,,, ,"u:\docs\perl\dokpe_i02_dd\SIMPLE_AL2.EXE",2019-02-13 13:13:16,2017-07-07 12:03:24,15977245,A,0x0035BC00,0x00F4BB0D,x86,Console,"None",0x00400000,Unknown,0x0035B000,Not Loaded,0.0.0.0,0.0.0.0,1.0,2.25,4.0,4.0 I’m puzzled by the message “C:\Users\rappazf\AppData\Local\Temp\par-72617070617a66\cache-c4da599a70a5b23ad01cab4f5d3b75e95393de36\inc CODE(0x32a485c) CODE(0x32a4a54)) at” Is the code() correct ? shouldn’t be a path in full ? Thanks for any help. F. From: RAPPAZ Francois via par <par@perl.org> Sent: 13 February 2019 12:22 To: Shawn Laffan <shawnlaf...@gmail.com> Cc: par@perl.org Subject: RE: packing Gtk2 scripts Thanks for the feed back I have summarized my problems here https://www.perlmonks.org/?node_id=1229858 and from Rob’s answer I conclude that there would be no point in installing the Gtk2 stack from his sisyphusion site. I’m puzzled that you don’t need to add any of Glib.dll etc in your packing process. When you say add x to the path, it’s the windows path you mean ? something around set PATH =%PATH%;xxx before running dep walker And to use dependency walker when my simple.exe is running, it is this file that I should load in it ? François From: Shawn Laffan <shawnlaf...@gmail.com<mailto:shawnlaf...@gmail.com>> Sent: 13 February 2019 09:26 To: RAPPAZ Francois <francois.rap...@unifr.ch<mailto:francois.rap...@unifr.ch>> Cc: par@perl.org<mailto:par@perl.org> Subject: Re: packing Gtk2 scripts That code packs and runs without issue on my machine. For comparison, I have Strawberry perl 5.28.0 (PDL version), and have installed Gtk2, Glib etc from the PPMs at http://sisyphusion.tk/ppmindex.html Maybe try Dependency Walker on C:\Users\rappazf\AppData\Local\Temp\par-72617070617a66\cache-273ef9b6a6b7e348eadc78be91c5b75711cfe242\778ce824.xs.dll to see what it is expecting to load, and how far it gets. Make sure to add C:\Users\rappazf\AppData\Local\Temp\par-72617070617a66\cache-273ef9b6a6b7e348eadc78be91c5b75711cfe242\ to the search path so it finds the perl dll (and maybe also the "inc\shlib\MSWin32-x64-multi-thread" folder). Having both paths in this analysis might confuse the issue if the PAR error is a search path problem, but at the least you will see what is expected. http://www.dependencywalker.com/ Shawn. On Wed, 13 Feb 2019 at 17:20, RAPPAZ Francois <francois.rap...@unifr.ch<mailto:francois.rap...@unifr.ch>> wrote: So, now simple.pl<http://simple.pl> is use strict; use warnings; BEGIN { if ($ENV{PAR_0}) { print "Adding $ENV{PAR_TEMP} to the path"; use Config; $ENV{PATH} .= "$Config{path_sep}$ENV{PAR_TEMP}"; } }; use Gtk2 '-init'; use Glib qw/TRUE FALSE/; my $window = Gtk2::Window->new; $window->signal_connect (destroy => sub { Gtk2->main_quit; }); $window->show_all(); Gtk2->main; Running perl pp_autolink.pl<http://pp_autolink.pl> -o simple.exe simple.pl<http://simple.pl> and then simple.exe gives Can't load 'C:\Users\rappazf\AppData\Local\Temp\par-72617070617a66\cache-273ef9b6a6b7e348eadc78be91c5b75711cfe242\778ce824.xs.dll' for module Pango: load_file:The specified module could not be found at C:/strawberry/perl/lib/DynaLoader.pm line 193. … Compilation failed in require at Gtk2.pm line 31. BEGIN failed--compilation aborted at Gtk2.pm line 31. Compilation failed in require at script/simple.pl<http://simple.pl> line 11. BEGIN failed--compilation aborted at script/simple.pl<http://simple.pl> line 11. Adding C:\Users\rappazf\AppData\Local\Temp\par-72617070617a66\cache-273ef9b6a6b7e348eadc78be91c5b75711cfe242 to the path François From: Shawn Laffan <shawnlaf...@gmail.com<mailto:shawnlaf...@gmail.com>> Sent: 13 February 2019 01:20 To: RAPPAZ Francois <francois.rap...@unifr.ch<mailto:francois.rap...@unifr.ch>> Cc: par@perl.org<mailto:par@perl.org>; Roderich Schupp <roderich.sch...@gmail.com<mailto:roderich.sch...@gmail.com>> Subject: Re: packing Gtk2 scripts I can replicate the errors using a cut-down script Francois provided, and which I stripped further to only use Glib. I used Dependency Walker to check the hierarchy and pp_autolink is packing all the needed dlls. I then checked my own (working) code, and it adds the PAR_TEMP folder to the path before loading Glib. Francois - can you add the begin block from the code below to your script and test if it works? If it does then maybe PAR_TEMP should be appended to the path by PAR, but that's Roderich's call. Regards, Shawn. use strict; use warnings; BEGIN { if ($ENV{PAR_0}) { print "Adding $ENV{PAR_TEMP} to the path"; use Config; $ENV{PATH} .= "$Config{path_sep}$ENV{PAR_TEMP}"; } }; use Glib; print "1\n"; On Tue, 12 Feb 2019 at 20:46, RAPPAZ Francois via par <par@perl.org<mailto:par@perl.org>> wrote: Hi there Roderich, some years ago was explaining why, once the lib/auto/Glib …/Gtk2 had been hidden with renaming them in the par archive, running the exe made with pp worked for a script using Gtk2: “Every DLL you add to the packed executable with "pp -l ..." is flatly packed in the zip in directory shlib/ARCH and unconditionally extracted in the cache area. Also the packed executable runs with the cache directory prepended to PATH. So when asked to load the glue DLL for Gtk2.pm etc, DyneLoader loads Gtk2.dll from the cache directory. That way we get rid of the second copy of the DLLs (extracted and loaded with mangled names) and inter-DLL symbol references work as expected. » On my pc (with a new perl set up), this recipe does not seems to work anymore. Moreover, my folders in perl/site/lib/auto/Glib, …/Gtk2 …/Pango, …/Cairo did not have corresponding glue dll Glib.dll, Gtk2.dll and so on, even if these Gtk2 scripts are running fine from perl without these. So why are these dll been needed after all ? I have found these glue dll in my c:/users/rappazf/AppData …. Folders from the unpacking of previous par archives and placed these in a separate folder c:/docs/perl_dll I have then include these in the par archive with –link, but the exe is still crashing. should I select others dll files from these …lib/auto/… to be included with link ? how can I select the correct one ? I tried to pack a 10 lines long script with using pp –x but once open, the gtk window seems to block pp. Closing the window gives the control back to pp but the resulting exe failed the same. Thanks for any comment François