all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Perl module build+install process
@ 2014-08-10 16:35 Tom Molesworth
  2014-08-11 14:37 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Molesworth @ 2014-08-10 16:35 UTC (permalink / raw)
  To: guix-devel; +Cc: m.trout

[-- Attachment #1: Type: text/plain, Size: 2558 bytes --]

First, a quick disclaimer: I don't use guix myself, just passing on
information which came up in discussion elsewhere

A couple of months ago, someone reported having difficulty installing the
Perl distribution "XML::SAX" using guix as a regular user. From a (very)
brief inspection of the build process, the issue appears to be that the
installation directory is set to a temporary directory under
~/.guix/profile/..., but the files are then moved after installation to a
different location. The XML::SAX module therefore expects to finds things
in that installation path at runtime, and becomes confused when the paths
no longer exist.

Also, the path to which files are copied after installation appears to be
of the form:

 /gnu/store/d8fwypp5cnzjpc7kycmj4nj0gwn7k6lq-perl-xml-sax-0.99/

and subsequently tries to load from:

/gnu/store/wl8b56g57dbln9rrgi833q2j4ma0bh0z-perl-5.16.1/lib/perl5/site_perl/5.16.1/

(again, this is second-hand information, presumably the base32 components
in those paths varies between installations)

Since Perl uses an include path, much like the $PATH environment variable
for finding executables, this seems to imply that you'd need every module
added to the Perl include path (via $PERL5LIB). This would quickly become
unwieldy as more modules are installed.

A second issue is that, according to perl-build-system.scm, there does not
appear to be any support for CPAN distributions which use the Module::Build
toolchain:


http://git.savannah.gnu.org/cgit/guix.git/tree/guix/build/perl-build-system.scm

Instead, it appears to expect that modules use ExtUtils::MakeMaker, which
is not always the case. Module::Build is one of the two main build systems
used for Perl modules; it does not use makefiles at all, iinstead it
provides a Build.PL which generates the Build script. The build, test and
installation process typically follows this sequence:

 perl Build.PL && ./Build && ./Build test && ./Build install

The Module::Build documentation can be found here:

 https://metacpan.org/pod/Module::Build

I'm not sure what the solution to either of these two issues should be -
the usual advice is "just use the cpan client".

For verification, try installing XML::SAX as a regular user for the first
issue, and for an example of a Module::Build-based distribution, try
OAuth::Lite2 - there's a more extensive list of Module::Build-based
distributions available from here:

 https://metacpan.org/requires/distribution/Module-Build

Note that some distributions provide both a Makefile.PL and a Build.PL.

thanks,

Tom

[-- Attachment #2: Type: text/html, Size: 3378 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Perl module build+install process
  2014-08-10 16:35 Perl module build+install process Tom Molesworth
@ 2014-08-11 14:37 ` Ludovic Courtès
  2014-08-11 15:24   ` Tom Molesworth
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2014-08-11 14:37 UTC (permalink / raw)
  To: Tom Molesworth; +Cc: guix-devel, m.trout

Tom Molesworth <tetra604@gmail.com> skribis:

> Since Perl uses an include path, much like the $PATH environment variable
> for finding executables, this seems to imply that you'd need every module
> added to the Perl include path (via $PERL5LIB). This would quickly become
> unwieldy as more modules are installed.

Normally, ‘guix package --install’ and ‘guix package --search-paths’
would suggest adding ~/.guix-profile/lib/perl/... to $PERL5LIB, which
should solve the problem, no?

> A second issue is that, according to perl-build-system.scm, there does not
> appear to be any support for CPAN distributions which use the Module::Build
> toolchain:

Indeed, thanks for the pointers and explanations.

Currently, all the Perl packages provided in Guix use MakeMaker
apparently, so I guess we’ll implement the Module::Build method as soon
as we stumble upon a package that needs it.  :-)

Thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Perl module build+install process
  2014-08-11 14:37 ` Ludovic Courtès
@ 2014-08-11 15:24   ` Tom Molesworth
  2014-08-11 16:25     ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Molesworth @ 2014-08-11 15:24 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel, m.trout

[-- Attachment #1: Type: text/plain, Size: 1884 bytes --]

On 11 Aug 2014 21:37, "Ludovic Courtès" <ludo@gnu.org> wrote:
>
> Tom Molesworth <tetra604@gmail.com> skribis:
>
> > Since Perl uses an include path, much like the $PATH environment
variable
> > for finding executables, this seems to imply that you'd need every
module
> > added to the Perl include path (via $PERL5LIB). This would quickly
become
> > unwieldy as more modules are installed.
>
> Normally, ‘guix package --install’ and ‘guix package --search-paths’
> would suggest adding ~/.guix-profile/lib/perl/... to $PERL5LIB, which
> should solve the problem, no?

If that means there's just a single extra PERL5LIB entry rather than one
per installed module, yes - that should be fine.

The output we'd seen looked like each module ended up in a separate path,
but maybe we were misinterpreting, or a later step copies/symlinks to a
common library path.

Note that this is a separate concern to the install path not matching the
final location of the files; the provided installation path at build time
is used in some modules (XML::SAX in this case). Passing an installation
path at build time, then moving the files afterwards, is likely to cause
errors at runtime. PERL5LIB is used for loading Perl modules, but if a
module has extra data it won't necessarily read that from the same place.
This is similar to the /usr/lib and /usr/share split on some systems.

> > A second issue is that, according to perl-build-system.scm, there does
not
> > appear to be any support for CPAN distributions which use the
Module::Build
> > toolchain:
>
> Indeed, thanks for the pointers and explanations.
>
> Currently, all the Perl packages provided in Guix use MakeMaker
> apparently, so I guess we’ll implement the Module::Build method as soon
> as we stumble upon a package that needs it.  :-)

Sounds reasonable.

Thanks,

Tom

[-- Attachment #2: Type: text/html, Size: 2270 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Perl module build+install process
  2014-08-11 15:24   ` Tom Molesworth
@ 2014-08-11 16:25     ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2014-08-11 16:25 UTC (permalink / raw)
  To: Tom Molesworth; +Cc: guix-devel, m.trout

Tom Molesworth <tetra604@gmail.com> skribis:

> On 11 Aug 2014 21:37, "Ludovic Courtès" <ludo@gnu.org> wrote:
>>
>> Tom Molesworth <tetra604@gmail.com> skribis:
>>
>> > Since Perl uses an include path, much like the $PATH environment
> variable
>> > for finding executables, this seems to imply that you'd need every
> module
>> > added to the Perl include path (via $PERL5LIB). This would quickly
> become
>> > unwieldy as more modules are installed.
>>
>> Normally, ‘guix package --install’ and ‘guix package --search-paths’
>> would suggest adding ~/.guix-profile/lib/perl/... to $PERL5LIB, which
>> should solve the problem, no?
>
> If that means there's just a single extra PERL5LIB entry rather than one
> per installed module, yes - that should be fine.

Exactly.

> The output we'd seen looked like each module ended up in a separate path,
> but maybe we were misinterpreting, or a later step copies/symlinks to a
> common library path.

Well, ~/.guix-profile/lib/perl5 contains symlinks that make the union of
all the Perl packages installed in the user’s profile.

> Note that this is a separate concern to the install path not matching the
> final location of the files; the provided installation path at build time
> is used in some modules (XML::SAX in this case). Passing an installation
> path at build time, then moving the files afterwards, is likely to cause
> errors at runtime.

Files aren’t moved after installation.

Thanks,
Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-08-11 16:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-10 16:35 Perl module build+install process Tom Molesworth
2014-08-11 14:37 ` Ludovic Courtès
2014-08-11 15:24   ` Tom Molesworth
2014-08-11 16:25     ` Ludovic Courtès

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.