Skip to content

Commit

Permalink
Merge pull request #333 from boegel/ophc12_fix_offline_eb_bootstrap
Browse files Browse the repository at this point in the history
fix offline installation of EasyBuild
  • Loading branch information
crbaird authored Nov 8, 2016
2 parents 6d93527 + a73cec4 commit 2e2cb8f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
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

0 comments on commit 2e2cb8f

Please sign in to comment.