Skip to content

relocatable installation #304

Open
Open
@bukzor

Description

@bukzor

Currently modules hard-codes many paths into its source and implementation before it's installed. If that installation is moved, it's broken. This is problematic for various packaging systems, especially those that make aggressive use of caching (the ones I care about are: pypi, homebrew).

Let's make the modules installation relocatable. This means we can move the installation and it continues to work. What's more, a package manager can make a tarball of an "installed" environment-modules, then use (and reuse) that tarball whenever (and whereever) environment-modules is installed.

I'll be hacking away at this task in a personal branch, but if you'd give me any pointers as to how to make this most palatable to merging upstream (to your branch), it would be most welcome.

In general, my strategy is to use the current code to embed absolute paths, but convert them to prefix-relative paths before they're used. In this way, I can ./configure --prefix=$olddir; make; make install; mv $olddir $newdir, and although $olddir/bin is still hard-coded various places, the system will work because there's an intermediate conversion that uses prefix=$olddir and bindir=$olddir/bin to generate a relative path $MYPREFIX/bin

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions