Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
buildstream
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
Container registry
Model registry
Operate
Environments
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
Privacy statement
Keyboard shortcuts
?
What's new
3
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
BuildStream
buildstream
Commits
73dec86e
Commit
73dec86e
authored
6 years ago
by
Jürg Billeter
Browse files
Options
Downloads
Patches
Plain Diff
scriptelement.py: Support batching for integration and build commands
parent
63db90b2
No related branches found
No related tags found
Loading
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
buildstream/scriptelement.py
+26
-25
26 additions, 25 deletions
buildstream/scriptelement.py
with
26 additions
and
25 deletions
buildstream/scriptelement.py
+
26
−
25
View file @
73dec86e
...
...
@@ -226,6 +226,7 @@ class ScriptElement(Element):
.
format
(
build_dep
.
name
),
silent_nested
=
True
):
build_dep
.
stage_dependency_artifacts
(
sandbox
,
Scope
.
RUN
,
path
=
"
/
"
)
with
sandbox
.
batch
(
SandboxFlags
.
NONE
):
for
build_dep
in
self
.
dependencies
(
Scope
.
BUILD
,
recurse
=
False
):
with
self
.
timed_activity
(
"
Integrating {}
"
.
format
(
build_dep
.
name
),
silent_nested
=
True
):
for
dep
in
build_dep
.
dependencies
(
Scope
.
RUN
):
...
...
@@ -251,6 +252,7 @@ class ScriptElement(Element):
virtual_dstdir
.
descend
(
item
[
'
destination
'
].
lstrip
(
os
.
sep
).
split
(
os
.
sep
),
create
=
True
)
element
.
stage_dependency_artifacts
(
sandbox
,
Scope
.
RUN
,
path
=
item
[
'
destination
'
])
with
sandbox
.
batch
(
SandboxFlags
.
NONE
):
for
item
in
self
.
__layout
:
# Skip layout members which dont stage an element
...
...
@@ -275,16 +277,15 @@ class ScriptElement(Element):
if
self
.
__root_read_only
:
flags
|=
SandboxFlags
.
ROOT_READ_ONLY
with
sandbox
.
batch
(
flags
,
collect
=
self
.
__install_root
):
for
groupname
,
commands
in
self
.
__commands
.
items
():
with
s
elf
.
timed_activity
(
"
Running
'
{}
'"
.
format
(
groupname
)):
with
s
andbox
.
batch
(
flags
,
label
=
"
Running
'
{}
'"
.
format
(
groupname
)):
for
cmd
in
commands
:
self
.
status
(
"
Running command
"
,
detail
=
cmd
)
# Note the -e switch to 'sh' means to exit with an error
# if any untested command fails.
exitcode
=
sandbox
.
run
([
'
sh
'
,
'
-c
'
,
'
-e
'
,
cmd
+
'
\n
'
],
flags
)
if
exitcode
!=
0
:
raise
ElementError
(
"
Command
'
{}
'
failed with exitcode {}
"
.
format
(
cmd
,
exitcode
),
collect
=
self
.
__install_root
)
sandbox
.
run
([
'
sh
'
,
'
-c
'
,
'
-e
'
,
cmd
+
'
\n
'
],
flags
,
label
=
cmd
)
# Return where the result can be collected from
return
self
.
__install_root
...
...
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