[PATCH] fix runtests to set LD_LIBRARY_PATH environment variable

David Terei davidterei at gmail.com
Fri Jan 25 02:33:59 CET 2013


Committed. Thanks!

On 24 January 2013 13:28, Karel Gardas <karel.gardas at centrum.cz> wrote:
> This patch follows Windows and Darwin way of setting environment variable
> to set the file-system paths to GHC's shared libraries. It does the same
> thing for any other OS, which should be Unix-like OS presumably. This
> patch fixes a lot of `dyn' tests failures on Solaris which fail with following
> error message:
> Failed to open shared library: ld.so.1: T3807-load: fatal: libffi.so.6: open failed: No such file or directory
> ---
>  driver/runtests.py |   48 ++++++++++++++++++++++++++----------------------
>  1 files changed, 26 insertions(+), 22 deletions(-)
>
> diff --git a/driver/runtests.py b/driver/runtests.py
> index 66e3bf4..16deda6 100644
> --- a/driver/runtests.py
> +++ b/driver/runtests.py
> @@ -181,28 +181,32 @@ from testlib import *
>
>  # On Windows we need to set $PATH to include the paths to all the DLLs
>  # in order for the dynamic library tests to work.
> -if windows or darwin:
> -    pkginfo = getStdout([config.ghc_pkg, 'dump'])
> -    topdir = config.libdir
> -    for line in pkginfo.split('\n'):
> -        if line.startswith('library-dirs:'):
> -            path = line.rstrip()
> -            path = re.sub('^library-dirs: ', '', path)
> -            path = re.sub('\\$topdir', topdir, path)
> -            if path.startswith('"'):
> -                path = re.sub('^"(.*)"$', '\\1', path)
> -                path = re.sub('\\\\(.)', '\\1', path)
> -            if windows:
> -                if config.cygwin:
> -                    # On cygwin we can't put "c:\foo" in $PATH, as : is a
> -                    # field separator. So convert to /cygdrive/c/foo instead.
> -                    # Other pythons use ; as the separator, so no problem.
> -                    path = re.sub('([a-zA-Z]):', '/cygdrive/\\1', path)
> -                    path = re.sub('\\\\', '/', path)
> -                os.environ['PATH'] = os.pathsep.join([path, os.environ.get("PATH", "")])
> -            else:
> -                # darwin
> -                os.environ['DYLD_LIBRARY_PATH'] = os.pathsep.join([path, os.environ.get("DYLD_LIBRARY_PATH", "")])
> +# if windows or darwin:
> +pkginfo = getStdout([config.ghc_pkg, 'dump'])
> +topdir = config.libdir
> +for line in pkginfo.split('\n'):
> +    if line.startswith('library-dirs:'):
> +        path = line.rstrip()
> +        path = re.sub('^library-dirs: ', '', path)
> +        path = re.sub('\\$topdir', topdir, path)
> +        if path.startswith('"'):
> +            path = re.sub('^"(.*)"$', '\\1', path)
> +            path = re.sub('\\\\(.)', '\\1', path)
> +        if windows:
> +            if config.cygwin:
> +                # On cygwin we can't put "c:\foo" in $PATH, as : is a
> +                # field separator. So convert to /cygdrive/c/foo instead.
> +                # Other pythons use ; as the separator, so no problem.
> +                path = re.sub('([a-zA-Z]):', '/cygdrive/\\1', path)
> +                path = re.sub('\\\\', '/', path)
> +            os.environ['PATH'] = os.pathsep.join([path, os.environ.get("PATH", "")])
> +        elif darwin:
> +            # darwin
> +            os.environ['DYLD_LIBRARY_PATH'] = os.pathsep.join([path, os.environ.get("DYLD_LIBRARY_PATH", "")])
> +        else:
> +            # unix
> +            os.environ['LD_LIBRARY_PATH'] = os.pathsep.join([path, os.environ.get("LD_LIBRARY_PATH", "")])
> +
>
>  global testopts_local
>  testopts_local.x = TestOptions()
> --
> 1.7.3.2
>
>
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs



More information about the ghc-devs mailing list