From mboxrd@z Thu Jan 1 00:00:00 1970 From: Efraim Flashner Subject: bug#36973: NativeCall doesn't work with rakudo ? Date: Thu, 8 Aug 2019 12:31:51 +0300 Message-ID: <20190808093151.GB5507@E2140> References: <20190807153311.GA8932@prometheus.u-strasbg.fr> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="8P1HSweYDcXXzwPJ" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:50830) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hvenA-0004Dj-Il for bug-guix@gnu.org; Thu, 08 Aug 2019 05:33:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hven8-0003bm-T1 for bug-guix@gnu.org; Thu, 08 Aug 2019 05:33:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:59316) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hven8-0003ba-Pe for bug-guix@gnu.org; Thu, 08 Aug 2019 05:33:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hven8-00017c-Jd for bug-guix@gnu.org; Thu, 08 Aug 2019 05:33:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([2001:470:142:3::10]:50616) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hvem5-0003sR-BM for bug-guix@gnu.org; Thu, 08 Aug 2019 05:31:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hvem3-0003Jz-Ii for bug-guix@gnu.org; Thu, 08 Aug 2019 05:31:57 -0400 Received: from flashner.co.il ([178.62.234.194]:50388) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hvem3-0003JE-93 for bug-guix@gnu.org; Thu, 08 Aug 2019 05:31:55 -0400 Content-Disposition: inline In-Reply-To: <20190807153311.GA8932@prometheus.u-strasbg.fr> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Marc Chantreux Cc: 36973@debbugs.gnu.org --8P1HSweYDcXXzwPJ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 07, 2019 at 05:33:11PM +0200, Marc Chantreux wrote: > hello, >=20 > i don't know if it's ok to report directly to the author, please excuse > me if it's not. It's definately not my first choice but I'm far more likely to respond to it than if you had just sent it to bug-guix or one of the other mailing lists :) I'm going to inline my notes >=20 > i installed the rakudo thru guix over a debian buster. (guix package -i rakudo) provides the 'perl6' binary and $GUIX_PROFILE/share/perl6 directory >=20 > AFAIR, i just installed >=20 > guix install perl6-zef sdl2 >=20 > in my ~/.zshenv, i have >=20 > export GUIX_PROFILE=3D~/.guix-profile > source $GUIX_PROFILE/etc/profile > path+=3D~/.guix-profile/bin > perl6lib+=3D( /home/mc/.guix-profile/share/perl6/lib(N) ) >=20 > then i "successfully" installed SDL2 with >=20 > zef install SDL2::Raw >=20 > i copied the example from this homepage (as attachement). >=20 > https://modules.perl6.org/dist/SDL2::Raw:cpan:TIMOTIMO and saved it as sdl.p6 >=20 > i have >=20 > locate -e libSDL2.so > /gnu/store/gyfg2rhnrny9z9gg6hwzjm13dpclr3v2-sdl2-2.0.9/lib/libSDL2.so > /usr/lib/x86_64-linux-gnu/libSDL2.so >=20 > but if i run (inside or outside a guix environment) (guix environment --ad-hoc rakudo perl6-zef sdl2 -- 'zef install \ SDL2::Raw && perl6 sdl.p6') >=20 > $GUIX_PROFILE/bin/perl6 sdl.p6 >=20 > i get >=20 > Cannot locate native library 'libSDL2.so': libSDL2.so: cannot open shar= ed object file: No such file or directory > in method setup at /gnu/store/in3wgq5mwwc6pqad92zzsay3ri86p6sn-rakudo-2= 019.03.1/share/perl6/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (Nati= veCall) line 287 > in method CALL-ME at /gnu/store/in3wgq5mwwc6pqad92zzsay3ri86p6sn-rakudo= -2019.03.1/share/perl6/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (Na= tiveCall) line 576 > in block at sdl.p6 line 3 >=20 I can confirm this, the is the same output that I got. efraim@bayfront ~$ find .perl6/ -name '*947BDAB9F96E0E5FCCB383124F923A6BF6F= 8D76B*' =2Eperl6/precomp/A7BEF869F222B0D8D2C76EF47E1D0480FFD6EA2C/94/947BDAB9F96E0E= 5FCCB383124F923A6BF6F8D76B.repo-id > i tested other Nativecall libs like sqlite and have the same problem. >=20 > thanks for any help you can provide to fix it. >=20 > regards > marc First of all I want to thank you for your report. (and I mean this seriously.) I packaged perl6 and rakudo (and a bunch of libraries working toward rakudo-star) after seeing a presentation at FOSDEM and I was curious. Unfortunately I have never used perl6 and we didn't have anyone who really knew much about it, so I used building packages successively as a test to see if everything seemed to work. Sometimes in Guix we end up with problems where everything works well in the build system, but binaries such as pip (the first one I can think of, although probably not pip) end up not working when used as a stand alone language package manager. =46rom reading through some back and forth from some Debian Developers and some perl6/rakudo people, I got the impression that there were a couple of different ways distro maintainers could distribute perl6 libraries. One way is the way I went, which is to, for each library, precompile it and then to mush (...join) them all together on the users machine, and this is what I went with. The other way was to distribute source, and at install time to recompile all the installed modules together so they'd all be in the target directory. This we can accomplish with profile hooks, and wouldn't be too bad, but I wanted to offload the building of the libraries and not have a time intensive profile hook to finally compile all the code. All this is nice, but it doesn't actually address the error above, which is that 'zef' apparently only knows to look for sources in /gnu/store/...-rakudo-../share/perl6/sources. It should at the very least be taught about profiles, and it would be nice to teach it about $HOME/.perl6 as well. In the interest of testing if making SDL2::Raw a guix package would help, I packaged it in a file (attached) and ran: guix package -f perl6-sdl2-raw.scm -i perl6-zef sdl2 rakudo cleared my $HOME/.perl6 folder and then re-ran perl6 sdl.p6 efraim@bayfront ~$ perl6 sdl.p6 =3D=3D=3DSORRY!=3D=3D=3D Could not find SDL2::Raw at line 1 in: inst#/home/efraim/.perl6 inst#/gnu/store/in3wgq5mwwc6pqad92zzsay3ri86p6sn-rakudo-2019.03.1/share= /perl6/site inst#/gnu/store/in3wgq5mwwc6pqad92zzsay3ri86p6sn-rakudo-2019.03.1/share= /perl6/vendor inst#/gnu/store/in3wgq5mwwc6pqad92zzsay3ri86p6sn-rakudo-2019.03.1/share= /perl6 ap# nqp# perl5# (this I believe is a separate issue, that perl6 doesn't know about our current environment) I then tried 'zef install SDL2::Raw' and re-ran 'perl6 sdl.p6' same error as above: efraim@bayfront ~$ perl6 sdl.p6 Cannot locate native library 'libSDL2.so': libSDL2.so: cannot open shared o= bject file: No such file or directory in method setup at /gnu/store/in3wgq5mwwc6pqad92zzsay3ri86p6sn-rakudo-201= 9.03.1/share/perl6/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (Native= Call) line 287 in method CALL-ME at /gnu/store/in3wgq5mwwc6pqad92zzsay3ri86p6sn-rakudo-2= 019.03.1/share/perl6/sources/947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (Nati= veCall) line 576 in block at sdl.p6 line 3 So here I'm a bit stumped. The resource 947... exists, in /gnu/store/...perl6-sdl2-raw-0.3/share/perl6/precomp and not in sources, and perl6 is only searching in rakudo/share/perl6 it seems. For another test, I copied my perl6-sdl2-raw package definition into the Guix source tree and ran =2E/pre-inst-env guix environment --ad-hoc rakudo perl6-zef perl6-sdl2-raw = sdl2 cleared my $HOME/.perl6 folder and re-ran 'perl6 sdl.p6' efraim@bayfront ~ [env]$ perl6 sdl.p6 Use of uninitialized value of type Any in string context. Methods .^name, .perl, .gist, or .say can be used to stringify it to someth= ing meaningful. in any statement_control at /gnu/store/in3wgq5mwwc6pqad92zzsay3ri86p6sn-r= akudo-2019.03.1/share/nqp/lib/Perl6/Grammar.moarvm line 1 Use of uninitialized value of type Any in string context. Methods .^name, .perl, .gist, or .say can be used to stringify it to someth= ing meaningful. in any statement_control at /gnu/store/in3wgq5mwwc6pqad92zzsay3ri86p6sn-r= akudo-2019.03.1/share/nqp/lib/Perl6/Grammar.moarvm line 1 =3D=3D=3DSORRY!=3D=3D=3D Cannot resolve caller new(IO::Path:U: Any:U, :CWD(Str)); none of these sign= atures match: (IO::Path: Str $path, :$SPEC =3D { ... }, Str:D :$CWD, *%_) (IO::Path: Str $path, :$SPEC =3D { ... }, :$CWD =3D { ... }, *%_) (IO::Path: Cool $path, :$SPEC =3D { ... }, :$CWD =3D { ... }, *%_) (IO::Path: :$basename!, :$dirname =3D "", :$volume =3D "", :$SPEC =3D {= ... }, :$CWD =3D { ... }, *%_) (IO::Path: *%_) I'm guessing that this is either some mistake on the code that's in the file, or that there's no display from bayfront being passed back to my computer. I've gone ahead and tested on a Debian box that I have (aarch64, Debian Sid, rakudo 2018.12-5, zef 0.6.2-2) sudo apt install rakudo perl6-zef libsdl2-dev zef install SDL2::Raw perl6 sdl.p6 efraim@pine64:~$ perl6 sdl.p6 dl.p6 couldn't initialize SDL2: No available video device in block at sdl.p6 line 3 it seems 'ssh pine64 -Y' wasn't enough. It does, however, mean that Debian's perl6/zef looks to be working well, and the code example from the website checks out. It looks like the short version is: zef in guix doesn't install runnable software, probably a problem with our copy of rakudo everything works as expected in Debian installing perl6 packages from the guix repo works 'guix package -f perl6-package -i rakudo' doesn't work as expected --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --8P1HSweYDcXXzwPJ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIyBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAl1L6/8ACgkQQarn3Mo9 g1ELkA/3cGAdcObCZmoJVa64I672vQ+HE+PhvVNSeZyFQGs6tTW68YUDsrRcO16u H8knL98nWKLzjddaFJkUejzCtZ2//ZxDSHVGci7O+GKf2YCy39SmeVVGM0JNVtTB Q+RtXrnCP3baWu4Q+xJN++u0bTQGSRl3Gam1M8r8+rT3LvWpQuaEw214GAd0H2yy CBIuWQ0Fwg32aKLndRCBqQIxfa835t9ovvYcQ/nmEiQvsarbW9vVb2s0DyNU0xtL Y4nx5qrSYMxUV4GRGQoA/puFFmxO71rpRDC8Ni1RSUi2o1Poqxl+nve/7O5icAZD BL/la5RNPfvMpmfuD76Yqg+aDyLWNY5W4DTQTLsv/hYHVDUmUPHS7Nt7kKAuDzWx jBTFrrmv+3/G9Rihi876pz2RWxQGAqCtBNGRaqlhk3mXe80FH4YQmSiUb2itBS0v OF1TnRloVk/xDoTguwyx30fqlZSI+GXnvL6iGwPUBQKNZg1kbksrpnhWKq3MQP5n Qr/q+rsMi4IW5k0q3o4JsNrb2IwtyzaTOPs9OptKGKbuMwXgZQEJPtHHJmcW9MVc TqSQ9t8GqNAtOLRURTTiNX0EntCoTTiGQf3iRsZ7YifKHlxJZ4WjZ1dpu9ycH0xl cMQJecf/CkJZvxL+A9+zte9VtiEi5Zz33Re2gyBZx/X3bwaecQ== =ED8z -----END PGP SIGNATURE----- --8P1HSweYDcXXzwPJ--