Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017 Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
<== Date ==> <== Thread ==>

Subject: Re: EPICS build system DESTDIR support
From: Andrew Johnson <anj@aps.anl.gov>
To: "J. Lewis Muir" <jlmuir@imca-cat.org>
Cc: tech-talk@aps.anl.gov
Date: Wed, 5 Jul 2017 15:22:59 -0500
On 07/05/2017 12:25 PM, J. Lewis Muir wrote:
> On 07/05, Andrew Johnson wrote:
>> On 06/20/2017 03:38 PM, J. Lewis Muir wrote:
>>> So, even if DYLD_LIBRARY_PATH was set, it might get removed from the
>>> executable's environment by SIP depending on how it gets executed.
>>
>> That quotation is discussing launching processes inside a bundle. I
>> don't think we would do that — I'm not a MacOS expert, but we don't
>> create an EPICS Base bundle for the Mac, so that seems irrelevant to me.
> 
> I don't think so.  Just invoking /bin/sh from a shell exhibits the
> purging of the DYLD_LIBRARY_PATH environment variable.  Consider the
> following (on macOS Sierra):
> 
> ===
> % export DYLD_LIBRARY_PATH=a
> % echo $DYLD_LIBRARY_PATH
> a
> % export MY_VAR=b
> % echo $MY_VAR
> b
> % /bin/sh -c 'echo $DYLD_LIBRARY_PATH'
> 
> % /bin/sh -c 'echo $MY_VAR'
> b
> ===

Ok, I see that they protect some binaries such as /bin/sh and
/usr/bin/perl from inheriting variables such as that path, but I'm not
sure that this really affects the EPICS build system. Let's not worry
about that for now though because...

I just built Base-3.15.5 on darwin-x86 with LINKER_USE_RPATH = NO and I
see that there isn't actually any difference in the link command-line or
the generated binaries, and running 'otool -L' against the output still
finds the shared libraries. Apparently we only implemented that flag for
Linux, Solaris and FreeBSD and there doesn't appear to be a way of
setting the runtime search path at link time anyway, but then MacOS has
its own solution to this whole issue of installing stuff which we don't
currently use for darwin builds at all.

The manpage for 'dyld' gives all kinds of interesting information which
is probably relevant, but would need someone to spend time looking at.
Maybe EPICS Base could be distributed for MacOS as a Library Framework
(/Library/Frameworks/EPICSBase.framework/...)?

To be honest I suspect that for MacOS it might be simpler to use an
external script (not part of Base) for preparing a binary EPICS Base
distribution. I would first build Base with INSTALL_LOCATION pointing
somewhere (anywhere), and that directory tree becomes what gets packaged
up. It should also have FINAL_LOCATION set so the softIoc knows where
where its DBD and DB files will be after installation. The script would
go through the bin/darwin-x86 and lib/darwin-x86 directories and use the
MacOS install_name_tool program to adjust each binary to set the library
search path to the final location.

That should solve the problem for MacOS. For packaging a Linux we
already have the LINKER_USE_RPATH = NO approach, the package would have
to install a file in /etc/ld.so.conf.d/ that points to the install
lib/<arch> directory, thus making the shared libraries available through
the standard dynamic loader search path. I'm sure that's what the Debian
packaging already does.

Neither of those would actually let you set DESTDIR for building though,
so this doesn't solve your original/question, sorry!

- Andrew

-- 
Arguing for surveillance because you have nothing to hide is no
different than making the claim, "I don't care about freedom of
speech because I have nothing to say." -- Edward Snowdon

Replies:
Re: EPICS build system DESTDIR support J. Lewis Muir
References:
Re: EPICS build system DESTDIR support J. Lewis Muir
Re: EPICS build system DESTDIR support Andrew Johnson
Re: EPICS build system DESTDIR support J. Lewis Muir

Navigate by Date:
Prev: Re: EPICS build system DESTDIR support J. Lewis Muir
Next: New releases of many areaDetector modules Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
Navigate by Thread:
Prev: Re: EPICS build system DESTDIR support J. Lewis Muir
Next: Re: EPICS build system DESTDIR support J. Lewis Muir
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <2017
ANJ, 05 Jul 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·