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

fix offline installation of EasyBuild #333

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 16 additions & 15 deletions components/dev-tools/easybuild/SOURCES/bootstrap_eb.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,20 +585,22 @@ def stage2(tmpdir, templates, install_path, distribute_egg_dir, sourcepath):
print('\n')
info("+++ STAGE 2: installing EasyBuild in %s with EasyBuild from stage 1...\n" % install_path)

if distribute_egg_dir is None:
preinstallopts = ''
else:
# inject path to distribute installed in stage 1 into $PYTHONPATH via preinstallopts
# other approaches are not reliable, since EasyBuildMeta easyblock unsets $PYTHONPATH;
preinstallopts = "export PYTHONPATH=%s:$PYTHONPATH && " % distribute_egg_dir

# ensure that (latest) setuptools is installed as well alongside EasyBuild,
# since it is a required runtime dependency for recent vsc-base and EasyBuild versions
# this is necessary since we provide our own distribute installation during the bootstrap (cfr. stage0)
preinstallopts += "easy_install -U --prefix %(installdir)s setuptools && "
preinstallopts = ''

if distribute_egg_dir is not None:
# ensure that (latest) setuptools is installed as well alongside EasyBuild,
# since it is a required runtime dependency for recent vsc-base and EasyBuild versions
# this is necessary since we provide our own distribute installation during the bootstrap (cfr. stage0)
preinstallopts += "easy_install -U --prefix %(installdir)s setuptools && "

# vsc-install is a runtime dependency for the EasyBuild unit test suite,
# and is easily picked up from stage1 rather than being actually installed, so force it
preinstallopts += "easy_install -U --prefix %(installdir)s vsc-install && "
vsc_install_tarball_paths = glob.glob(os.path.join(sourcepath, 'vsc-install*.tar.gz'))
if len(vsc_install_tarball_paths) == 1:
vsc_install = vsc_install_tarball_paths[0]
else:
vsc_install = 'vsc-install'
preinstallopts += "easy_install -U --prefix %%(installdir)s %s && " % vsc_install

templates.update({
'preinstallopts': preinstallopts,
Expand Down Expand Up @@ -823,8 +825,8 @@ def main():
# >>> base64.b64encode(zlib.compress(open("distribute_setup.py").read()))
# compressed copy below is for setuptools 0.6c11, after applying patch:
#
# --- distribute_setup.py.orig 2013-07-05 03:50:13.000000000 +0200
# +++ distribute_setup.py 2015-11-27 12:20:12.040032041 +0100
# --- distribute_setup.py.orig 2013-07-05 03:50:13.000000000 +0200
# +++ distribute_setup.py 2015-11-27 12:20:12.040032041 +0100
# @@ -528,6 +528,8 @@
# log.warn("--user requires Python 2.6 or later")
# raise SystemExit(1)
Expand Down Expand Up @@ -949,4 +951,3 @@ def main():

# run main function as body of script
main()

3 changes: 2 additions & 1 deletion components/dev-tools/easybuild/SPECS/easybuild.spec
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ export EASYBUILD_BOOTSTRAP_SOURCEPATH=%{_sourcedir}
export EASYBUILD_BOOTSTRAP_DEBUG=1
export DEBUG_EASYBUILD_OPTIONS=1
export EASYBUILD_INSTALLPATH=%{install_path}
export EB_VERSION=%{version}
export PATH=${LMOD_DIR}:${PATH}
# note: $EB_VERSION and $PYTHON_VERSION are only required because of bootstrap_eb.py-apply-patch.patch
export EB_VERSION=%{version}
export PYTHON_VERSION=`python -c 'print ".".join(map(str, __import__("sys").version_info[:2]))'`

MODULEPATH= python ./bootstrap_eb.py %{buildroot}/%{install_path}
Expand Down