#5147 unix: make install fails when DESTDIR is used

current: 8.6.0
closed-fixed
8
2013-01-31
2012-12-24
rofl0r
No

while doing make install, ./tclsh gets invoked. however that assumes that the dynamic linker knows the location of libtcl8.6.so

if no previous installation of tcl is available on the host, and DESTDIR is used, this shared object cannot be found, the tclsh binary not started and subsequently the build breaks.
(the dynlinker searches in /lib or /usr/lib, but when DESTDIR is e.g. /opt/tcl, it won't find any shared objects there)

thus, LD_LIBRARY_PATH must be used when invoking the tclsh binary.

as a temporary workaround:
export LD_LIBRARY_PATH=.
make install DESTDIR=xxx

makes the build succeed.

Discussion

  • Don Porter

    Don Porter - 2012-12-27

    Looks like something broken in the use of
    NATIVE_TCLSH

     
  • Don Porter

    Don Porter - 2012-12-27
    • priority: 5 --> 8
    • assigned_to: stwo --> dkf
     
  • Donal K. Fellows

    Why are you setting DESTDIR in the first place? Why not just use the --exec-prefix option to configure?

     
  • rofl0r

    rofl0r - 2012-12-28

    DESTDIR != prefix

    DESTDIR is a way for packagers to install stuff into a different location than where it will be used finally, so it doesn't clutter their build machine, and so that the can see which files are getting installed.

    in my specific case, my distribution uses prefix=/ and DESTDIR=/opt/packagename for any package that gets built.
    then a filelist of /opt/packagename is created, and all files in /opt/packagename get symlinked into / (prefix).
    this way, installing a binary package is as easy as untarring it into /opt (or some alternative location), and then call a script which creates the filelist and symlinks it into place.
    if i would use prefix for this, internal dependencies in the generated libraries and binaries would point to /opt/packagename instead of the intended prefix.

    packages using autoconf (approx 95-98% of all packages on debian) automatically provide the distinct prefix and DESTDIR functionality, which makes them very easy to handle for packagers.

    a proper Makefile which adheres to these widely accepted and used standard just install its files into $(DESTDIR)$(prefix) (note that there are no slashes)

    so the combination prefix="" (empty) and DESTDIR=/opt/tcl would install tclsh into /opt/tcl/bin
    and the line in the makefile would look like:
    install -D -m 755 tclsh $(DESTDIR)$(prefix)/bin/

     
  • Stuart Cassoff

    Stuart Cassoff - 2012-12-28

    Install shouldn't need or use *any* tclsh.
    Something's trying to build html docs maybe.

     
  • rofl0r

    rofl0r - 2012-12-28

    stwo: exactly.
    relying on the generated binary to do anything during build / installation is not good, as it will prevent from cross compilation and needs tricks like LD_LIBRARY_PATH to work at all.

    whatever tclsh does at this install step should be achieved by other portable means, or postponed to first-usage time.

     
  • Stuart Cassoff

    Stuart Cassoff - 2012-12-28

    The problem is that the install-tzdata target is the last remaining user of installData.tcl.
    I remember discussing this some time ago.
    One solution is a slightly ugly couple of loops.
    I guess I never went ahead with it because of the ugliness and that I don't normally need/use the install-tzdata target. ;)

     
  • Stuart Cassoff

    Stuart Cassoff - 2012-12-28

    Also, we probably could've arrived at the answer quicker if you'd have shown some lines from the install process where it was failing.

     
  • Donal K. Fellows

    For information: 'make html' isn't intended to *ever* be run as part of a sequence leading up to 'make install'; it's closer to the 'make dist' side of things (and is used to build the content of the HTML documentation archive that we distribute and the HTML docs we put up on www.tcl.tk). This should be clear from the fact that it's writing to a hardcoded location in /tmp/dist :-)

    Can't comment on the tzdata stuff; that's not my code at all.

     
  • Stuart Cassoff

    Stuart Cassoff - 2012-12-30

    Replacement install target that doesn't need a tclsh

     
    Attachments
  • Stuart Cassoff

    Stuart Cassoff - 2012-12-30

    I've attached code to do the install sans tclsh.
    It's not pretty but it does the job.
    Improvements welcome :)

     
  • rofl0r

    rofl0r - 2012-12-30

    thanks, this looks very well (apart from mixed spaces/tabs which mess up the indentation)

     
  • Stuart Cassoff

    Stuart Cassoff - 2013-01-27

    I'd like to wrap this up in a few days.
    Soliciting suggestions for better scripting; it's not my forte.

     
  • Alexandre Ferrieux

    Looks perfectly okay to me. Maybe move it out to a separate script file instead of makefile-inlining, for readability. But that's personal taste ;)

     
  • Stuart Cassoff

    Stuart Cassoff - 2013-01-31
    • assigned_to: dkf --> stwo
    • status: open --> closed-fixed
     
  • Stuart Cassoff

    Stuart Cassoff - 2013-01-31

    Fixed in [70995bd619] (trunk) and [0f098031c3] (core-8-5-branch).
    There are no longer any users of installData.tcl in unix/Makefile.in.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks