Keri Harris | 5 Jul 06:48
Favicon

[BUG] CHR install doesn't work with DESTDIR

The Yap CHR install doesn't play nice with DESTDIR. If there is an older 
version of yap installed (say yap-5.1.2) and we want to use DESTDIR to 
install yap-5.1.3 outside the standard install location (say into a staging 
area) then the CHR compile is likely to fail since YAPSHAREDIR still points 
to the old libraries. This can result in a variety of errors:

on linux-ppc (old version 5.1.2; new version 5.1.3):

make[1]: Entering directory 
`/var/tmp/portage/dev-lang/yap-5.1.3/work/Yap-5.1.3/LGPL/chr'
.../../yap ../../startup -f -l chr_swi_bootstrap.yap \
                      -g "chr_compile_step1
('chr_translate_bootstrap1.chr','chr_translate_bootstrap1.pl'),halt." \
                      -z 'halt(1).'
make[1]: *** [chr_translate_bootstrap1.pl] Segmentation fault

Even if there is *no* previous installation, then using DESTDIR will cause yap 
to fail to find the required libraries:

make[1]: Entering directory 
`/var/tmp/portage/dev-lang/yap-5.1.3/work/Yap-5.1.3/LGPL/chr'
.../../yap ../../startup -f -l chr_swi_bootstrap.yap \
                      -g "chr_compile_step1
('chr_translate_bootstrap1.chr','chr_translate_bootstrap1.pl'),halt." \
                      -z 'halt(1).'
% Restoring file /var/tmp/portage/dev-lang/yap-5.1.3/work/Yap-5.1.3/startup
YAP version Yap-5.1.3
     ERROR!!  at 
file /var/tmp/portage/dev-lang/yap-5.1.3/work/Yap-5.1.3/LGPL/chr/chr_swi_bootstrap.yap, 
near line 6.
(Continue reading)

Keri Harris | 5 Jul 08:05
Favicon

Re: [BUG] CHR install doesn't work with DESTDIR

On Sat, 05 Jul 2008 16:52:09 Keri Harris wrote:
> The attached patch fixes this for me.

Alas, the aforementioned patch only works for a single-threaded yap. With 
multi-threading we have two furthur problems:

1) we need to add the location of libYap.so to LD_LIBRARY_PATH, else we get:

make[1]: Entering directory 
`/var/tmp/portage/dev-lang/yap-5.1.3/work/Yap-5.1.3/LGPL/chr'
LD_LIBRARY_PATH=system 
YAPSHAREDIR=`pwd`/../../library ../../yap ../../startup -f -l 
chr_swi_bootstrap.yap \
                      -g "chr_compile_step1
('chr_translate_bootstrap1.chr','chr_translate_bootstrap1.pl'),halt." \
                      -z 'halt(1).'
.../../yap: error while loading shared libraries: libYap.so: cannot open shared 
object file: No such file or directory
make: *** [chr_translate_bootstrap1.pl] Error 127

Fixing this, brings us to:

2) The yap bootfile (boot.yap) is not installed:

LD_LIBRARY_PATH=`pwd`/../..:system 
YAPSHAREDIR=`pwd`/../../library ../../yap ../../startup -f -l 
chr_swi_bootstrap.yap \
                      -g "chr_compile_step1
('chr_translate_bootstrap1.chr','chr_translate_bootstrap1.pl'),halt." \
                      -z 'halt(1).'
(Continue reading)

Paulo Moura | 5 Jul 09:04

Re: [BUG] CHR install doesn't work with DESTDIR


On 2008/07/05, at 07:05, Keri Harris wrote:

> Sadly this bug is a showstopper on Gentoo Linux - we never install  
> directly to
> the live-filesystem. Instead we rely on DESTDIR to install to a  
> staging area.
> Only when the install successfully completes do we copy files from the
> staging area to the live filesystem. (The rationale behind this is  
> that if an
> install fails, the old version on the live filesystem is still  
> intact).

This problem is also preventing buiding of MacOS X installer packages  
for the exact same reason. The MacPorts software we're trying to use  
also install to a temporary location (called "destroot") in order to  
make a manifest of all the files that will be installed before moving  
them to the final location.

Cheers,

Paulo

-----------------------------------------------------------------
Paulo Jorge Lopes de Moura
Dep. of Computer Science, University of Beira Interior
6201-001 Covilhã, Portugal

Office 4.3  Ext. 3257
Phone: +351 275319891 Fax: +351 275319899
(Continue reading)

Vitor Santos Costa | 28 Jul 00:23

Re: [BUG] CHR install doesn't work with DESTDIR

Hi Keri and Paulo

Generating these files basically assumes a working Yap system.  Even
if I fix the library problem there would be some extra problems
because of the SWI emulation.

The simplest solution is to distribute the .pl files so that make does
not need to go and do it. I'll go and do it if you don't have any
comments.

Cheers

Vitor

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
Vitor Santos Costa | 28 Jul 00:02

Re: [BUG] CHR install doesn't work with DESTDIR

Hi Keri

Sorry for the delay. I installed this patch, but you should not need
YAPSHAREDIR set.

Cheers

Vitor

2008/7/5 Keri Harris <keri@...>:
> The Yap CHR install doesn't play nice with DESTDIR. If there is an older
> version of yap installed (say yap-5.1.2) and we want to use DESTDIR to
> install yap-5.1.3 outside the standard install location (say into a staging
> area) then the CHR compile is likely to fail since YAPSHAREDIR still points
> to the old libraries. This can result in a variety of errors:
>
> on linux-ppc (old version 5.1.2; new version 5.1.3):
>
> make[1]: Entering directory
> `/var/tmp/portage/dev-lang/yap-5.1.3/work/Yap-5.1.3/LGPL/chr'
> .../../yap ../../startup -f -l chr_swi_bootstrap.yap \
>                      -g "chr_compile_step1
> ('chr_translate_bootstrap1.chr','chr_translate_bootstrap1.pl'),halt." \
>                      -z 'halt(1).'
> make[1]: *** [chr_translate_bootstrap1.pl] Segmentation fault
>
>
> Even if there is *no* previous installation, then using DESTDIR will cause yap
> to fail to find the required libraries:
>
(Continue reading)


Gmane