Ticket #10 (assigned enhancement)

Opened 22 months ago

Last modified 8 weeks ago

Installing in a non-standard location (PREFIX not working)

Reported by: reid@… Owned by: artem
Priority: major Milestone: 1.0.0
Component: PostGIS Input Driver Version:
Severity: Blocker Keywords: scons
Cc: Patch Needs Improvement: no
Needs Docmentation: no Has Patch?: no
Design Decision Needed: no

Description

This ticket describes problems installing in a non-standard location as a non-root user; /tmp/mapnik fills in for the real installation location.

The desired installation would be as follows, and it should obtainable by specifying a single parameter (preferably "prefix" since that is what other build systems use).

xx [reid@magnify mapnik-src]$ find /tmp/mapnik -xtype d
/tmp/mapnik
/tmp/mapnik/bin
/tmp/mapnik/include
/tmp/mapnik/include/mapnik
/tmp/mapnik/lib
/tmp/mapnik/lib/mapnik
/tmp/mapnik/lib/mapnik/input
/tmp/mapnik/lib/mapnik/fonts
/tmp/mapnik/lib/python2.4
/tmp/mapnik/lib/python2.4/site-packages
/tmp/mapnik/lib/python2.4/site-packages/mapnik
/tmp/mapnik/lib/python2.4/site-packages/mapnik/ogcserver

(a) With python scons/scons.py PREFIX=/tmp/mapnik install, the build fails. (Note also that the error message is misleading: a missing file is only a symptom; the real reason the build failed is that I don't have permission to write to the directory it's trying to install into.)

63 [reid@magnify mapnik-src]$ python scons/scons.py PREFIX=/tmp/mapnik install
scons: Reading SConscript files ...
Checking for main() in C library m... yes
Checking for main() in C library ltdl... yes
Checking for main() in C library png... yes
Checking for main() in C library tiff... yes
Checking for main() in C library z... yes
Checking for main() in C library jpeg... yes
Checking for main() in C library proj... yes
Checking for main() in C library pq... no
Checking for main() in C++ library boost_thread... yes
Checking for main() in C++ library boost_filesystem... yes
Checking for main() in C++ library boost_regex... yes
Checking for main() in C++ library boost_program_options... yes
Bindings Python version... 2.4
Python 2.4 prefix... /usr
scons: done reading SConscript files.
scons: Building targets ...
Install file: "bindings/python/mapnik/paths.py" as "/usr/lib/python2.4/site-packages/mapnik/paths.py"
scons: *** [/usr/lib/python2.4/site-packages/mapnik/paths.py] Exception
Traceback (most recent call last):
  File "/tmp/mapnik-src/scons/scons-local-0.96.1/SCons/Taskmaster.py", line 101, in execute
    self.targets[0].build()
  File "/tmp/mapnik-src/scons/scons-local-0.96.1/SCons/Node/__init__.py", line 201, in build
    apply(executor, (self, errfunc), kw)
  File "/tmp/mapnik-src/scons/scons-local-0.96.1/SCons/Executor.py", line 115, in __call__
    apply(action, (self.targets, self.sources, env, errfunc), kw)
  File "/tmp/mapnik-src/scons/scons-local-0.96.1/SCons/Action.py", line 243, in __call__
    stat = self.execute(target, source, env)
  File "/tmp/mapnik-src/scons/scons-local-0.96.1/SCons/Action.py", line 512, in execute
    return self.execfunction(target=target, source=rsources, env=env)
  File "/tmp/mapnik-src/scons/scons-local-0.96.1/SCons/Environment.py", line 82, in installFunc
    return install(target[0].path, source[0].path, env)
  File "/tmp/mapnik-src/scons/scons-local-0.96.1/SCons/Defaults.py", line 219, in copyFunc
    shutil.copy2(source, dest)
  File "/usr/lib/python2.4/shutil.py", line 92, in copy2
    copyfile(src, dst)
  File "/usr/lib/python2.4/shutil.py", line 48, in copyfile
    fdst = open(dst, 'wb')
IOError: [Errno 2] No such file or directory: '/usr/lib/python2.4/site-packages/mapnik/paths.py'
scons: building terminated because of errors.

(c) With python scons/scons.py DESTDIR=/tmp/mapnik install, the build succeeds, but the installation has extra /usr and /usr/local subpaths:

67 [reid@magnify mapnik-src]$ find /tmp/mapnik -xtype d
/tmp/mapnik
/tmp/mapnik/usr
/tmp/mapnik/usr/lib
/tmp/mapnik/usr/lib/python2.4
/tmp/mapnik/usr/lib/python2.4/site-packages
/tmp/mapnik/usr/lib/python2.4/site-packages/mapnik
/tmp/mapnik/usr/lib/python2.4/site-packages/mapnik/ogcserver
/tmp/mapnik/usr/local
/tmp/mapnik/usr/local/bin
/tmp/mapnik/usr/local/lib
/tmp/mapnik/usr/local/lib/mapnik
/tmp/mapnik/usr/local/lib/mapnik/input
/tmp/mapnik/usr/local/lib/mapnik/fonts
/tmp/mapnik/usr/local/include
/tmp/mapnik/usr/local/include/mapnik

(c) With python scons/scons.py PREFIX=/tmp/mapnik DESTDIR=/ install, the build fails in the same way as (a).

(d) With python scons/scons.py PREFIX=/ DESTDIR=/tmp/mapnik install, the build succeeds, but the extra /usr subpaths are still present:

72 [reid@magnify mapnik-src]$ find /tmp/mapnik -xtype d
/tmp/mapnik
/tmp/mapnik/usr
/tmp/mapnik/usr/lib
/tmp/mapnik/usr/lib/python2.4
/tmp/mapnik/usr/lib/python2.4/site-packages
/tmp/mapnik/usr/lib/python2.4/site-packages/mapnik
/tmp/mapnik/usr/lib/python2.4/site-packages/mapnik/ogcserver
/tmp/mapnik/bin
/tmp/mapnik/lib
/tmp/mapnik/lib/mapnik
/tmp/mapnik/lib/mapnik/input
/tmp/mapnik/lib/mapnik/fonts
/tmp/mapnik/include
/tmp/mapnik/include/mapnik

Change History

Changed 22 months ago by artem

  • status changed from new to assigned
  • milestone set to 0.4.0

Changed 21 months ago by artem

  • milestone 0.4.0 deleted

Changed 20 months ago by reid@…

Scenario (d) seems to fail later in my Python script with:

Traceback (most recent call last):
  File "/export/scratch/reid/cyclingproject/scripts/tilecache_update.py", line 17, in ?
    from mapnik import *
  File "/export/scratch/reid/python/lib/python2.4/site-packages/mapnik/__init__.py", line 86, in ?
    DatasourceCache.instance().register_datasources('%s' % inputpluginspath)
RuntimeError: boost::filesystem::path: invalid name "/lib" in path: "//lib/mapnik/input"

Changed 15 months ago by artem

  • summary changed from fixme to Installing in a non-standard location

Changed 11 months ago by david

  • keywords scons added

Changed 8 weeks ago by springmeyer

  • priority set to major

Reid, Is this issue still present in SVN HEAD?

Changed 8 weeks ago by springmeyer

  • summary changed from Installing in a non-standard location to Installing in a non-standard location (PREFIX not working)

A related patch is found in Ticket #48.

Changed 8 weeks ago by springmeyer

  • has_patch unset
  • milestone changed from 0.5.0 to 1.0.0
  • patch_need_improvement unset
  • need_documentation unset
  • design_decision_needed unset
Note: See TracTickets for help on using tickets.