Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
easybuild-repository-public-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DEEP-SEA
easybuild-repository-public-release
Commits
28402178
Commit
28402178
authored
4 years ago
by
Alexandre Strube
Browse files
Options
Downloads
Patches
Plain Diff
autopep8
parent
ab0bc57b
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Custom_EasyBlocks/bazel.py
+15
-30
15 additions, 30 deletions
Custom_EasyBlocks/bazel.py
with
15 additions
and
30 deletions
Custom_EasyBlocks/bazel.py
+
15
−
30
View file @
28402178
...
@@ -45,32 +45,25 @@ class EB_Bazel(EasyBlock):
...
@@ -45,32 +45,25 @@ class EB_Bazel(EasyBlock):
binutils_root
=
get_software_root
(
'
binutils
'
)
binutils_root
=
get_software_root
(
'
binutils
'
)
gcc_root
=
get_software_root
(
'
GCCcore
'
)
or
get_software_root
(
'
GCC
'
)
gcc_root
=
get_software_root
(
'
GCCcore
'
)
or
get_software_root
(
'
GCC
'
)
gcc_ver
=
get_software_version
(
gcc_ver
=
get_software_version
(
'
GCCcore
'
)
or
get_software_version
(
'
GCC
'
)
'
GCCcore
'
)
or
get_software_version
(
'
GCC
'
)
# only patch Bazel scripts if binutils & GCC installation prefix could be determined
# only patch Bazel scripts if binutils & GCC installation prefix could be determined
if
binutils_root
and
gcc_root
:
if
binutils_root
and
gcc_root
:
res
=
glob
.
glob
(
os
.
path
.
join
(
gcc_root
,
'
lib
'
,
res
=
glob
.
glob
(
os
.
path
.
join
(
gcc_root
,
'
lib
'
,
'
gcc
'
,
'
*
'
,
gcc_ver
,
'
include
'
))
'
gcc
'
,
'
*
'
,
gcc_ver
,
'
include
'
))
if
res
and
len
(
res
)
==
1
:
if
res
and
len
(
res
)
==
1
:
gcc_lib_inc
=
res
[
0
]
gcc_lib_inc
=
res
[
0
]
else
:
else
:
raise
EasyBuildError
(
raise
EasyBuildError
(
"
Failed to pinpoint location of GCC include files: %s
"
,
res
)
"
Failed to pinpoint location of GCC include files: %s
"
,
res
)
gcc_lib_inc_bis
=
os
.
path
.
join
(
gcc_lib_inc_bis
=
os
.
path
.
join
(
os
.
path
.
dirname
(
gcc_lib_inc
),
'
include-fixed
'
)
os
.
path
.
dirname
(
gcc_lib_inc
),
'
include-fixed
'
)
if
not
os
.
path
.
exists
(
gcc_lib_inc_bis
):
if
not
os
.
path
.
exists
(
gcc_lib_inc_bis
):
self
.
log
.
info
(
self
.
log
.
info
(
"
Derived directory %s does not exist, falling back to %s
"
,
gcc_lib_inc_bis
,
gcc_lib_inc
)
"
Derived directory %s does not exist, falling back to %s
"
,
gcc_lib_inc_bis
,
gcc_lib_inc
)
gcc_lib_inc_bis
=
gcc_lib_inc
gcc_lib_inc_bis
=
gcc_lib_inc
gcc_cplusplus_inc
=
os
.
path
.
join
(
gcc_cplusplus_inc
=
os
.
path
.
join
(
gcc_root
,
'
include
'
,
'
c++
'
,
gcc_ver
)
gcc_root
,
'
include
'
,
'
c++
'
,
gcc_ver
)
if
not
os
.
path
.
exists
(
gcc_cplusplus_inc
):
if
not
os
.
path
.
exists
(
gcc_cplusplus_inc
):
raise
EasyBuildError
(
raise
EasyBuildError
(
"
Derived directory %s does not exist
"
,
gcc_cplusplus_inc
)
"
Derived directory %s does not exist
"
,
gcc_cplusplus_inc
)
# replace hardcoded paths in CROSSTOOL
# replace hardcoded paths in CROSSTOOL
...
@@ -78,24 +71,18 @@ class EB_Bazel(EasyBlock):
...
@@ -78,24 +71,18 @@ class EB_Bazel(EasyBlock):
if
LooseVersion
(
self
.
version
)
<
LooseVersion
(
'
0.24.0
'
):
if
LooseVersion
(
self
.
version
)
<
LooseVersion
(
'
0.24.0
'
):
regex_subs
=
[
regex_subs
=
[
(
r
'
-B/usr/bin
'
,
'
-B%s
'
%
os
.
path
.
join
(
binutils_root
,
'
bin
'
)),
(
r
'
-B/usr/bin
'
,
'
-B%s
'
%
os
.
path
.
join
(
binutils_root
,
'
bin
'
)),
(
r
'
(cxx_builtin_include_directory:.*)/usr/lib/gcc
'
,
(
r
'
(cxx_builtin_include_directory:.*)/usr/lib/gcc
'
,
r
'
\1%s
'
%
gcc_lib_inc
),
r
'
\1%s
'
%
gcc_lib_inc
),
(
r
'
(cxx_builtin_include_directory:.*)/usr/local/include
'
,
r
'
\1%s
'
%
gcc_lib_inc_bis
),
(
r
'
(cxx_builtin_include_directory:.*)/usr/local/include
'
,
(
r
'
(cxx_builtin_include_directory:.*)/usr/include
'
,
r
'
\1%s
'
%
gcc_cplusplus_inc
),
r
'
\1%s
'
%
gcc_lib_inc_bis
),
(
r
'
(cxx_builtin_include_directory:.*)/usr/include
'
,
r
'
\1%s
'
%
gcc_cplusplus_inc
),
]
]
for
tool
in
[
'
ar
'
,
'
cpp
'
,
'
dwp
'
,
'
gcc
'
,
'
ld
'
]:
for
tool
in
[
'
ar
'
,
'
cpp
'
,
'
dwp
'
,
'
gcc
'
,
'
ld
'
]:
path
=
which
(
tool
)
path
=
which
(
tool
)
if
path
:
if
path
:
regex_subs
.
append
(
regex_subs
.
append
((
os
.
path
.
join
(
'
/usr
'
,
'
bin
'
,
tool
),
path
))
(
os
.
path
.
join
(
'
/usr
'
,
'
bin
'
,
tool
),
path
))
else
:
else
:
raise
EasyBuildError
(
raise
EasyBuildError
(
"
Failed to determine path to
'
%s
'"
,
tool
)
"
Failed to determine path to
'
%s
'"
,
tool
)
apply_regex_substitutions
(
os
.
path
.
join
(
apply_regex_substitutions
(
os
.
path
.
join
(
'
tools
'
,
'
cpp
'
,
'
CROSSTOOL
'
),
regex_subs
)
'
tools
'
,
'
cpp
'
,
'
CROSSTOOL
'
),
regex_subs
)
# replace hardcoded paths in (unix_)cc_configure.bzl
# replace hardcoded paths in (unix_)cc_configure.bzl
regex_subs
=
[
regex_subs
=
[
...
@@ -107,8 +94,7 @@ class EB_Bazel(EasyBlock):
...
@@ -107,8 +94,7 @@ class EB_Bazel(EasyBlock):
if
os
.
path
.
exists
(
filepath
):
if
os
.
path
.
exists
(
filepath
):
apply_regex_substitutions
(
filepath
,
regex_subs
)
apply_regex_substitutions
(
filepath
,
regex_subs
)
else
:
else
:
self
.
log
.
info
(
self
.
log
.
info
(
"
Not patching Bazel build scripts, installation prefix for binutils/GCC not found
"
)
"
Not patching Bazel build scripts, installation prefix for binutils/GCC not found
"
)
# enable building in parallel
# enable building in parallel
bazel_args
=
'
--jobs=%d
'
%
self
.
cfg
[
'
parallel
'
]
bazel_args
=
'
--jobs=%d
'
%
self
.
cfg
[
'
parallel
'
]
...
@@ -128,8 +114,7 @@ class EB_Bazel(EasyBlock):
...
@@ -128,8 +114,7 @@ class EB_Bazel(EasyBlock):
def
install_step
(
self
):
def
install_step
(
self
):
"""
Custom install procedure for Bazel.
"""
"""
Custom install procedure for Bazel.
"""
copy_file
(
os
.
path
.
join
(
'
output
'
,
'
bazel
'
),
copy_file
(
os
.
path
.
join
(
'
output
'
,
'
bazel
'
),
os
.
path
.
join
(
self
.
installdir
,
'
bin
'
,
'
bazel
'
))
os
.
path
.
join
(
self
.
installdir
,
'
bin
'
,
'
bazel
'
))
def
sanity_check_step
(
self
):
def
sanity_check_step
(
self
):
"""
Custom sanity check for Bazel.
"""
"""
Custom sanity check for Bazel.
"""
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment