Closed run4flat closed 9 years ago
Hi David,
I think the issue was fixed in https://rt.cpan.org/Ticket/Display.html?id=105153, can you check if it works for you?
Sincerely, Dmitry
This bug report is spurious. I read through the email thread in which the issue was reported, but didn't see any follow-up after Rob said, "I'll submit a bug report," and I didn't see the bug open on RT. I have not tested it (yet), but I am confident that we can close this issue for now. If I encounter trouble later, I'll report it separately.
Thanks!
Hi Dmitry, me, using Gentoo and g-cpan for perl modules, which temporarily installs packages into e.g. /var/tmp/portage before merging into the main package tree have the issue that Prima{Config} shows those temporary incpaths, ldpath, etc. instead of their final destination. To me, that looks like the situation in your link. Do you have any suggestions? Not knowing any better I manually edited Prima/Config.pm, which will, of course, be overwritten by any updates.
Could you maybe think of a better way handling paths in Config?
Ingo
I just submitted a pull request with a revised Makefile.PL which I believe solves this problem. @fantasma13 can you pull my fork and check?
Hi David,
That might look like a working hack, but File::Spec->catfile(dirname(FILE), '..') produces just '..' on my machine, and I believe relative paths won't work.
/dk
sorry my bad, with a correct invocation they do produce full path ... yes, please test if that works for gentoo
Yeah, something that really confused me while testing is that catfile
behaves differently on Windows compared with Linux and Mac. On windows, catfile
folds the ..
into a shorter path, but on Linux and Mac it does not. I tested my change by installing a Prima with the new Config.pm, then building and testing PDL::Drawing::Prima. It was easy to pick out the ..
in the compiler invocation for Linux and Mac, and its absence on Windows confused me quite a bit. It took some experimentation on Windows before I convinced myself that it was using my new, modified Config.pm.
There's another problem I see on win32, but it's actually generic - the calculation of bin path in far from necessarily ../../bin, on strawberry it is ../bin, referred as INSTALL_BIN and is configured during perl compilation
Dmitry, I do not believe you are correct about win32. On my Windows box, the relevant directories are
c:\strawberry\perl\site\lib\Prima\Config.pm
c:\strawberry\perl\site\bin\
Starting from Prima::Config's directory, we need to go up two to get to bin. Is your directory layout different?
But I agree that hard-coding relative directory locations is not ideal.
Yes, I have the same relevant directories - but if I hack the installed Config.pm then it displays this:
$lib: C:\usr\local\perl\sb32p.522.01\perl\site\lib $bin: C:\usr\local\perl\sb32p.522.01\perl\bin
Oh! That's because I have a typo in my code! I don't have any code that actually uses Prima's command-line tools, so I didn't have a test for that path. I only need one ..
in the hacked Config.pm. I'll fix that in my pull request.
Aha, ok, I thought that ../.. was path working on Mac
Well I knew I've neen too hasty ... here's how it fails on linux:
dk@udayin src/IPA> perl -MPrima::Config -le 'print $Prima::Config::Config{gencls}' /home/dk/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/i686-linux/Prima/../../bin/gencls dk@udayin src/IPA> which gencls /home/dk/perl5/perlbrew/perls/perl-5.14.2/bin/gencls
All, please test the latest github version. I tested it on win32 and debian, seems good.
Dmitry,
I tested your latest git repo, I had to bump version (to 1.44) and 'make dist' to fake a release for the package manager to work. To cut a long story short, in Config.pm there's still the temporary installation dir showing.
/var/tmp/portage/perl-gcpan/Prima-1.44/work/Prima-1.43 is the directory where Prima was compiled. On my system, it gets installed into /usr/lib/perl5/vendor_perl/5.22.0/x86_64-linux-thread-multi/Prima
Ingo
On 07/31/2015 08:38 PM, Dmitry Karasik wrote:
All, please test the latest github version. I tested it on win32 and debian, seems good.
— Reply to this email directly or view it on GitHub https://github.com/dk/Prima/issues/29#issuecomment-126779303.
package Prima::Config; use vars qw(%Config %Config_inst);
%Config_inst = ( incpaths => [ '$(lib)/Prima/CORE','$(lib)/Prima/CORE/generic','/usr/local/include','/usr/include/freetype2','/usr/include/gtk-2.0','/usr/lib64/gtk-2.0/include','/usr/include/pango-1.0','/usr/include/atk-1.0','/usr/include/cairo','/usr/include/pixman-1','/usr/include/libdrm','/usr/include/gdk-pixbuf-2.0','/usr/include/libpng16','/usr/include/pango-1.0','/usr/include/harfbuzz','/usr/include/pango-1.0','/usr/include/glib-2.0','/usr/lib64/glib-2.0/include' ], gencls => '$(bin)/gencls', tmlink => '$(bin)/tmlink', libname => '$(lib)/auto/Prima/Prima.a', dlname => '$(lib)/auto/Prima/Prima.so', ldpaths => [],
inc => '-I$(lib)/Prima/CORE -I$(lib)/Prima/CORE/generic -I/usr/local/include -I/usr/include/freetype2 -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include',
libs => '',
);
%Config = ( ifs => '\/', quote => '\'', platform => 'unix', incpaths => [ '/var/tmp/portage/perl-gcpan/Prima-1.44/work/Prima-1.43/include','/var/tmp/portage/perl-gcpan/Prima-1.44/work/Prima-1.43/include/generic','/usr/local/include','/usr/include/freetype2','/usr/include/gtk-2.0','/usr/lib64/gtk-2.0/include','/usr/include/pango-1.0','/usr/include/atk-1.0','/usr/include/cairo','/usr/include/pixman-1','/usr/include/libdrm','/usr/include/gdk-pixbuf-2.0','/usr/include/libpng16','/usr/include/pango-1.0','/usr/include/harfbuzz','/usr/include/pango-1.0','/usr/include/glib-2.0','/usr/lib64/glib-2.0/include' ], gencls => '/var/tmp/portage/perl-gcpan/Prima-1.44/work/Prima-1.43/blib/script/gencls', tmlink => '/var/tmp/portage/perl-gcpan/Prima-1.44/work/Prima-1.43/blib/script/tmlink', scriptext => '', genclsoptions => '--tml --h --inc', cobjflag => '-o ', coutexecflag => '-o ', clinkprefix => '', clibpathflag => '-L', cdefs => [], libext => '.a', libprefix => '', libname => '/var/tmp/portage/perl-gcpan/Prima-1.44/work/Prima-1.43/blib/arch/auto/Prima/Prima.a', dlname => '/var/tmp/portage/perl-gcpan/Prima-1.44/work/Prima-1.43/blib/arch/auto/Prima/Prima.so', ldoutflag => '-o ', ldlibflag => '-l', ldlibpathflag => '-L', ldpaths => [], ldlibs => ['Xpm','gif','tiff','png','jpeg','X11','Xext','freetype','fontconfig','Xrender','Xft','gtk-x11-2.0','gdk-x11-2.0','pangocairo-1.0','atk-1.0','cairo','gdk_pixbuf-2.0','gio-2.0','pangoft2-1.0','pango-1.0','gobject-2.0','glib-2.0','Xrandr'], ldlibext => '', inline => 'inline', dl_load_flags => 1,
inc => '-I/var/tmp/portage/perl-gcpan/Prima-1.44/work/Prima-1.43/include -I/var/tmp/portage/perl-gcpan/Prima-1.44/work/Prima-1.43/include/generic -I/usr/local/include -I/usr/include/freetype2 -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include',
define => '',
libs => '',
);
1
Hi Ingo,
Looking at the config it looks that you took the version from the compiling directory. After you run 'make install', I believe Config.pm gets all values set correctly -- it's getting patched underway. Can you try this path and see if it works for you?
Dmitry
(ps - the patch will be applied to the Config.pm in the installed directorty, not the compiling directory)
Dmitry, this is the real thing, installed file under /usr/lib64/perl5/[...]/Prima/ what happens is that during emerge, the 'make install' step puts all files under e.g. /var/tmp/portage/perl-gcpan/Prima-1.44/image/ There, the whole tree with full paths are first installed before merged into the live system. So, during the install phase, the full path to Config.pm is /var/tmp/portage/perl-gcpan/Prima-1.44/image/usr/lib64/perl5/vendor_perl/5.22.0/x86_64-linux-thread-multi/Prima/Config.pm. Could that be the issue why the patch does not get applied?
That is really strange. It's rather easy to tell whether Config.pm is patched or not, by looking at %Config_inst inside -- if it is there, the file's not patched, otherwise it is. Also, 'make install' shows a line about patching, something like
Updating config /z/home/dmka/perl5/perlbrew/perls/perl-5.20.2/lib/site_perl/5.20.2/x86_64-linux/Prima/Config.pm
on my machine. Can you check out if 'make install' on your setup produces this? Makefile.PL assures this is done by hacking pure_perl_install/pure_site_install/pure_vendor_install targets in Makefile adding this command:
Makefile.PL --postinstall dest=$(DESTINSTALLVENDORARCH) slib=
It could fail if it can't find these targets, but then it warns loudly about this situation. That happened with newer ExtUtils::MakeMaker v > 7.0, but again, was fixed quickly. I wonder if this situation is similar
Source compiled. Test phase [not enabled]: perl-gcpan/Prima-1.44
Install Prima-1.44 into /var/tmp/portage/perl-gcpan/Prima-1.44/image/ category perl-gcpan make -j4 install Running Mkbootstrap for Prima () chmod 644 "Prima.bs" Manifying 7 pod documents Manifying 41 pod documents Manifying 40 pod documents Manifying 19 pod documents Files found in blib/arch: installing files in blib/lib into architecture dependent library tree Installing /var/tmp/portage/perl-gcpan/Prima-1.44/image/usr/lib64/perl5/vendor_perl/5.22.0/x86_64-linux-thread-multi/auto/Prima/Prima.so Installing /var/tmp/portage/perl-gcpan/Prima-1.44/image/usr/lib64/perl5/vendor_perl/5.22.0/x86_64-linux-thread-multi/Prima.pm Installing /var/tmp/portage/perl-gcpan/Prima-1.44/image/usr/lib64/perl5/vendor_perl/5.22.0/x86_64-linux-thread-multi/gencls.pod .... Installing /var/tmp/portage/perl-gcpan/Prima-1.44/image/usr/share/man/man3/Prima.3pm Installing /var/tmp/portage/perl-gcpan/Prima-1.44/image/usr/bin/cfgmaint Installing /var/tmp/portage/perl-gcpan/Prima-1.44/image/usr/bin/tmlink Installing /var/tmp/portage/perl-gcpan/Prima-1.44/image/usr/bin/gencls Installing /var/tmp/portage/perl-gcpan/Prima-1.44/image/usr/bin/p-class Installing /var/tmp/portage/perl-gcpan/Prima-1.44/image/usr/bin/VB Installing /var/tmp/portage/perl-gcpan/Prima-1.44/image/usr/bin/podview Installing /var/tmp/portage/perl-gcpan/Prima-1.44/image/usr/bin/fmview Completed installing Prima-1.44 into /var/tmp/portage/perl-gcpan/Prima-1.44/image/
strip: x86_64-pc-linux-gnu-strip --strip-unneeded -R .comment -R .GCC.command.line -R .note.gnu.gold-version usr/lib64/perl5/vendor_perl/5.22.0/x86_64-linux-thread-multi/auto/Prima/Prima.so ecompressdir: bzip2 -9 /usr/share/man ecompressdir: bzip2 -9 /usr/share/doc
It appears that it never gets run. Even if I manually say make install
mannually running that gives: Prima-1.43 # perl Makefile.PL --postinstall dest=$(DESTINSTALLVENDORARCH) slib= -su: DESTINSTALLVENDORARCH: command not found Updating config /Prima/Config.pm cannot open /Prima/Config.pm:No such file or directory
confirmed, it never gets patched.
Right, then lets' check this: does Makefile contains the 'postinstall' line at all?
no
If you run 'perl Makefile.PL', do you get a warning similar to this?
\ Warning: expected format of Makefile generated by ExtUtils::MakeMaker is changed, so post-installation steps may not be performed correctly. Prima will run OK, but modules dependent on it may not build. Please notify the author.
yes, I get this one.
Ok, that's the issue then. Can you run this command and post the version displayed?
perl -MExtUtils::MakeMaker -le 'print $ExtUtils::MakeMaker::VERSION'
also, please make sure that this is indeed the latest github version, and please post Makefile generated by Makefile.PL
(btw you can sent Makefile to dmitry@karasik.eu.org instead of pasting it here)
Hangon, I think there was a mistake on my side. In one place I forgot to bump the version. Compiling right now ...
Yes, the git version indeed works, apparently. Problem was, I used the original 1.43 tar ball mistakenly during the tests. I'm really sorry for not detecting that earlier. Ingo
No problem at all! Does it mean that you can roll a package using the latest github version with no problems?
yes, I tried PDL::Drawing::Prima and Prima::OpenGL
Excellent, thank you! I'll try to release 1.44 this week.
It appears that Prima::Config's incpaths key is no longer correct. It is used by PDL::Drawing::Prima here: https://github.com/run4flat/PDL-Drawing-Prima/blob/master/Build.PL#L12. It is not clear if this is an ExtUtils::MakeMaker bug, or if it arises from somewhere else.
For a complete discussion, see http://sourceforge.net/p/pdl/mailman/message/34185244/.