Skip Menu |
 

This queue is for tickets about the PAR CPAN distribution.

Report information
The Basics
Id: 13508
Status: open
Priority: 0/
Queue: PAR

People
Owner: Nobody in particular
Requestors: schmorp [...] schmorp.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Date: Sat, 2 Jul 2005 03:23:49 +0200
From: Marc Lehmann <schmorp [...] schmorp.de>
To: bug-par [...] rt.cpan.org
Subject: cannot find Glib.dll on win32, despite being packaged in the exe
Download (untitled) / with headers
text/plain 1.3k
Hi! I am trying to par-package a perl script trhat uses Glib/Gtk2 on windows, with activestate perl. The problem is, the .exe always complains about missing Glib.dll (the perl interface to libglib). When I add the directory containing Glib.dll, all it's file are added, but not Glib.dll. However, Glib.dll is actually part of the generated .exe, but it is renamed to "af084d9e.dll" (which is probably on purpose). The same happened to all other dlls, such as libgobject, libgtk and so on. Now, the obvious question is, how do I make it work, so that Glib.pm/DynaLoader finds Glib.dll, and Glib.dll finds all it's dependend dlls? I use activestate perl 5.8.7, Perl Packager, version 0.12 (PAR version 0.89). The command to invoke pp was: /perl/bin/perl /perl/bin/pp -o kgsueme.exe -a /gtk2/bin --gui -x kgsueme where /gtk2/bin contains all the dlls required to run. I'd be thankful for any insights, but this problem is not of high priority even for me, so feel free to ignore me :) If you need more info, I'd be happy to provide what I can. Greetings, -- The choice of a -----==- _GNU_ ----==-- _ generation Marc Lehmann ---==---(_)__ __ ____ __ pcg@goof.com --==---/ / _ \/ // /\ \/ / http://schmorp.de/ -=====/_/_//_/\_,_/ /_/\_\ XX11-RIPE
Download (untitled) / with headers
text/plain 1.3k
On Fr. 01. Jul. 2005, 21:24:16, schmorp@schmorp.de wrote: Show quoted text
> I am trying to par-package a perl script trhat uses Glib/Gtk2 on > windows, > with activestate perl. > > The problem is, the .exe always complains about missing Glib.dll (the > perl > interface to libglib). When I add the directory containing Glib.dll, > all > it's file are added, but not Glib.dll. > > However, Glib.dll is actually part of the generated .exe, but it is > renamed to "af084d9e.dll" (which is probably on purpose). > > The same happened to all other dlls, such as libgobject, libgtk and so > on. > > Now, the obvious question is, how do I make it work, so that > Glib.pm/DynaLoader finds Glib.dll, and Glib.dll finds all it's > dependend > dlls? > > I use activestate perl 5.8.7, Perl Packager, version 0.12 (PAR version > 0.89). > > The command to invoke pp was: > > /perl/bin/perl /perl/bin/pp -o kgsueme.exe -a /gtk2/bin --gui -x > kgsueme > > where /gtk2/bin contains all the dlls required to run. > > I'd be thankful for any insights, but this problem is not of high > priority > even for me, so feel free to ignore me :) > > If you need more info, I'd be happy to provide what I can.
Hi Marc, packaging additional shared libraries into .par's or pp-ed binaries should be done with -l. You can't package a complete directory as far as I know. HTH, Steffen P.S.: Sorry for the extremely belated reply.
CC: par [...] perl.org
Subject: Re: [rt.cpan.org #13508] cannot find Glib.dll on win32, despite being packaged in the exe
Date: Thu, 31 Aug 2006 21:13:45 +0200
To: Steffen Müller via RT <bug-PAR [...] rt.cpan.org>
From: Marc Lehmann <schmorp [...] schmorp.de>
Download (untitled) / with headers
text/plain 1.4k
On Thu, Aug 31, 2006 at 07:29:05AM -0400, Steffen Müller via RT <bug-PAR@rt.cpan.org> wrote: Show quoted text
> > If you need more info, I'd be happy to provide what I can.
> > Hi Marc, > > packaging additional shared libraries into .par's or pp-ed binaries > should be done with -l. You can't package a complete directory as far as > I know.
I am not packaging *additional shared libraries*, I am packaging a perl module. Glib.dll is the perl inetrface to libglib. Also, Glib.dll *is* being packaged automatically by par, the problem is that par renames it to some gibberish file (as I already explained). -l is certainly not going to help as PAR does not load Glib.dll but its own renamed version of it. packaging Glib.dll in addition will clash with the version par itself packaged. This is a bug in par, and cannot be solved with commandline switches. Show quoted text
> P.S.: Sorry for the extremely belated reply.
Yeah, and on top of that thanks for completely ignoring my bug report and simply closing it without reading it and cetrainly without resolving it :/ If you don't understand something, feel free to aks. But please don't just blindly close completely valid und unresolved bugs! -- The choice of a -----==- _GNU_ ----==-- _ generation Marc Lehmann ---==---(_)__ __ ____ __ pcg@goof.com --==---/ / _ \/ // /\ \/ / http://schmorp.de/ -=====/_/_//_/\_,_/ /_/\_\ XX11-RIPE
Download (untitled) / with headers
text/plain 2.4k
On Do. 31. Aug. 2006, 15:14:05, schmorp@schmorp.de wrote: Show quoted text
> On Thu, Aug 31, 2006 at 07:29:05AM -0400, Steffen Müller via RT <bug- > PAR@rt.cpan.org> wrote:
> > Hi Marc, > > > > packaging additional shared libraries into .par's or pp-ed binaries > > should be done with -l. You can't package a complete directory as
> far as
> > I know.
> > I am not packaging *additional shared libraries*, I am packaging a > perl > module. Glib.dll is the perl inetrface to libglib.
Right. Sorry, I missed that. Show quoted text
> Also, Glib.dll *is* being packaged automatically by par, the problem > is > that par renames it to some gibberish file (as I already explained).
FYI, that's because the dlls for various dependencies might clash. Show quoted text
> -l is certainly not going to help as PAR does not load Glib.dll but > its own > renamed version of it. packaging Glib.dll in addition will clash with > the > version par itself packaged.
Certainly... Have you tried? -l makes sure the name is retained because some dlls use other dlls and PAR can't intercept and mangle the name. Show quoted text
> This is a bug in par, and cannot be solved with commandline switches.
Possibly. Or: http://mail.gnome.org/archives/gtk-perl-list/2005-April/msg00187.html Now, I know there is a difference between what that guy had problems with (gtk+) and what you have problems with (Glib.dll as part of a CPAN module). Show quoted text
> > P.S.: Sorry for the extremely belated reply.
> > Yeah, and on top of that thanks for completely ignoring my bug report > and > simply closing it without reading it and cetrainly without resolving > it :/
Dare accuse me of not reading things and ignorance. Misreading is a different thing. And usually an honest mistake. Which was the case here. Show quoted text
> If you don't understand something, feel free to aks. But please don't > just > blindly close completely valid und unresolved bugs!
Which are readily reopened by a reply. If I ask (which you suggested I do) and you answer, the ticket's reopened. If you don't answer, a ticket which I can't work on without the answer isn't valid. Now, no, I didn't ask. But that's the reason I got into the habit of not waiting for a reply before closing old tickets. (And the same logic readily applies if I wrongfully think the problem should be solved with command line options.) On an unrelated note, if you are so inclined, retry using PAR 0.952 which might have a slightly different way of handling dlls. When answering, always keep in mind that the one you are answering to is also working on this in his spare time, so let's keep the tone down. Thank you.
CC: par [...] perl.org
Subject: Re: [rt.cpan.org #13508] cannot find Glib.dll on win32, despite being packaged in the exe
Date: Fri, 1 Sep 2006 11:53:07 +0200
To: Steffen Müller via RT <bug-PAR [...] rt.cpan.org>
From: Marc Lehmann <schmorp [...] schmorp.de>
Download (untitled) / with headers
text/plain 3.9k
On Thu, Aug 31, 2006 at 03:46:37PM -0400, Steffen Müller via RT <bug-PAR@rt.cpan.org> wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=13508 > >
> > that par renames it to some gibberish file (as I already explained).
> > FYI, that's because the dlls for various dependencies might clash.
Well, they don't on the system where it is being packaged, so this is eitehr a bug or a limittaion in par that could be solved (e..g by not putting everything into a flat hierarchy and relying on the normla perl mechanism). Show quoted text
> > -l is certainly not going to help as PAR does not load Glib.dll but
> > Certainly... Have you tried? -l makes sure the name is retained because
Yes, that was the first thing I tried. It still loaded the <hash>.dll instead of Glin.dll. Show quoted text
> Possibly. Or: > http://mail.gnome.org/archives/gtk-perl-list/2005-April/msg00187.html > Now, I know there is a difference between what that guy had problems > with (gtk+) and what you have problems with (Glib.dll as part of a CPAN > module).
Right, I am the only one who managed to package gtk+ with perl on windows so far, to my knowledge, and I had to work around some other par bugs (such as adding its own defective entry to @INC _multiple_ times during program execution) but thats not the actual problem. The actual problem is and stays that par (version 1.52) does not correctly package perl modules using xs and shared objects. In case it matters, here is what I do a as workaround: 1. par keeps alot of crust in @INC leading to clashes if a user has a different but incompatible pelr installed: @INC = grep ref, @INC; # weed out all paths except pars loader refs 2. I pre-push my own libdir in @INC, both at BEGIN time as well as on main program start, because par pushes its own handler in front of it. 3. I manually package all Glib and gtk2-module related files into my own hierarchy. No @INC handler required, no renaming required, simply works. Show quoted text
> ask. But that's the reason I got into the habit of not waiting for a > reply before closing old tickets. (And the same logic readily applies if > I wrongfully think the problem should be solved with command line options.)
A bad habit, but no permanent harm was done. Your behaviour is frustrating to those who invest a lot of time investigating and openign bug reports. Many people I know don't have the stamina to reopen bug reports, especially if they aren't bold enough to know that they know the problem better than the ones caring for bug reports: It should be the opposite. Show quoted text
> On an unrelated note, if you are so inclined, retry using PAR 0.952 > which might have a slightly different way of handling dlls.
I will, although I can't say when, but as soon as I can. Show quoted text
> When answering, always keep in mind that the one you are answering to is > also working on this in his spare time, so let's keep the tone down.
If you don't care about fixing par then you are free to ignore bug reports. If you don't like the tone and this is the reason for not fixing bugs, then par stays as bad a product as it is. It might be that that is fine to you, and me, and everybody else, or might be a bad state of affairs. Its not my choice to make. Remember that its my spare time, too, and I invested far more time on this problem than you, giving a detailed bug report and being open to explain more if need be. I was not asking you to invest your spare time - you either give it, or if you don't want to give it, stay out of bug business. The only thing I ask is to not suppress valid bug reports (I am not saying that this is case here, of course!). If you don't honor this either and think its ok to frustrate people investing _their_ time to help, you might just as well ignore any bug reports. Thank you for investing your time. -- The choice of a -----==- _GNU_ ----==-- _ generation Marc Lehmann ---==---(_)__ __ ____ __ pcg@goof.com --==---/ / _ \/ // /\ \/ / http://schmorp.de/ -=====/_/_//_/\_,_/ /_/\_\ XX11-RIPE
CC: mlehmann [...] cpan.org
Subject: Re: [rt.cpan.org #13508] cannot find Glib.dll on win32, despite being packaged in the exe
Date: Fri, 1 Sep 2006 20:31:53 +0800
To: bug-PAR [...] rt.cpan.org
From: "Audrey Tang" <audreyt.org [...] gmail.com>
2006/9/1, Marc Lehmann via RT <bug-PAR@rt.cpan.org>: Show quoted text
> Right, I am the only one who managed to package gtk+ with perl on windows > so far, to my knowledge, and I had to work around some other par bugs > (such as adding its own defective entry to @INC _multiple_ times during > program execution) but thats not the actual problem.
Hi Marc! First, I've send you a commit bit for http://svn.openfoundry.org/par/. :-) Show quoted text
> > On an unrelated note, if you are so inclined, retry using PAR 0.952 > > which might have a slightly different way of handling dlls.
> > I will, although I can't say when, but as soon as I can.
In fact, the Glib.dll problem (DynaLoader-specific name mangling defeats third-party shared object loading) is the same as the Wx.dll problem we diagnosed and resolved on PAR 0.952, so there's a high probability that it's already resolved. If not, please send me a one-liner that exhibits the problem (pp -e "..."); I'm quite willing to investigate some more. If you'd like to trace it, the logic is in PAR.pm line 671 as of PAR 0.952. Thanks! Audrey
CC: Steffen Müller via RT <bug-PAR [...] rt.cpan.org>, par [...] perl.org
Subject: Re: [rt.cpan.org #13508] cannot find Glib.dll on win32, despite being packaged in the exe
Date: Tue, 03 Oct 2006 02:35:04 -0700
To: Marc Lehmann <schmorp [...] schmorp.de>
From: Glenn Linderman <perl [...] NevCal.com>
Download (untitled) / with headers
text/plain 1.9k
On approximately 9/1/2006 2:53 AM, came the following characters from the keyboard of Marc Lehmann: Show quoted text
> Right, I am the only one who managed to package gtk+ with perl on windows > so far, to my knowledge, and I had to work around some other par bugs > (such as adding its own defective entry to @INC _multiple_ times during > program execution) but thats not the actual problem. > > The actual problem is and stays that par (version 1.52) does not correctly > package perl modules using xs and shared objects. > > In case it matters, here is what I do a as workaround: > > 1. par keeps alot of crust in @INC leading to clashes if a user has a > different but incompatible pelr installed: > > @INC = grep ref, @INC; # weed out all paths except pars loader refs > > 2. I pre-push my own libdir in @INC, both at BEGIN time as well as on main > program start, because par pushes its own handler in front of it. > > 3. I manually package all Glib and gtk2-module related files into my own > hierarchy. No @INC handler required, no renaming required, simply works. >
Well, I finally found a few minutes tonight while waiting for something else, to see if I could get ImageMagick working with PAR in a similar manner. I have a couple questions about what you do for #2 and #3. 3. Do you use a -A file that lists all the pieces of GTK for reference in the pp command? How do you deal with relative vs absolute path names, and where/how do you target the location of the extracted pieces? Do you move them under your build environment so you can reference them relative, and let them get unpacked under inc, or maybe a level lower? 2. Does "pre-push" mean "unshift"? And is the path $ENV{'PAR_TEMP'} . '/inc' ? Or something way different? -- Glenn -- http://nevcal.com/ =========================== A protocol is complete when there is nothing left to remove. -- Stuart Cheshire, Apple Computer, regarding Zero Configuration Networking
Subject: Re: [rt.cpan.org #13508] cannot find Glib.dll on win32, despite being packaged in the exe
Date: Tue, 3 Oct 2006 12:31:53 +0200
To: Glenn Linderman via RT <bug-PAR [...] rt.cpan.org>
From: Marc Lehmann <schmorp [...] schmorp.de>
On Tue, Oct 03, 2006 at 05:35:30AM -0400, Glenn Linderman via RT <bug-PAR@rt.cpan.org> wrote: Show quoted text
> Well, I finally found a few minutes tonight while waiting for something > else, to see if I could get ImageMagick working with PAR in a similar > manner. I have a couple questions about what you do for #2 and #3.
Well, according to Audrey, there should not be any problem left - I unfortunately still did not have time to recheck this with current versions of PAR, so all I can offer is my (supposedly) outdated solution. Please note that the real problemc ame from the fact that PAR renamed dll's so they couldn't be found anymore. Show quoted text
> 3. Do you use a -A file that lists all the pieces of GTK for reference > in the pp command?
Yes. Show quoted text
> How do you deal with relative vs absolute path names, and where/how do > you target the location of the extracted pieces?
The problem arose on windows just because we package gtk+ only there. On windows, gtk+ doesn't use absolute paths so there is no problem. On unix, the problem is immense, as you would have to rewrite lots of config files with absolute paths in them, something I didn't try yet. Show quoted text
> 2. Does "pre-push" mean "unshift"? And is the path $ENV{'PAR_TEMP'} . > '/inc' ? Or something way different?
This is what I do (slightly simplified, I actually wrote down every single .dll file manually to exclude the ones not required) to call pp on windows: http://data.plan9.de/ppwin As you can see, I simply package all Gtk2 and Glib-related files and libraries manually, which works just fine. In the binary, I do this at the very beginning: http://txt.schmorp.de/2629b6fdba568e7cda3ed953cbaf8613.txt This first checks wether par is running (I found no good/official/documented way to do this, so take this with a grain of salt). Then I remove all paths from @INC except the one from PAR (because otherwise perl would try to find dlls at places where it was originally compiled, not where it is run, and there might be a completely incompatible version of perl installed there, we rtan into that problem). This, again, is not documented or official, so future versions of par might break, Then I extract additional files packaged under /root, this is where I put my own data files and stuff. Again this uses undocumented functionality (PAR_TEMP) that might not work in future versions. I do not use @INC in _that_ project, but I have another win32 project using par, where I do: unshift @INC, $ENV{PAR_TEMP}; in the BEGIN block and: unshift @INC, $ENV{PAR_TEMP} if %PAR::LibCache; _directly_ after it, as PAR removes my handler again (just like renaming dlls, I never found out why it acts this irrationally, and the only thing that kept me from writing my own wrapper was that I thought it had to be possible - it cost me two days to work around par :). -- The choice of a -----==- _GNU_ ----==-- _ generation Marc Lehmann ---==---(_)__ __ ____ __ pcg@goof.com --==---/ / _ \/ // /\ \/ / http://schmorp.de/ -=====/_/_//_/\_,_/ /_/\_\ XX11-RIPE
CC: Marc Lehmann <schmorp [...] schmorp.de>, Steffen Müller via RT <bug-PAR [...] rt.cpan.org>, par [...] perl.org
Subject: Re: [rt.cpan.org #13508] cannot find Glib.dll on win32, despite being packaged in the exe
Date: Tue, 03 Oct 2006 16:58:25 -0700
To: Glenn Linderman <perl [...] NevCal.com>
From: Glenn Linderman <perl [...] NevCal.com>
Download (untitled) / with headers
text/plain 2.7k
On approximately 10/3/2006 2:35 AM, came the following characters from the keyboard of Glenn Linderman: Show quoted text
> On approximately 9/1/2006 2:53 AM, came the following characters from > the keyboard of Marc Lehmann:
>> Right, I am the only one who managed to package gtk+ with perl on >> windows >> so far, to my knowledge, and I had to work around some other par bugs >> (such as adding its own defective entry to @INC _multiple_ times during >> program execution) but thats not the actual problem. >> >> The actual problem is and stays that par (version 1.52) does not >> correctly >> package perl modules using xs and shared objects. >> >> In case it matters, here is what I do a as workaround: >> >> 1. par keeps alot of crust in @INC leading to clashes if a user has a >> different but incompatible pelr installed: >> >> @INC = grep ref, @INC; # weed out all paths except pars loader >> refs >> >> 2. I pre-push my own libdir in @INC, both at BEGIN time as well as on >> main >> program start, because par pushes its own handler in front of it. >> >> 3. I manually package all Glib and gtk2-module related files into my own >> hierarchy. No @INC handler required, no renaming required, simply works. >>
> Well, I finally found a few minutes tonight while waiting for > something else, to see if I could get ImageMagick working with PAR in > a similar manner. I have a couple questions about what you do for #2 > and #3. > > 3. Do you use a -A file that lists all the pieces of GTK for reference > in the pp command? How do you deal with relative vs absolute path > names, and where/how do you target the location of the extracted > pieces? Do you move them under your build environment so you can > reference them relative, and let them get unpacked under inc, or maybe > a level lower?
So I tried this; and it works to some extent, but the .dll files do not get unpacked into the tree I set up under inc. There must be some overriding logic that prevents .dll files from being unpacked; it is likely the same logic that caused the problem in the first place. Did you have to add code to unpack all the .dll files, or is there some pp switch I am missing that would override that logic, and unpack my .dll files? Show quoted text
> 2. Does "pre-push" mean "unshift"? And is the path $ENV{'PAR_TEMP'} > . '/inc' ? Or something way different?
So I told it to put all the ImageMagick files in "im/" so I unshift @INC, $ENV{'PAR_TEMP'} . '\\inc\\im'; That seems reasonable to me, but I haven't gotten everything working, either, due to the above problem with .dlls not being extracted, and another problem with another package. -- Glenn -- http://nevcal.com/ =========================== A protocol is complete when there is nothing left to remove. -- Stuart Cheshire, Apple Computer, regarding Zero Configuration Networking
CC: Marc Lehmann <schmorp [...] schmorp.de>, Steffen Müller via RT <bug-PAR [...] rt.cpan.org>
Subject: Re: [rt.cpan.org #13508] cannot find Glib.dll on win32, despite being packaged in the exe
Date: Wed, 04 Oct 2006 23:49:39 -0700
To: par [...] perl.org
From: Glenn Linderman <perl [...] NevCal.com>
Download (untitled) / with headers
text/plain 5.5k
On approximately 10/3/2006 4:58 PM, came the following characters from the keyboard of Glenn Linderman: Show quoted text
> On approximately 10/3/2006 2:35 AM, came the following characters from > the keyboard of Glenn Linderman:
>> On approximately 9/1/2006 2:53 AM, came the following characters from >> the keyboard of Marc Lehmann:
>>> Right, I am the only one who managed to package gtk+ with perl on >>> windows >>> so far, to my knowledge, and I had to work around some other par bugs >>> (such as adding its own defective entry to @INC _multiple_ times during >>> program execution) but thats not the actual problem. >>> >>> The actual problem is and stays that par (version 1.52) does not >>> correctly >>> package perl modules using xs and shared objects. >>> >>> In case it matters, here is what I do a as workaround: >>> >>> 1. par keeps alot of crust in @INC leading to clashes if a user has a >>> different but incompatible pelr installed: >>> >>> @INC = grep ref, @INC; # weed out all paths except pars loader >>> refs >>> >>> 2. I pre-push my own libdir in @INC, both at BEGIN time as well as on >>> main >>> program start, because par pushes its own handler in front of it. >>> >>> 3. I manually package all Glib and gtk2-module related files into my own >>> hierarchy. No @INC handler required, no renaming required, simply works. >>>
>> Well, I finally found a few minutes tonight while waiting for >> something else, to see if I could get ImageMagick working with PAR in >> a similar manner. I have a couple questions about what you do for #2 >> and #3. >> >> 3. Do you use a -A file that lists all the pieces of GTK for reference >> in the pp command? How do you deal with relative vs absolute path >> names, and where/how do you target the location of the extracted >> pieces? Do you move them under your build environment so you can >> reference them relative, and let them get unpacked under inc, or maybe >> a level lower?
> So I tried this; and it works to some extent, but the .dll files do not > get unpacked into the tree I set up under inc. There must be some > overriding logic that prevents .dll files from being unpacked; it is > likely the same logic that caused the problem in the first place. Did > you have to add code to unpack all the .dll files, or is there some pp > switch I am missing that would override that logic, and unpack my .dll > files?
So here is code to a working work-around for the PAR problem of not extracting .dll files that refer to each other in a consistent place so that they can find each other. So for each module that needs to be unpacked, -X the module, and then create a -A list for it. For Image::Magick, that would have the following contents: manual_modules.txt: c:\perl\site\lib\auto\Image\Magick;lgl\auto\Image\Magick c:\perl\site\lib\Image\Magick.pm;lgl\Image\Magick.pm pp ... -X Image::Magick -A manual_modules.txt This could be done for several modules, if necessary. Corresponding code to put at the top of packaged script. sub PAR_fakeout { if ( $0 =~ m@[.]exe$@ ) # must be PAR, eh? { @INC = grep ref, @INC; # throw away everything but PAR unshift @INC, $ENV{'PAR_TEMP'} . '\\inc\\lgl'; } return; } sub PAR_extract { my ( $drive, $path, $zip ); $zip = PAR::par_handle( $0 ); $drive = substr( $ENV{'PAR_TEMP'}, 0, 2 ); $path = substr( $ENV{'PAR_TEMP'}, 2 ) . '\\inc\\lgl'; # return if -f $drive . $path . '\some.dll'; $path =~ s@\\@/@g; $zip->extractTree( 'lgl', $path, $drive ); return; } BEGIN { PAR_fakeout(); # do it at compile time PAR_extract(); # also extract .dll files from inside lgl path } PAR_fakeout(); # and also at run time PROs: It works. It might be a prototype for what a new PAR/pp option could do. CONs: It extracts the modules packaged this way on every run. Depending on their size, this may or may not be an issue. Clearly one _could_ code a -f check for a particular .dll file (since they are the ones PAR doesn't extract automatically) and assume that if one is there, they all are. Such a check would best be made on the last-to-be-extracted .dll file. This would hard code one file name in the above code, a commented form of the check is shown in the code. PAR extracts the non-DLL files, so those wind up getting extracted twice. One could play games enumerating all the various DLL files in one directory in the PAR file, and the non-DLL files in another, and then when doing the extract of DLLs extract the DLLs into the non-DLL directory... but that would exacerbate the next CON. And it is likely that the DLLs dominate the size of such modules anyway, so this CON is not nearly as severe as the previous one. It adds complexity to the build options. 'Twould be better if PAR/pp would take an extra option --always_extract_dlls_for Image::Magick that would cause them to be extracted along with the other source codes. Or even a switch with global applicability --always_extract_dlls that would apply to all DLLs, as everything works using this technique, unlike the current technique. Show quoted text
>> 2. Does "pre-push" mean "unshift"? And is the path $ENV{'PAR_TEMP'} >> . '/inc' ? Or something way different?
> So I told it to put all the ImageMagick files in "im/" so I > unshift @INC, $ENV{'PAR_TEMP'} . '\\inc\\im'; > > That seems reasonable to me, but I haven't gotten everything working, > either, due to the above problem with .dlls not being extracted, and > another problem with another package.
-- Glenn -- http://nevcal.com/ =========================== A protocol is complete when there is nothing left to remove. -- Stuart Cheshire, Apple Computer, regarding Zero Configuration Networking
CC: par [...] perl.org
Subject: Re: [rt.cpan.org #13508] cannot find Glib.dll on win32, despite being packaged in the exe
Date: Fri, 6 Oct 2006 11:08:57 +0200
To: Glenn Linderman via RT <bug-PAR [...] rt.cpan.org>
From: Marc Lehmann <schmorp [...] schmorp.de>
Download (untitled) / with headers
text/plain 1.5k
On Thu, Oct 05, 2006 at 02:50:17AM -0400, Glenn Linderman via RT <bug-PAR@rt.cpan.org> wrote: Show quoted text
> So here is code to a working work-around for the PAR problem of not > extracting .dll files that refer to each other in a consistent place so
Now I understand. Your problem is similar, but ultimately different. My problem wasn't that dlls aren't being unpacked, but that they were being unpacked under the wrong name. use Glib; # pull in Glib.dll as _another_ name use Gtk2; # pull in Gtk2.dll and Glib.dll, which isn't anywhere So the dlls are being loaded and unpacked, but under the wrong name. Packaging Glib.dll manually did not work either, as Gtk2 would refer to Glib.dll and Glib would refer to the <md5>.dll copy, resulting in crashes. Show quoted text
> CONs: > > It extracts the modules packaged this way on every run. Depending on
It should be made to use the cache par assumingly provides (I could never get the cache to work, so I do not use caching, but in theory that would alleviate the speed problems). Show quoted text
> -f check for a particular .dll file (since they are the ones PAR doesn't
From what I read, par internally should do this, so when implementing such an option it could be taken care of. So the switch would trade a (possibly) slower first-time startup with a faster second-time startup. -- The choice of a -----==- _GNU_ ----==-- _ generation Marc Lehmann ---==---(_)__ __ ____ __ pcg@goof.com --==---/ / _ \/ // /\ \/ / http://schmorp.de/ -=====/_/_//_/\_,_/ /_/\_\ XX11-RIPE
CC: Glenn Linderman via RT <bug-PAR [...] rt.cpan.org>, par [...] perl.org
Subject: Re: [rt.cpan.org #13508] cannot find Glib.dll on win32, despite being packaged in the exe
Date: Fri, 06 Oct 2006 09:37:24 -0700
To: Marc Lehmann <schmorp [...] schmorp.de>
From: Glenn Linderman <perl [...] NevCal.com>
On approximately 10/6/2006 2:08 AM, came the following characters from the keyboard of Marc Lehmann: Show quoted text
> On Thu, Oct 05, 2006 at 02:50:17AM -0400, Glenn Linderman via RT <bug-PAR@rt.cpan.org> wrote: >
>> So here is code to a working work-around for the PAR problem of not >> extracting .dll files that refer to each other in a consistent place so >>
> Now I understand. Your problem is similar, but ultimately different. > > My problem wasn't that dlls aren't being unpacked, but that they were being > unpacked under the wrong name. > > use Glib; # pull in Glib.dll as _another_ name > use Gtk2; # pull in Gtk2.dll and Glib.dll, which isn't anywhere > > So the dlls are being loaded and unpacked, but under the wrong name. > > Packaging Glib.dll manually did not work either, as Gtk2 would refer to > Glib.dll and Glib would refer to the <md5>.dll copy, resulting in crashes. >
Well, my understanding is that ImageMagick is kind of like your Gtk2... it pulls in the first .dll file, which goes looking for the rest of them, and they are nowhere to be found. The first one is unpacked as a temp file, so it cannot be found in the lib\auto\Image\Magick directory when looking at the par_cache area after the fact, either. But looking for a file of its size in the par_cache area, one can compare and discover that that first .dll does get extracted... but it can't find its siblings (which aren't referenced via standard Perl autoload techniques) by their proper names in the same directory as the first .dll. So I guess that is slightly different, but curing the "different name" and "different location" problems would seem to help us both. So I'm not at all sure what you have done to cure your problem. From what you said, I thought I was doing what you did up until the need to actually extract the .dlls to the right place. Show quoted text
>> CONs: >> >> It extracts the modules packaged this way on every run. Depending on >>
> It should be made to use the cache par assumingly provides (I could never > get the cache to work, so I do not use caching, but in theory that would > alleviate the speed problems). >
If you are referring to the on-disk cache under $ENV{'PAR_TEMP'}, that is where I expected the Image::Magick .dlls to be extracted to. And some versions of PAR actually did it, and over time with "fixed" so that they didn't anymore. Show quoted text
>> -f check for a particular .dll file (since they are the ones PAR doesn't >>
> > From what I read, par internally should do this, so when implementing > such an option it could be taken care of. So the switch would trade a > (possibly) slower first-time startup with a faster second-time startup. > >
Well, yes, it does, for files that it actually unpacks, which doesn't include the "other" ImageMagick .dll files as far as I can determine... there are a bunch of .dll files in the par cache, but not enough of the right byte size to be the ImageMagick ones. -- Glenn -- http://nevcal.com/ =========================== A protocol is complete when there is nothing left to remove. -- Stuart Cheshire, Apple Computer, regarding Zero Configuration Networking
CC: par [...] perl.org
Subject: Re: [rt.cpan.org #13508] cannot find Glib.dll on win32, despite being packaged in the exe
Date: Fri, 13 Oct 2006 21:15:28 +0200
To: Audrey Tang via RT <bug-PAR [...] rt.cpan.org>
From: Marc Lehmann <schmorp [...] schmorp.de>
Download (untitled) / with headers
text/plain 1.5k
On Fri, Sep 01, 2006 at 08:32:05AM -0400, Audrey Tang via RT <bug-PAR@rt.cpan.org> wrote: Show quoted text
> In fact, the Glib.dll problem (DynaLoader-specific name mangling defeats > third-party shared object loading) is the same as the Wx.dll problem we > diagnosed and resolved on PAR 0.952, so there's a high probability that > it's already resolved.
I installed par-0.956 and modified my script (which worked fine with earlier versions of par), to: - no longer -X Gtk2 -X Glib - no longer include Glib.dll, Glib.pm etc. files for Glib and Gtk2 and promptly got the same problem again: Glib.dll not found. On closer inspection, Glib.dll is now indeed packaged, but still not found. Likely this is because it is not in the PATH, nor whereever Gtk2.dll expects it (namely in shlib/Glib.dll, while par packages it into lib/auto/Glib/Glib.dll). Show quoted text
> If not, please send me a one-liner that exhibits the problem (pp -e "...");
I have no idea how to make a one-liner, because I still have to package all the libraries, and this makes it longer than the valid line length on windows. I would guess the moral equivalent that exhibits the problem is: pp -e "use Gtk2" running under an environment not having perl but everything else (libgtk etc.). This would stop because Gtk2 can't find Glib.dll -- The choice of a -----==- _GNU_ ----==-- _ generation Marc Lehmann ---==---(_)__ __ ____ __ pcg@goof.com --==---/ / _ \/ // /\ \/ / http://schmorp.de/ -=====/_/_//_/\_,_/ /_/\_\ XX11-RIPE
From: MGRIMES [...] cpan.org
Download (untitled) / with headers
text/plain 997b
These fixes have been extremely helpful. Thanks Marc in particular. I have put some of this into a package and tweaked Marc's ppwin script, both of which I am attaching in case someone else might find them useful. I still have one problem though. I am using Gtk2::GladeXML to implement the interface. Using Marc's kludge, I have been successful in getting the pp'ed app to run displaying the interface, but once I run signal_autoconnect_from_package I get the following error: Can't locate object method "signal_connect" via package "Gtk2::Button" at Gtk2/GladeXML.pm line 40. There is not Gtk2/Button.pm file on my system or in the par archive, so this doesn't appear to be just a matter of adding that to the -A addfile list. I really don't know the inner workings of Gtk2 to understand where things are going wrong. If I comment out that one line from my app, the interface comes up beautifully (although it obviously doesn't do anything). Any guidance from the experts? Thanks, Mark
Download GTK2Kludge.pm
text/x-perl 2.1k
package PAR::GTK2Kludge; # This is a package implementing the fix discovered by Marc Lehmann. Thanks # for sharing this solution; I would have never figured this out! # The original can be found at: http://txt.schmorp.de/2629b6fdba568e7cda3ed953cbaf8613.txt use strict; use warnings; our $VERSION = '0.20'; BEGIN { my $dbg; for(@ARGV){ $dbg++ if /^-d|^--debug/;} print "Running kludge\n" if $dbg; if (%PAR::LibCache) { print "kludging\n" if $dbg; @INC = grep ref, @INC; # weed out all paths except pars loader refs while (my ($filename, $zip) = each %PAR::LibCache) { for ($zip->memberNames) { next unless m!^root/(.*)!; print "zip: $_\n" if $dbg; $zip->extractMember ($_, "$ENV{PAR_TEMP}/$1") unless -e "$ENV{PAR_TEMP}/$1"; } } if ($^O eq "MSWin32") { $ENV{GTK_RC_FILES} = "$ENV{PAR_TEMP}/share/themes/MS-Windows/gtk-2.0/gtkrc"; } print "Inc:\n", join("\n",@INC),"\n" if $dbg; print "Temp:\n", $ENV{PAR_TEMP},"\n" if $dbg; print "Path:\n", $ENV{PATH},"\n" if $dbg; print "Chdir to $ENV{PAT_TEMP}\n" if $dbg; chdir $ENV{PAR_TEMP} if $ENV{PAR_TEMP}; } } 1; __END__ # Below is stub documentation for your module. You'd better edit it! =head1 NAME PACKAGE - Perl extension for blah blah blah =head1 SYNOPSIS use PACKAGE; blah blah blah =head1 DESCRIPTION Stub documentation for PACKAGE, created by h2xs. It looks like the author of the extension was negligent enough to leave the stub unedited. Blah blah blah. =head2 EXPORT None by default. =head1 SEE ALSO Mention other useful documentation such as the documentation of related modules or operating system documentation (such as man pages in UNIX), or any relevant external documentation such as RFCs or standards. If you have a mailing list set up for your module, mention it here. If you have a web site set up for your module, mention it here. =head1 AUTHOR mgrimes, E<lt>mgrimes at cpan dot org<gt> =head1 COPYRIGHT AND LICENSE Copyright (C) 2006 by mgrimes This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.2 or, at your option, any later version of Perl 5 you may have available. =cut
Download ppkludge
application/octet-stream 1.2k

Message body not shown because it is not plain text.

From: Martin.Schlemmer [...] nwu.ac.za
Download (untitled) / with headers
text/plain 355b
I have the same problem, and resolved it with the patch from bug #32589, and adding the DLLs via the -l switch (I do not package all the Gtk+ files, as I use a merge module with my installers). I also use Gtk2::GladeXML, which also needed to be added to the patch to work. Patch for reference and sample script I use to build the executables attached.
Download buildEXE.pl
text/x-perl 708b
#!/perl/bin/perl -w use strict; use FindBin; use pp; my $version = '1.0.0'; my $script = "$FindBin::Bin/test.pl"; my @libs = qw( Cairo/Cairo.dll Glib/Glib.dll Gtk2/Gtk2.dll Gtk2/GladeXML/GladeXML.dll ); @ARGV = (); push (@ARGV, '-z'); push (@ARGV, '9'); push (@ARGV, '--gui'); push (@ARGV, '-N'); push (@ARGV, "ProductVersion=$version"); push (@ARGV, '-N'); push (@ARGV, "FileVersion=$version"); for my $file (@libs) { for my $dir (@INC) { my $lib = "$dir/auto/$file"; if (-f $lib) { push (@ARGV, '-l'); push (@ARGV, $lib); last; } } } push (@ARGV, '-o'); push (@ARGV, "$FindBin::Bin/test.exe"); push (@ARGV, "$script"); pp->go();
diff -uprN Module-ScanDeps-0.82/lib/Module/ScanDeps.pm Module-ScanDeps-0.82.az/lib/Module/ScanDeps.pm --- Module-ScanDeps-0.82/lib/Module/ScanDeps.pm 2008-01-28 18:28:03.000000000 +0200 +++ Module-ScanDeps-0.82.az/lib/Module/ScanDeps.pm 2008-01-31 20:57:34.000000000 +0200 @@ -914,6 +914,7 @@ sub add_deps { my ($path, $basename) = ($1, $2); foreach (_glob_in_inc("auto/$path")) { + next if $_->{file} =~ m{(Glib)|(Cairo)|(Gtk2)|(GladeXML)} and $^O eq 'MSWin32'; next if $_->{file} =~ m{\bauto/$path/.*/}; # weed out subdirs next if $_->{name} =~ m/(?:^|\/)\.(?:exists|packlist)$/; my $ext = lc($1) if $_->{name} =~ /(\.[^.]+)$/;
From: mzhou [...] cse.unsw.edu.au
Download (untitled) / with headers
text/plain 752b
We solved this problem for Biodiverse (http://biodiverse.googlecode.co) by patching PAR to extract DLLs with their original names instead of CRCs. I'm aware that names are much more likely to crash than CRCs, so perhaps an option embedded into the .exe when pp builds it could choose between whether to use name or CRC? On Thu Feb 07 01:46:22 2008, azarah wrote: Show quoted text
> I have the same problem, and resolved it with the patch from bug
#32589, Show quoted text
> and adding the DLLs via the -l switch (I do not package all the Gtk+
Show quoted text
> files, as I use a merge module with my installers). I also use
Show quoted text
> Gtk2::GladeXML, which also needed to be added to the patch to work.
Show quoted text
>
Show quoted text
> Patch for reference and sample script I use to build the executables
Show quoted text
> attached.
Subject: Heavy.pm.patch
Download Heavy.pm.patch
text/x-diff 443b
--- Heavy.pm 2011-12-02 15:15:22.000000000 +1100 +++ Heavy.pm 2012-10-30 16:25:52.124835500 +1100 @@ -145,7 +145,7 @@ else { $filename = File::Spec->catfile( ($ENV{PAR_TEMP} || File::Spec->tmpdir), - ($name || ($member->crc32String . ".$DynaLoader::dl_dlext")) + ($name || ((File::Spec->splitpath ($member->fileName))[-1])) ); ($filename) = $filename =~ /^([\x20-\xff]+)$/;
Download (untitled) / with headers
text/plain 906b
On 2012-10-31 21:33:13, mzhou wrote: Show quoted text
> We solved this problem for Biodiverse (http://biodiverse.googlecode.co) > by patching PAR to extract DLLs with their original names instead of > CRCs. I'm aware that names are much more likely to crash than CRCs, so > perhaps an option embedded into the .exe when pp builds it could choose > between whether to use name or CRC?
The last thing PAR or PAR::Packer needs is another option! The correct solution is to stop extracting DLLs with CRC names altogether. Recent versions of PAR::Packer will extract any DLL with its full pathname anyway - except for the "embedded" ones (cf. PAR::Tutorial) which are extracted in stage 2 of the bootstrap of a packed executable. If this could be modified to use full pathnames, too, the whole CRC names thing could be removed. This would probably also remove the need for PAR to muck with DynaLoader. Cheers, Roderich


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.