Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac Binary distribution contains hardcoded absolute paths #11681

Closed
alexanderdreyer mannequin opened this issue Aug 12, 2011 · 11 comments
Closed

Mac Binary distribution contains hardcoded absolute paths #11681

alexanderdreyer mannequin opened this issue Aug 12, 2011 · 11 comments

Comments

@alexanderdreyer
Copy link
Mannequin

alexanderdreyer mannequin commented Aug 12, 2011

At least the following image:
http://boxen.math.washington.edu/sage/osx/intel/sage-4.7-OSX-64bit-10.6-i386-Darwin.dmg
is defect. The build contains hardcode absolute paths the dynamic libs, e.g. something like libpng12.dynlib is looked up at /Users/buildbot/build....

This makes it impossible to install spkgs which depend on libraries delivered by Sage. For instance, the spkg/patch from #11575 builds and installs, but is corrupted afterwards.

Component: build

Keywords: Mac build paths

Reviewer: Jeroen Demeyer

Issue created by migration from https://trac.sagemath.org/ticket/11681

@alexanderdreyer alexanderdreyer mannequin added this to the sage-5.11 milestone Aug 12, 2011
@alexanderdreyer alexanderdreyer mannequin added c: build labels Aug 12, 2011
@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 12, 2011

comment:1

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 ($SAGE_ROOT).

In principle all shared libraries should have relative RUNPATHs. AFAIK currently most just use the library name (i.e., no [absolute] path), but rely on LD_LIBRARY_PATH (DYLD_LIBRARY_PATH on Darwin) instead.

For ELF on UNIX / Linux etc., there is a tool chrpath (change run path) to (partially) fix such things in already built libraries and executables; I don't know if there's something similar available on Darwin.

@sagetrac-GeorgSWeber
Copy link
Mannequin

sagetrac-GeorgSWeber mannequin commented Aug 13, 2011

comment:2

The counterpart of "chrpath" on OS X is called "install_name_tool", FWIW.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 13, 2011

comment:3

Alexander, just curious:

How does your $SAGE_ROOT/local/lib/pkgconfig/libpng12.pc file look like (especially the first line)?

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 13, 2011

comment:4

(Any definition of SAGE_ROOT in local/lib/pkgconfig/*.pc can and should be removed.)

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 14, 2011

comment:5

Replying to @nexttime:

(Any definition of SAGE_ROOT in local/lib/pkgconfig/*.pc can and should be removed.)

I'm meanwhile no longer sure about that, since (to me) it looks as if pkg-config's behaviour has changed.

The following is definitely invalid and should be removed:

(I've seen this as a result of a build from scratch; reinstalling e.g. libpng12 cured this.)

SAGE_ROOT=${SAGE_ROOT}

The following are both ok (at least until the Sage installation moves, which sage will notice upon start-up, then correcting / updating the path in the .pc files):

prefix=/current/path/to/SAGE_ROOT/local
...
SAGE_ROOT=/current/path/to/SAGE_ROOT
prefix=${SAGE_ROOT}/local
...

Unfortunately, the correction of the paths in .pc files (as performed by sage-location) isn't fully reliable at the moment, as the first example above shows.

Furthermore, sage-env is broken in that it currently only sets (i.e., "overwrites") PKG_CONFIG_PATH to $SAGE_ROOT/local/lib/pkgconfig/ if it is empty / undefined, instead of also prepending Sage's pkg-config directory otherwise.

This means that PKG_CONFIG_PATH should currently be unset (outside of the Sage environment) before installing or rebuilding any package.

@kcrisman
Copy link
Member

comment:6

Unfortunately, the correction of the paths in .pc files (as performed by sage-location) isn't fully reliable at the moment, as the first example above shows.

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?

@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.3, sage-6.4 Aug 10, 2014
@kcrisman
Copy link
Member

comment:11

Is this still an issue?

@jdemeyer
Copy link

comment:12

Obsolete by the new binary packaging.

@jdemeyer
Copy link

Reviewer: Jeroen Demeyer

@kcrisman
Copy link
Member

comment:14

Really, are you sure there no "buildbot" or "buildslave" things? I note that we still occasionally get such questions on ask.sagemath.

@jdemeyer
Copy link

comment:15

Replying to @kcrisman:

I note that we still occasionally get such questions on ask.sagemath.

For recent versions of SageMath?

If so, open a Trac ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants