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

relocatable installation #304

Open
bukzor opened this issue Nov 29, 2019 · 5 comments
Open

relocatable installation #304

bukzor opened this issue Nov 29, 2019 · 5 comments
Labels

Comments

@bukzor
Copy link

bukzor commented Nov 29, 2019

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

@xdelaruelle
Copy link
Member

Nice idea. I would suggest to have a configure option for it: --enable-relocatable (seems to be the most common name for this). When set, the paths that are replaced in the various files, when running make, are set to relative paths rather absolute.

So this change would in principle only touch makefiles and the configure script. Some new specific make rules may be needed though, as the etcdir value for instance may be different in files to translate as these files are installed in different directories.

@zerothi

This comment has been minimized.

@RobyB
Copy link

RobyB commented Feb 15, 2021 via email

@xdelaruelle
Copy link
Member

@RobyB I suggested to have a configure option as from my understanding relocatable installation goes against reproducible installation where people want to fully qualify every paths.

@zerothi DESTDIR is already supported (used for instance in RPM spec file)

@zerothi

This comment has been minimized.

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

No branches or pull requests

4 participants