Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Core Modules
dune-common
Commits
dca7a85a
Commit
dca7a85a
authored
3 years ago
by
Andreas Dedner
Browse files
Options
Downloads
Patches
Plain Diff
[Python] reduce amount of info output - this would be my favourite
parent
862f2852
No related branches found
No related tags found
1 merge request
!1066
[python] dynamically print progress during build
Pipeline
#41918
passed
3 years ago
Stage: test
Stage: downstream
Pipeline: Dune Nightly Test
#41920
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python/dune/generator/cmakebuilder.py
+11
-10
11 additions, 10 deletions
python/dune/generator/cmakebuilder.py
with
11 additions
and
10 deletions
python/dune/generator/cmakebuilder.py
+
11
−
10
View file @
dca7a85a
...
...
@@ -13,7 +13,7 @@ import dune
from
dune.packagemetadata
import
(
getDunePyDir
,
Description
,
getBuildMetaData
,
getCMakeFlags
,
envCMakeFlags
,
getBuildMetaData
,
getCMakeFlags
,
envCMakeFlags
,
defaultCMakeFlags
,
getExternalPythonModules
)
...
...
@@ -120,7 +120,7 @@ class Builder:
outfile
.
write
(
env
.
get_template
(
relative_template_file
).
render
(
**
context
))
# configure dune-py
Builder
.
callCMake
([
"
cmake
"
]
+
env
CMakeFlags
()
+
[
"
.
"
],
Builder
.
callCMake
([
"
cmake
"
]
+
default
CMakeFlags
()
+
[
"
.
"
],
cwd
=
dunepy_dir
,
infoTxt
=
"
Configuring dune-py with CMake
"
,
active
=
True
,
# print details anyway
...
...
@@ -177,7 +177,7 @@ class Builder:
open
(
tagfile
,
'
a
'
).
close
()
else
:
logger
.
debug
(
'
Using existing dune-py module in
'
+
self
.
dune_py_dir
)
self
.
compile
(
"
Rebuilding dune-py module
"
,
verbose
=
True
)
self
.
compile
(
"
Rebuilding dune-py module
"
)
comm
.
barrier
()
try
:
...
...
@@ -193,7 +193,7 @@ class Builder:
active
=
active
or
verbose
if
active
:
if
infoTxt
:
logger
.
log
(
logLevel
,
infoTxt
+
"
...
"
)
logger
.
log
(
logLevel
,
infoTxt
)
#
+ " ...")
# call the cmake process
with
subprocess
.
Popen
(
cmake_args
,
cwd
=
cwd
,
...
...
@@ -203,12 +203,13 @@ class Builder:
cmake
.
communicate
(
timeout
=
2
)
# no message if delay is <2sec
except
subprocess
.
TimeoutExpired
:
if
infoTxt
and
not
active
:
logger
.
log
(
logLevel
,
infoTxt
+
"
...
"
)
logger
.
log
(
logLevel
,
infoTxt
)
#
+ " ...")
active
=
True
# make sure 'done' is printed
# wait for cmd to finish
cmake
.
wait
()
if
active
:
logger
.
log
(
logLevel
,
"
...done
"
)
# could add 'done' to logger - would be nice to have in same # line as message though...
# if active:
# logger.log(logLevel,"...done")
# check return code
if
cmake
.
returncode
>
0
:
# retrieve stderr output
...
...
@@ -283,7 +284,7 @@ class Builder:
with
open
(
os
.
path
.
join
(
self
.
generated_dir
,
"
CMakeLists.txt
"
),
'
r
'
)
as
out
:
found
=
line
in
out
.
read
()
if
not
os
.
path
.
isfile
(
sourceFileName
)
or
not
found
:
logger
.
info
(
"
Generat
ing
"
+
pythonName
)
PrintCompiling
=
"
Compil
ing
"
+
pythonName
+
"
(new)
"
code
=
str
(
source
)
with
open
(
os
.
path
.
join
(
sourceFileName
),
'
w
'
)
as
out
:
out
.
write
(
code
)
...
...
@@ -304,7 +305,6 @@ class Builder:
infoTxt
=
"
Configuring module {} ({}) with CMake
"
.
format
(
pythonName
,
moduleName
),
active
=
True
,
# print details anyway
)
except
:
# all exceptions will cause a problem here
os
.
remove
(
os
.
path
.
join
(
sourceFileName
))
...
...
@@ -318,7 +318,8 @@ class Builder:
with
open
(
os
.
path
.
join
(
sourceFileName
),
'
w
'
)
as
out
:
out
.
write
(
code
)
else
:
# we only can directly load the module
# we can directly load the module - after # checking if headers have changed
PrintCompiling
=
"
Compiling
"
+
pythonName
+
"
(rebuilding)
"
# sanity check
line
=
"
dune_add_pybind11_module(NAME
"
+
moduleName
+
"
EXCLUDE_FROM_ALL)
"
# the CMakeLists file should already include this line
...
...
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