Skip to content
Merged
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
16 changes: 12 additions & 4 deletions easybuild/easyblocks/b/bazel.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,15 @@ def extra_options():
return EasyBlock.extra_options(extra_vars)

def fixup_hardcoded_paths(self):
"""Patch out hard coded paths to compiler and binutils tools"""
"""Patch out hard coded paths to /tmp, compiler and binutils tools"""
# replace hardcoded /tmp in java build scripts
regex_subs = [
(r'`mktemp -d /tmp/tmp.XXXXXXXXXX`', '$$(mktemp -d $${TMPDIR:-/tmp}/tmp.XXXXXXXXXX)'),
]
filepath = os.path.join('src', 'main', 'java', 'com', 'google', 'devtools', 'build', 'lib', 'BUILD')
if os.path.exists(filepath):
apply_regex_substitutions(filepath, regex_subs)

binutils_root = get_software_root('binutils')
gcc_root = get_software_root('GCCcore') or get_software_root('GCC')
gcc_ver = get_software_version('GCCcore') or get_software_version('GCC')
Expand Down Expand Up @@ -123,9 +131,9 @@ def extract_step(self):
def configure_step(self):
"""Custom configuration procedure for Bazel."""

# Last instance of hardcoded paths was removed in 0.24.0
if LooseVersion(self.version) < LooseVersion('0.24.0'):
self.fixup_hardcoded_paths()
# Last instance of hardcoded compiler/binutils paths was removed in 0.24.0, however
# hardcoded /tmp affects all versions
self.fixup_hardcoded_paths()

# Keep temporary directory in case of error. EB will clean it up on success
apply_regex_substitutions(os.path.join('scripts', 'bootstrap', 'buildenv.sh'), [
Expand Down