Sage: Ticket #11681: Mac Binary distribution contains hardcoded absolute paths
https://trac.sagemath.org/ticket/11681
<p>
At least the following image:
<a class="ext-link" href="http://boxen.math.washington.edu/sage/osx/intel/sage-4.7-OSX-64bit-10.6-i386-Darwin.dmg"><span class="icon"></span>http://boxen.math.washington.edu/sage/osx/intel/sage-4.7-OSX-64bit-10.6-i386-Darwin.dmg</a>
is defect. The build contains hardcode *absolute* paths the dynamic libs, e.g. something like <code>libpng12.dynlib</code> is looked up at <code>/Users/buildbot/build...</code>.
</p>
<p>
This makes it impossible to install spkgs which depend on libraries delivered by Sage. For instance, the spkg/patch from <a class="closed ticket" href="https://trac.sagemath.org/ticket/11575" title="enhancement: Update PolyBoRi to release 0.8.0 (closed: fixed)">#11575</a> builds and installs, but is corrupted afterwards.
</p>
en-usSagehttps://trac.sagemath.org/chrome/site/logo_sagemath_trac.png
https://trac.sagemath.org/ticket/11681
Trac 1.1.6leifFri, 12 Aug 2011 12:45:40 GMT
https://trac.sagemath.org/ticket/11681#comment:1
https://trac.sagemath.org/ticket/11681#comment:1
<p>
An ugly work-around is to create the original build directory (which ordinary users may not be able to), and make it a symbolic link to the new location (<code>$SAGE_ROOT</code>).
</p>
<p>
In principle all shared libraries should have relative <code>RUNPATH</code>s. AFAIK currently most just use the library name (i.e., no [absolute] path), but rely on <code>LD_LIBRARY_PATH</code> (<code>DYLD_LIBRARY_PATH</code> on Darwin) instead.
</p>
<p>
For ELF on UNIX / Linux etc., there is a tool <code>chrpath</code> (<em>change run path</em>) to (partially) fix such things in already built libraries and executables; I don't know if there's something similar available on Darwin.
</p>
TicketGeorgSWeberSat, 13 Aug 2011 14:51:41 GMT
https://trac.sagemath.org/ticket/11681#comment:2
https://trac.sagemath.org/ticket/11681#comment:2
<p>
The counterpart of "chrpath" on OS X is called "install_name_tool", FWIW.
</p>
TicketleifSat, 13 Aug 2011 16:55:50 GMT
https://trac.sagemath.org/ticket/11681#comment:3
https://trac.sagemath.org/ticket/11681#comment:3
<p>
Alexander, just curious:
</p>
<p>
How does your <code>$SAGE_ROOT/local/lib/pkgconfig/libpng12.pc</code> file look like (especially the first line)?
</p>
TicketleifSat, 13 Aug 2011 17:01:10 GMT
https://trac.sagemath.org/ticket/11681#comment:4
https://trac.sagemath.org/ticket/11681#comment:4
<p>
(<strong>Any</strong> definition of <code>SAGE_ROOT</code> in <code>local/lib/pkgconfig/*.pc</code> can and should be removed.)
</p>
TicketleifSun, 14 Aug 2011 02:45:08 GMT
https://trac.sagemath.org/ticket/11681#comment:5
https://trac.sagemath.org/ticket/11681#comment:5
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/11681#comment:4" title="Comment 4">leif</a>:
</p>
<blockquote class="citation">
<p>
(<strong>Any</strong> definition of <code>SAGE_ROOT</code> in <code>local/lib/pkgconfig/*.pc</code> can and should be removed.)
</p>
</blockquote>
<p>
I'm meanwhile no longer sure about that, since (to me) it looks as if <code>pkg-config</code>'s behaviour has changed.
</p>
<p>
The following is definitely invalid and should be removed: <br />
(I've seen this as a result of a build from scratch; reinstalling e.g. <code>libpng12</code> cured this.)
</p>
<pre class="wiki">SAGE_ROOT=${SAGE_ROOT}
</pre><p>
The following are both ok (at least until the Sage installation moves, which <code>sage</code> will notice upon start-up, then correcting / updating the path in the <code>.pc</code> files):
</p>
<pre class="wiki">prefix=/current/path/to/SAGE_ROOT/local
...
</pre><pre class="wiki">SAGE_ROOT=/current/path/to/SAGE_ROOT
prefix=${SAGE_ROOT}/local
...
</pre><hr />
<p>
Unfortunately, the correction of the paths in <code>.pc</code> files (as performed by <code>sage-location</code>) isn't fully reliable at the moment, as the first example above shows.
</p>
<p>
Furthermore, <code>sage-env</code> is broken in that it currently only <strong>sets</strong> (i.e., "overwrites") <code>PKG_CONFIG_PATH</code> to <code>$SAGE_ROOT/local/lib/pkgconfig/</code> <em>if it is empty</em> / undefined, instead of also prepending Sage's <code>pkg-config</code> directory otherwise. <br />
This means that <code>PKG_CONFIG_PATH</code> should currently be unset (outside of the Sage environment) before installing or rebuilding any package.
</p>
TicketkcrismanWed, 17 Aug 2011 16:30:39 GMT
https://trac.sagemath.org/ticket/11681#comment:6
https://trac.sagemath.org/ticket/11681#comment:6
<blockquote class="citation">
<p>
Unfortunately, the correction of the paths in <code>.pc</code> files (as performed by <code>sage-location</code>) isn't fully reliable at the moment, as the first example above shows.
</p>
</blockquote>
<p>
As you know, this causes problems elsewhere as well. Is there a way to grep through this particular one and find all the places this is a problem?
</p>
TicketjdemeyerTue, 13 Aug 2013 15:35:53 GMTmilestone changed
https://trac.sagemath.org/ticket/11681#comment:7
https://trac.sagemath.org/ticket/11681#comment:7
<ul>
<li><strong>milestone</strong>
changed from <em>sage-5.11</em> to <em>sage-5.12</em>
</li>
</ul>
Ticketvbraun_spamThu, 30 Jan 2014 21:20:52 GMTmilestone changed
https://trac.sagemath.org/ticket/11681#comment:8
https://trac.sagemath.org/ticket/11681#comment:8
<ul>
<li><strong>milestone</strong>
changed from <em>sage-6.1</em> to <em>sage-6.2</em>
</li>
</ul>
Ticketvbraun_spamTue, 06 May 2014 15:20:58 GMTmilestone changed
https://trac.sagemath.org/ticket/11681#comment:9
https://trac.sagemath.org/ticket/11681#comment:9
<ul>
<li><strong>milestone</strong>
changed from <em>sage-6.2</em> to <em>sage-6.3</em>
</li>
</ul>
Ticketvbraun_spamSun, 10 Aug 2014 16:51:03 GMTmilestone changed
https://trac.sagemath.org/ticket/11681#comment:10
https://trac.sagemath.org/ticket/11681#comment:10
<ul>
<li><strong>milestone</strong>
changed from <em>sage-6.3</em> to <em>sage-6.4</em>
</li>
</ul>
TicketkcrismanThu, 22 Jan 2015 20:00:36 GMT
https://trac.sagemath.org/ticket/11681#comment:11
https://trac.sagemath.org/ticket/11681#comment:11
<p>
Is this still an issue?
</p>
TicketjdemeyerMon, 11 Apr 2016 10:03:28 GMTstatus, milestone changed; reviewer set
https://trac.sagemath.org/ticket/11681#comment:12
https://trac.sagemath.org/ticket/11681#comment:12
<ul>
<li><strong>status</strong>
changed from <em>new</em> to <em>needs_review</em>
</li>
<li><strong>reviewer</strong>
set to <em>Jeroen Demeyer</em>
</li>
<li><strong>milestone</strong>
changed from <em>sage-6.4</em> to <em>sage-duplicate/invalid/wontfix</em>
</li>
</ul>
<p>
Obsolete by the new binary packaging.
</p>
TicketjdemeyerMon, 11 Apr 2016 10:03:33 GMTstatus changed
https://trac.sagemath.org/ticket/11681#comment:13
https://trac.sagemath.org/ticket/11681#comment:13
<ul>
<li><strong>status</strong>
changed from <em>needs_review</em> to <em>positive_review</em>
</li>
</ul>
TicketkcrismanMon, 11 Apr 2016 14:28:14 GMT
https://trac.sagemath.org/ticket/11681#comment:14
https://trac.sagemath.org/ticket/11681#comment:14
<p>
Really, are you sure there no "buildbot" or "buildslave" things? I note that we still occasionally get such questions on ask.sagemath.
</p>
TicketjdemeyerMon, 11 Apr 2016 14:48:18 GMT
https://trac.sagemath.org/ticket/11681#comment:15
https://trac.sagemath.org/ticket/11681#comment:15
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/11681#comment:14" title="Comment 14">kcrisman</a>:
</p>
<blockquote class="citation">
<p>
I note that we still occasionally get such questions on ask.sagemath.
</p>
</blockquote>
<p>
For recent versions of <a class="wiki" href="https://trac.sagemath.org/wiki/SageMath">SageMath</a>?
</p>
<p>
If so, open a Trac ticket.
</p>
TicketvbraunSun, 12 Jun 2016 12:02:30 GMTstatus changed; resolution set
https://trac.sagemath.org/ticket/11681#comment:16
https://trac.sagemath.org/ticket/11681#comment:16
<ul>
<li><strong>status</strong>
changed from <em>positive_review</em> to <em>closed</em>
</li>
<li><strong>resolution</strong>
set to <em>fixed</em>
</li>
</ul>
Ticket