Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LbScripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
LHCb Core Software
LbScripts
Commits
9faa06db
Commit
9faa06db
authored
8 years ago
by
Ben Couturier
Browse files
Options
Downloads
Patches
Plain Diff
Initial version
parent
1e03c457
No related branches found
No related tags found
1 merge request
!101
Add Ninja to the path after LbLogin
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
LbConfiguration/python/LbConfiguration/External.py
+1
-0
1 addition, 0 deletions
LbConfiguration/python/LbConfiguration/External.py
LbConfiguration/python/LbConfiguration/LbLogin.py
+76
-1
76 additions, 1 deletion
LbConfiguration/python/LbConfiguration/LbLogin.py
with
77 additions
and
1 deletion
LbConfiguration/python/LbConfiguration/External.py
+
1
−
0
View file @
9faa06db
...
...
@@ -8,6 +8,7 @@ distribution_url = "http://cern.ch/lhcbproject/dist"
Python_version
=
"
2.5
"
CMT_version
=
"
v1r20p20090520
"
CMake_version
=
"
3.3.2
"
ninja_version
=
"
1.4.0
"
tbroadcast_version
=
"
v2.0.5
"
doxygen_version
=
"
1.8.9.1
"
...
...
This diff is collapsed.
Click to expand it.
LbConfiguration/python/LbConfiguration/LbLogin.py
+
76
−
1
View file @
9faa06db
...
...
@@ -50,7 +50,7 @@ from SetupProject import SetupProject
from
LbConfiguration.Platform
import
getBinaryDbg
,
getBinaryOpt
from
LbConfiguration.Platform
import
getCompiler
,
getPlatformType
,
getArchitecture
from
LbConfiguration.Platform
import
isBinaryDbg
,
NativeMachine
from
LbConfiguration.External
import
CMT_version
,
CMake_version
from
LbConfiguration.External
import
CMT_version
,
CMake_version
,
ninja_version
from
LbConfiguration.Version
import
sortStrings
,
ParseSvnVersion
from
LbUtils.Script
import
SourceScript
from
LbUtils.Path
import
multiPathGet
,
multiPathGetFirst
,
multiPathJoin
...
...
@@ -92,6 +92,11 @@ def _setCMakeVersionCb(_option, _opt_str, value, parser):
parser
.
values
.
use_cache
=
False
parser
.
values
.
cmakevers
=
value
def
_setNinjaVersionCb
(
_option
,
_opt_str
,
value
,
parser
):
if
parser
.
values
.
ninjavers
!=
value
:
parser
.
values
.
use_cache
=
False
parser
.
values
.
ninjavers
=
value
def
_noPythonCb
(
_option
,
_opt_str
,
_value
,
parser
):
parser
.
values
.
get_python
=
False
parser
.
values
.
use_cache
=
False
...
...
@@ -180,6 +185,13 @@ class LbLoginScript(SourceScript):
callback
=
_setCMakeVersionCb
,
type
=
"
string
"
,
help
=
"
set CMake version
"
)
parser
.
set_defaults
(
ninjavers
=
ninja_version
)
parser
.
add_option
(
"
--ninjavers
"
,
action
=
"
callback
"
,
callback
=
_setNinjaVersionCb
,
type
=
"
string
"
,
help
=
"
set Ninja version
"
)
parser
.
set_defaults
(
scriptsvers
=
None
)
parser
.
add_option
(
"
--scripts-version
"
,
dest
=
"
scriptsvers
"
,
...
...
@@ -251,6 +263,11 @@ class LbLoginScript(SourceScript):
dest
=
"
use_cmtextratags
"
,
action
=
"
store_true
"
,
help
=
"
use CMTEXTRATAGS during the LbScripts setup
"
)
parser
.
add_option
(
"
--lb-run
"
,
dest
=
"
use_lb_run
"
,
action
=
"
store_true
"
,
default
=
False
,
help
=
"
Use lb-run instead of SetupProject for condifguration [default: %default]
"
)
#-----------------------------------------------------------------------------------
...
...
@@ -565,6 +582,63 @@ class LbLoginScript(SourceScript):
except
StopIteration
:
log
.
debug
(
'
Cannot find CMake %s directory
'
,
opts
.
cmakevers
)
def
setNinja
(
self
):
from
os.path
import
join
,
pathsep
,
isdir
log
=
self
.
log
opts
=
self
.
options
log
.
debug
(
"
Looking for Ninja %s
"
,
opts
.
ninjavers
)
if
sys
.
platform
.
startswith
(
'
linux
'
):
subdir
=
"
ninja/%s/x86_64-slc6
"
%
opts
.
ninjavers
else
:
log
.
debug
(
'
Ninja is not provided for platform %s
'
,
sys
.
platform
)
return
ev
=
self
.
Environment
()
def
searchpath
():
'''
Generator for all the possible locations of Ninja.
'''
if
opts
.
mysiteroot
:
for
r
in
opts
.
mysiteroot
.
split
(
pathsep
):
yield
join
(
r
,
"
contrib
"
,
subdir
)
if
'
CONTRIBDIR
'
in
ev
:
for
r
in
ev
[
'
CONTRIBDIR
'
].
split
(
pathsep
):
yield
join
(
r
,
subdir
)
if
'
SITEROOT
'
in
ev
:
for
r
in
ev
[
'
SITEROOT
'
].
split
(
pathsep
):
yield
join
(
r
,
'
sw
'
,
'
lcg
'
,
'
contrib
'
,
subdir
)
yield
join
(
r
,
'
sw
'
,
'
contrib
'
,
subdir
)
yield
join
(
r
,
'
contrib
'
,
subdir
)
if
opts
.
log_level
==
'
DEBUG
'
:
# wrap the generator to print all the searched directories
_searchpath
=
searchpath
def
searchpath
():
for
d
in
_searchpath
():
log
.
debug
(
"
... trying %s
"
,
d
)
yield
d
try
:
# look for the ninja directory
ninjaDir
=
(
d
for
d
in
searchpath
()
if
isdir
(
d
)).
next
()
log
.
debug
(
'
Found %s
'
,
ninjaDir
)
# if found, we remove all previous entries from the PATH...
substring
=
os
.
sep
+
'
ninja
'
+
os
.
sep
path
=
[
p
for
p
in
ev
[
'
PATH
'
].
split
(
os
.
pathsep
)
if
substring
not
in
p
]
# ... prepend the new one...
path
.
insert
(
0
,
ninjaDir
)
# ... and set the environment variable
ev
[
'
PATH
'
]
=
os
.
pathsep
.
join
(
path
)
except
StopIteration
:
log
.
debug
(
'
Cannot find Ninja %s directory
'
,
opts
.
cmakevers
)
#-----------------------------------------------------------------------------------
def
setSoftLocations
(
self
):
ev
=
self
.
Environment
()
...
...
@@ -1022,6 +1096,7 @@ class LbLoginScript(SourceScript):
self
.
setSite
()
self
.
setCMT
()
self
.
setCMake
()
self
.
setNinja
()
self
.
setSoftLocations
()
self
.
setSharedArea
()
...
...
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