Linux/MacOS: Moving zorba breaks module import

Bug #867139 reported by Chris Hillery
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
New
Medium
Chris Hillery

Bug Description

Modules in Zorba are looked up on the module-path. Zorba has a built-in default module path which has two hard-coded paths on it: URI_PATH in the build directory, and share/zorba-2.0.0/modules in the installation directory. Both are absolute paths.

This means that if you build and install Zorba, you cannot move it to another location, because it won't be able to find its own built-in modules. It also means that we can't ship a .zip or something like it for users to install Zorba in their home directories.

There's a secondary problem related to this: the installation directory path is the first one on the default module path. That means that are you build and install Zorba, the zorba in your build directory is potentially broken or weird, because it will load modules from the installed Zorba which may or may not be compatible. On MacOS this problem is much more severe: Because the installed module .dylibs point to the absolute path of the installed libzorba, loading those modules will cause the build directory zorba to crash.

The right answer, IMHO, is to not have a hard-coded compile-time default module path, but instead populate the default module path at runtime in some fashion. The best way would be to populate it with paths relative to the location of libzorba. This is in fact already done on Windows. On Linux, it seems like discovering the filesystem location of libzorba will require reading the /proc filesystem or something similar. On MacOS, it's not clear how to achieve this, unless Zorba is installed as a framework in which case I believe it's fairly easy to get access to everything.

tags: removed: v2.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.