Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Gaudi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Show more breadcrumbs
Gaudi
Gaudi
Commits
f7f9cde4
Commit
f7f9cde4
authored
3 years ago
by
Marco Clemencic
Browse files
Options
Downloads
Patches
Plain Diff
genconfuser.py: exclude <Project>.confdb when scanning the environment
parent
82b26efb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1280
Improve configurables db exclusion
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+0
-2
0 additions, 2 deletions
.gitlab-ci.yml
GaudiKernel/scripts/genconfuser.py
+23
-5
23 additions, 5 deletions
GaudiKernel/scripts/genconfuser.py
cmake/GaudiToolbox.cmake
+1
-0
1 addition, 0 deletions
cmake/GaudiToolbox.cmake
with
24 additions
and
7 deletions
.gitlab-ci.yml
+
0
−
2
View file @
f7f9cde4
...
@@ -100,8 +100,6 @@ view-gcc8:
...
@@ -100,8 +100,6 @@ view-gcc8:
# Override CMake from the view (too old in LCG 97a)
# Override CMake from the view (too old in LCG 97a)
-
export PATH="/cvmfs/sft.cern.ch/lcg/contrib/CMake/3.18.3/Linux-x86_64/bin:$PATH"
-
export PATH="/cvmfs/sft.cern.ch/lcg/contrib/CMake/3.18.3/Linux-x86_64/bin:$PATH"
-
PYTHON_MAJOR_VERSION=$(python -c "import sys; print(sys.version_info[0])")
-
PYTHON_MAJOR_VERSION=$(python -c "import sys; print(sys.version_info[0])")
# Ignore .confdb file from Gaudi installation in LCG view
-
export CONFIGURABLE_DB_IGNORE=/cvmfs/sft.cern.ch/lcg/views/LCG_${LCG_VERSION}/x86_64-centos7-gcc8-opt/lib/Gaudi.confdb
-
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DGAUDI_USE_PYTHON_MAJOR=${PYTHON_MAJOR_VERSION} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DGAUDI_USE_PYTHON_MAJOR=${PYTHON_MAJOR_VERSION} -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-
ccache -z
-
ccache -z
# pre-heat ccache cache for GaudiKernel
# pre-heat ccache cache for GaudiKernel
...
...
This diff is collapsed.
Click to expand it.
GaudiKernel/scripts/genconfuser.py
+
23
−
5
View file @
f7f9cde4
...
@@ -49,7 +49,7 @@ def _inheritsfrom(derived, basenames):
...
@@ -49,7 +49,7 @@ def _inheritsfrom(derived, basenames):
return
False
return
False
def
loadConfigurableDb
(
build_dir
=
None
):
def
loadConfigurableDb
(
build_dir
=
None
,
project_name
=
None
):
'''
'''
Equivalent to GaudiKernel.ConfigurableDb.loadConfigurableDb(), but does a
Equivalent to GaudiKernel.ConfigurableDb.loadConfigurableDb(), but does a
deep search and executes the
'
*.confdb
'
files instead of importing them.
deep search and executes the
'
*.confdb
'
files instead of importing them.
...
@@ -79,10 +79,20 @@ def loadConfigurableDb(build_dir=None):
...
@@ -79,10 +79,20 @@ def loadConfigurableDb(build_dir=None):
if
f
.
endswith
(
'
.confdb
'
)
if
f
.
endswith
(
'
.confdb
'
)
]
]
]
]
# - get the list of ignored files
ignored_files
=
set
(
os
.
environ
.
get
(
"
CONFIGURABLE_DB_IGNORE
"
,
""
).
split
(
"
,
"
))
# - load the confdb files
# - load the confdb files
for
confDb
in
(
set
(
confDbFiles
)
-
set
(
for
confDb
in
set
(
confDbFiles
):
os
.
environ
.
get
(
"
CONFIGURABLE_DB_IGNORE
"
,
""
).
split
(
"
,
"
))):
if
confDb
in
ignored_files
or
(
project_name
log
.
debug
(
"
\t
-loading [%s]...
"
%
confDb
)
and
os
.
path
.
basename
(
confDb
)
==
(
"
{}.confdb
"
.
format
(
project_name
))):
# skip ignored files and the project's own confdb
log
.
debug
(
"
\t
-ignoring [%s]
"
,
confDb
)
# make sure we count also <project_name>.confdb for GaudiKernel
ignored_files
.
add
(
confDb
)
continue
log
.
debug
(
"
\t
-loading [%s]...
"
,
confDb
)
try
:
try
:
cfgDb
.
_loadModule
(
confDb
)
cfgDb
.
_loadModule
(
confDb
)
except
Exception
as
err
:
except
Exception
as
err
:
...
@@ -91,6 +101,8 @@ def loadConfigurableDb(build_dir=None):
...
@@ -91,6 +101,8 @@ def loadConfigurableDb(build_dir=None):
log
.
warning
(
"
Could not load file [%s] !
"
,
confDb
)
log
.
warning
(
"
Could not load file [%s] !
"
,
confDb
)
log
.
warning
(
"
Reason: %s
"
,
err
)
log
.
warning
(
"
Reason: %s
"
,
err
)
# top up with the regular merged confDb (for the used projects)
# top up with the regular merged confDb (for the used projects)
# (make sure GaudiKernel gets the right exclusions)
os
.
environ
[
"
CONFIGURABLE_DB_IGNORE
"
]
=
"
,
"
.
join
(
ignored_files
)
GaudiKernel
.
ConfigurableDb
.
loadConfigurableDb
()
GaudiKernel
.
ConfigurableDb
.
loadConfigurableDb
()
...
@@ -188,6 +200,12 @@ def main():
...
@@ -188,6 +200,12 @@ def main():
help
=
help
=
"
build directory where to look for .confdb files (search all subdirectories)
"
"
build directory where to look for .confdb files (search all subdirectories)
"
)
)
parser
.
add_option
(
"
--project-name
"
,
action
=
"
store
"
,
help
=
"
name of the current project (used to exclude spurious versions of the .confdb file for the current project)
"
)
parser
.
set_defaults
(
root
=
os
.
path
.
join
(
"
..
"
,
"
python
"
))
parser
.
set_defaults
(
root
=
os
.
path
.
join
(
"
..
"
,
"
python
"
))
opts
,
args
=
parser
.
parse_args
()
opts
,
args
=
parser
.
parse_args
()
...
@@ -233,7 +251,7 @@ def main():
...
@@ -233,7 +251,7 @@ def main():
except
:
except
:
pass
pass
# load configurables database to avoid fake duplicates
# load configurables database to avoid fake duplicates
loadConfigurableDb
(
opts
.
build_dir
)
loadConfigurableDb
(
opts
.
build_dir
,
opts
.
project_name
)
# ensure that local configurables are in the database
# ensure that local configurables are in the database
try
:
try
:
# Add the local python directories to the python path to be able to import the local
# Add the local python directories to the python path to be able to import the local
...
...
This diff is collapsed.
Click to expand it.
cmake/GaudiToolbox.cmake
+
1
−
0
View file @
f7f9cde4
...
@@ -988,6 +988,7 @@ function(gaudi_generate_confuserdb)
...
@@ -988,6 +988,7 @@ function(gaudi_generate_confuserdb)
add_custom_command
(
OUTPUT
"
${
output_file
}
"
add_custom_command
(
OUTPUT
"
${
output_file
}
"
COMMAND run genconfuser.py
COMMAND run genconfuser.py
--build-dir
${
CMAKE_BINARY_DIR
}
--build-dir
${
CMAKE_BINARY_DIR
}
--project-name
${
PROJECT_NAME
}
--root
${
CMAKE_CURRENT_SOURCE_DIR
}
/python
--root
${
CMAKE_CURRENT_SOURCE_DIR
}
/python
--output
"
${
output_file
}
"
--output
"
${
output_file
}
"
${
ARG_OPTIONS
}
${
ARG_OPTIONS
}
...
...
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