dk / Prima

prima.eu.org
Other
108 stars 27 forks source link

Issues finding Prima's CORE directory using Prima::Config #29

Closed run4flat closed 9 years ago

run4flat commented 9 years ago

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/.

dk commented 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

run4flat commented 9 years ago

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!

fantasma13 commented 9 years ago

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

run4flat commented 9 years ago

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?

dk commented 9 years ago

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

dk commented 9 years ago

sorry my bad, with a correct invocation they do produce full path ... yes, please test if that works for gentoo

run4flat commented 9 years ago

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.

dk commented 9 years ago

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

run4flat commented 9 years ago

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.

dk commented 9 years ago

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

run4flat commented 9 years ago

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.

dk commented 9 years ago

Aha, ok, I thought that ../.. was path working on Mac

dk commented 9 years ago

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

dk commented 9 years ago

All, please test the latest github version. I tested it on win32 and debian, seems good.

fantasma13 commented 9 years ago

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.

fantasma13 commented 9 years ago

This file was automatically generated.

Do not edit, you'll loose your changes anyway.

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

dk commented 9 years ago

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

dk commented 9 years ago

(ps - the patch will be applied to the Config.pm in the installed directorty, not the compiling directory)

fantasma13 commented 9 years ago

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?

dk commented 9 years ago

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

fantasma13 commented 9 years ago

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

fantasma13 commented 9 years ago

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

fantasma13 commented 9 years ago

confirmed, it never gets patched.

dk commented 9 years ago

Right, then lets' check this: does Makefile contains the 'postinstall' line at all?

fantasma13 commented 9 years ago

no

dk commented 9 years ago

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.

fantasma13 commented 9 years ago

yes, I get this one.

dk commented 9 years ago

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

dk commented 9 years ago

(btw you can sent Makefile to dmitry@karasik.eu.org instead of pasting it here)

fantasma13 commented 9 years ago

Hangon, I think there was a mistake on my side. In one place I forgot to bump the version. Compiling right now ...

fantasma13 commented 9 years ago

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

dk commented 9 years ago

No problem at all! Does it mean that you can roll a package using the latest github version with no problems?

fantasma13 commented 9 years ago

yes, I tried PDL::Drawing::Prima and Prima::OpenGL

dk commented 9 years ago

Excellent, thank you! I'll try to release 1.44 this week.