chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-hackers] [PATCH] Use local -rpath in tests [was: Re: [PATCH] Fi


From: Peter Bex
Subject: [Chicken-hackers] [PATCH] Use local -rpath in tests [was: Re: [PATCH] Fix finalizer issue on non-GCable constants]
Date: Thu, 20 Mar 2014 22:04:51 +0100
User-agent: Mutt/1.4.2.3i

On Wed, Mar 19, 2014 at 02:34:39PM +0100, Christian Kellermann wrote:
> This triggered a bug in make check due to me not installing chicken,
> so our install-less make check is not complete.

We both did the wrong test: we ran with a *nonexistent* PREFIX.  Because
the runtest.sh script invokes ../csc, which builds all the test programs
with flags configured for $PREFIX, it will bake in an rpath in the
binaries.

This rpath is in PREFIX, but when this path doesn't exist, it will fail
to find libchicken.so and will then look in LD_LIBRARY_PATH for the
library.  That means it works when CHICKEN really isn't installed yet,
but if you just built a newer version which you haven't installed yet,
it'll run all the tests against the previously built CHICKEN!

The solution is very simple: just pass -rpath in the COMPILATION_OPTIONS.
This can be tested in a straightforward way:

- build and install under PREFIX "A"
- make spotless
- patch runtime.c to have panic(C_text("wrong libchicken.so!\n")); at
   the end of CHICKEN_initialize()
- build and install under PREFIX "B" (using CHICKEN under "A")
- revert patch and build again with PREFIX "B", but *don't* install
   (using CHICKEN under "A")
- run "make check"

If it accidentally loads the older libchicken, the test program shall
fail immediately (you can verify this by following the above steps with
and without the attached patch).

Cheers,
Peter
-- 
http://www.more-magic.net

Attachment: 0001-Use-rpath-for-test-binaries-to-make-install-less-tes.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]