diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-06-17 21:04:41 -0400 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-06-17 21:37:22 -0400 |
commit | 73b930024d164e076275868253f92a47593f2dd8 (patch) | |
tree | 1789cbea13738ad4f4fcd7167c6741cb41dcccf5 | |
parent | 3f56037896a6f546d6949c70aa65384d78b7a0fc (diff) | |
download | buildstream-73b930024d164e076275868253f92a47593f2dd8.tar.gz |
doc: Adding part 2 of the getting started tutorial
o doc/examples/running-commands: New example project of a `manual` build element
o doc/sessions/running-commands.run: New session file to capture bst output
o doc/source/sessions-stored: Added new generated sessions
o doc/source/tutorial/running-commands.rst: New tutorial entry describing how
commands are run in the sandbox
o tests/examples/running-commands.py: Test case validating the tutorial's assertions
-rw-r--r-- | doc/examples/running-commands/elements/base.bst | 5 | ||||
-rw-r--r-- | doc/examples/running-commands/elements/base/alpine.bst | 13 | ||||
-rw-r--r-- | doc/examples/running-commands/elements/hello.bst | 22 | ||||
-rw-r--r-- | doc/examples/running-commands/files/src/Makefile | 12 | ||||
-rw-r--r-- | doc/examples/running-commands/files/src/hello.c | 10 | ||||
-rw-r--r-- | doc/examples/running-commands/project.conf | 12 | ||||
-rw-r--r-- | doc/sessions/running-commands.run | 25 | ||||
-rw-r--r-- | doc/source/core_plugins.rst | 2 | ||||
-rw-r--r-- | doc/source/sessions-stored/running-commands-build.html | 103 | ||||
-rw-r--r-- | doc/source/sessions-stored/running-commands-shell.html | 22 | ||||
-rw-r--r-- | doc/source/sessions-stored/running-commands-show-after.html | 16 | ||||
-rw-r--r-- | doc/source/sessions-stored/running-commands-show-before.html | 16 | ||||
-rw-r--r-- | doc/source/tutorial/running-commands.rst | 205 | ||||
-rw-r--r-- | doc/source/using_tutorial.rst | 1 | ||||
-rw-r--r-- | tests/examples/running-commands.py | 36 |
15 files changed, 500 insertions, 0 deletions
diff --git a/doc/examples/running-commands/elements/base.bst b/doc/examples/running-commands/elements/base.bst new file mode 100644 index 000000000..1b85a9e8c --- /dev/null +++ b/doc/examples/running-commands/elements/base.bst @@ -0,0 +1,5 @@ +kind: stack +description: Base stack + +depends: +- base/alpine.bst diff --git a/doc/examples/running-commands/elements/base/alpine.bst b/doc/examples/running-commands/elements/base/alpine.bst new file mode 100644 index 000000000..cf85df5bf --- /dev/null +++ b/doc/examples/running-commands/elements/base/alpine.bst @@ -0,0 +1,13 @@ +kind: import +description: | + + Alpine Linux base runtime + +sources: +- kind: tar + + # This is a post doctored, trimmed down system image + # of the Alpine linux distribution. + # + url: alpine:integration-tests-base.v1.x86_64.tar.xz + ref: 3eb559250ba82b64a68d86d0636a6b127aa5f6d25d3601a79f79214dc9703639 diff --git a/doc/examples/running-commands/elements/hello.bst b/doc/examples/running-commands/elements/hello.bst new file mode 100644 index 000000000..f7f21e01e --- /dev/null +++ b/doc/examples/running-commands/elements/hello.bst @@ -0,0 +1,22 @@ +kind: manual +description: | + + Building manually + +# Depend on the base system +depends: +- base.bst + +# Stage the files/src directory for building +sources: + - kind: local + path: files/src + +# Now configure the commands to run +config: + + build-commands: + - make PREFIX="%{prefix}" + + install-commands: + - make -j1 PREFIX="%{prefix}" DESTDIR="%{install-root}" install diff --git a/doc/examples/running-commands/files/src/Makefile b/doc/examples/running-commands/files/src/Makefile new file mode 100644 index 000000000..8c8425116 --- /dev/null +++ b/doc/examples/running-commands/files/src/Makefile @@ -0,0 +1,12 @@ +# Sample makefile for hello.c +# +.PHONY: all install + +all: hello + +install: + install -d ${DESTDIR}${PREFIX}/bin + install -m 755 hello ${DESTDIR}${PREFIX}/bin + +hello: hello.c + $(CC) -Wall -o $@ $< diff --git a/doc/examples/running-commands/files/src/hello.c b/doc/examples/running-commands/files/src/hello.c new file mode 100644 index 000000000..b53408209 --- /dev/null +++ b/doc/examples/running-commands/files/src/hello.c @@ -0,0 +1,10 @@ +/* + * hello.c - Simple hello world program + */ +#include <stdio.h> + +int main(int argc, char *argv[]) +{ + printf("Hello World\n"); + return 0; +} diff --git a/doc/examples/running-commands/project.conf b/doc/examples/running-commands/project.conf new file mode 100644 index 000000000..de266178e --- /dev/null +++ b/doc/examples/running-commands/project.conf @@ -0,0 +1,12 @@ +# Unique project name +name: running-commands + +# Required BuildStream format version +format-version: 9 + +# Subdirectory where elements are stored +element-path: elements + +# Define an alias for our alpine tarball +aliases: + alpine: https://gnome7.codethink.co.uk/tarballs/ diff --git a/doc/sessions/running-commands.run b/doc/sessions/running-commands.run new file mode 100644 index 000000000..ce8eccd2f --- /dev/null +++ b/doc/sessions/running-commands.run @@ -0,0 +1,25 @@ + +commands: +# Make it fetch first +- directory: ../examples/running-commands + command: fetch hello.bst + +# Capture a show output +- directory: ../examples/running-commands + output: ../source/sessions/running-commands-show-before.html + command: show hello.bst + +# Capture a build output +- directory: ../examples/running-commands + output: ../source/sessions/running-commands-build.html + command: build hello.bst + +# Capture another show output +- directory: ../examples/running-commands + output: ../source/sessions/running-commands-show-after.html + command: show hello.bst + +# Capture a shell output +- directory: ../examples/running-commands + output: ../source/sessions/running-commands-shell.html + command: shell hello.bst -- hello diff --git a/doc/source/core_plugins.rst b/doc/source/core_plugins.rst index 36da4a6cf..030597e27 100644 --- a/doc/source/core_plugins.rst +++ b/doc/source/core_plugins.rst @@ -23,6 +23,8 @@ General elements elements/filter +.. _plugins_build_elements: + Build elements -------------- .. toctree:: diff --git a/doc/source/sessions-stored/running-commands-build.html b/doc/source/sessions-stored/running-commands-build.html new file mode 100644 index 000000000..621bdb707 --- /dev/null +++ b/doc/source/sessions-stored/running-commands-build.html @@ -0,0 +1,103 @@ +<!-- + WARNING: This file was generated with bst2html.py +--> +<div class="highlight" style="font-size:x-small"><pre> +<span style="color:#C4A000;font-weight:bold">user@host</span>:<span style="color:#3456A4;font-weight:bold">~/running-commands</span>$ bst build hello.bst + +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Build +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Loading pipeline +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Loading pipeline +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Resolving pipeline +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Resolving pipeline +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Resolving cached state +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Resolving cached state +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Checking sources +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Checking sources + +<span style="color:#C4A000"><span style="">BuildStream Version 1.1.3+141.g6fa3f922.dirty +</span></span><span style="color:#06989A"><span style="opacity:0.5"> Session Start: </span></span><span style="color:#C4A000">Sunday, 17-06-2018 at 20:11:21</span> +<span style="color:#06989A"><span style="opacity:0.5"> Project: </span></span><span style="color:#C4A000">running-commands (/home/user/running-commands)</span> +<span style="color:#06989A"><span style="opacity:0.5"> Targets: </span></span><span style="color:#C4A000">hello.bst</span> + +<span style="color:#C4A000"><span style="">User Configuration +</span></span><span style="color:#06989A"><span style="opacity:0.5"> Configuration File: </span></span><span style="color:#C4A000">/home/user/.config/buildstream.conf</span> +<span style="color:#06989A"><span style="opacity:0.5"> Log Files: </span></span><span style="color:#C4A000">/home/user/.cache/buildstream/logs</span> +<span style="color:#06989A"><span style="opacity:0.5"> Source Mirrors: </span></span><span style="color:#C4A000">/home/user/.cache/buildstream/sources</span> +<span style="color:#06989A"><span style="opacity:0.5"> Build Area: </span></span><span style="color:#C4A000">/home/user/.cache/buildstream/build</span> +<span style="color:#06989A"><span style="opacity:0.5"> Artifact Cache: </span></span><span style="color:#C4A000">/home/user/.cache/buildstream/artifacts</span> +<span style="color:#06989A"><span style="opacity:0.5"> Strict Build Plan: </span></span><span style="color:#C4A000">Yes</span> +<span style="color:#06989A"><span style="opacity:0.5"> Maximum Fetch Tasks: </span></span><span style="color:#C4A000">10</span> +<span style="color:#06989A"><span style="opacity:0.5"> Maximum Build Tasks: </span></span><span style="color:#C4A000">4</span> +<span style="color:#06989A"><span style="opacity:0.5"> Maximum Push Tasks: </span></span><span style="color:#C4A000">4</span> +<span style="color:#06989A"><span style="opacity:0.5"> Maximum Network Retries: </span></span><span style="color:#C4A000">2</span> + +<span style="color:#C4A000"><span style="">Pipeline +</span></span><span style="color:#4E9A06"> buildable</span> <span style="color:#C4A000">a352c93edfc55a41868b4f482758ad3ea1c21571532373542cd20b9135f0718d</span> <span style="color:#3465A4"><span style="">base/alpine.bst</span></span> +<span style="color:#3465A4"> waiting</span> <span style="color:#C4A000">a8eeb045115a4a71c18d09fe14b7b4fc3f3e838414a7d23d7c6d4c3027f28743</span> <span style="color:#3465A4"><span style="">base.bst</span></span> +<span style="color:#3465A4"> waiting</span> <span style="color:#C4A000">c50da0531f050b51a7ddb6f331750642ad222ae6a81a16e091e026aa4d7cc07a</span> <span style="color:#3465A4"><span style="">hello.bst</span></span> +<span style="color:#06989A"><span style="opacity:0.5">=============================================================================== +</span></span><span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">a352c93e</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">base/alpine.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span><span style="color:#C4A000"><span style="opacity:0.5">running-commands/base-alpine/a352c93e-build.17046.log</span></span> +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">a352c93e</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">base/alpine.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Staging sources +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">04</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">a352c93e</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">base/alpine.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Staging sources +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">a352c93e</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">base/alpine.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Caching artifact +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">09</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">a352c93e</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">base/alpine.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Caching artifact +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">15</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">a352c93e</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">base/alpine.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span><span style="color:#C4A000"><span style="opacity:0.5">running-commands/base-alpine/a352c93e-build.17046.log</span></span> +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">a8eeb045</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">base.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span><span style="color:#C4A000"><span style="opacity:0.5">running-commands/base/a8eeb045-build.17054.log</span></span> +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">a8eeb045</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">base.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Caching artifact +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">a8eeb045</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">base.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Caching artifact +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">a8eeb045</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">base.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span><span style="color:#C4A000"><span style="opacity:0.5">running-commands/base/a8eeb045-build.17054.log</span></span> +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span><span style="color:#C4A000"><span style="opacity:0.5">running-commands/hello/c50da053-build.17056.log</span></span> +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Staging dependencies +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Staging dependencies +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Integrating sandbox +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Integrating sandbox +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Staging sources +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Staging sources +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Running build-commands +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Running build-commands +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#06989A"><span style=""><span style="opacity:0.5">STATUS </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Running build-commands + +<span style="opacity:0.5"> make PREFIX="/usr"</span> + +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Running build-commands +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Running build-commands +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Running install-commands +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Running install-commands +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#06989A"><span style=""><span style="opacity:0.5">STATUS </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Running install-commands + +<span style="opacity:0.5"> make -j1 PREFIX="/usr" DESTDIR="/buildstream-install" install</span> + +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Running install-commands +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Running install-commands +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Running strip-commands +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Running strip-commands +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#06989A"><span style=""><span style="opacity:0.5">STATUS </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Running strip-commands + +<span style="opacity:0.5"> find "/buildstream-install" -type f \ + '(' -perm -111 -o -name '*.so*' \ + -o -name '*.cmxs' -o -name '*.node' ')' \ + -exec sh -ec \ + 'read -n4 hdr <"$1" # check for elf header + if [ "$hdr" != "$(printf \\x7fELF)" ]; then + exit 0 + fi + debugfile="/buildstream-install/usr/lib/debug/$(basename "$1")" + mkdir -p "$(dirname "$debugfile")" + objcopy --only-keep-debug --compress-debug-sections "$1" "$debugfile" + chmod 644 "$debugfile" + strip --remove-section=.comment --remove-section=.note --strip-unneeded "$1" + objcopy --add-gnu-debuglink "$debugfile" "$1"' - {} ';'</span> + +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Running strip-commands +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Running strip-commands +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Caching artifact +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Caching artifact +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">01</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">build</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span><span style="color:#C4A000"><span style="opacity:0.5">running-commands/hello/c50da053-build.17056.log</span></span> +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">17</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Build + +<span style="color:#C4A000"><span style="">Pipeline Summary +</span></span><span style="color:#06989A"><span style="opacity:0.5"> Total: </span></span><span style="color:#C4A000">3</span> +<span style="color:#06989A"><span style="opacity:0.5"> Session: </span></span><span style="color:#C4A000">3</span> +<span style="color:#06989A"><span style="opacity:0.5"> Fetch Queue: </span></span><span style="color:#C4A000">processed </span><span style="color:#4E9A06">0</span><span style="color:#06989A"><span style="opacity:0.5">, </span></span><span style="color:#C4A000">skipped </span><span style="color:#C4A000">3</span><span style="color:#06989A"><span style="opacity:0.5">, </span></span><span style="color:#C4A000">failed </span><span style="color:#CC0000"><span style="opacity:0.5">0</span></span> +<span style="color:#06989A"><span style="opacity:0.5"> Build Queue: </span></span><span style="color:#C4A000">processed </span><span style="color:#4E9A06">3</span><span style="color:#06989A"><span style="opacity:0.5">, </span></span><span style="color:#C4A000">skipped </span><span style="color:#C4A000">0</span><span style="color:#06989A"><span style="opacity:0.5">, </span></span><span style="color:#C4A000">failed </span><span style="color:#CC0000"><span style="opacity:0.5">0</span></span> +</pre></div> diff --git a/doc/source/sessions-stored/running-commands-shell.html b/doc/source/sessions-stored/running-commands-shell.html new file mode 100644 index 000000000..a4666067f --- /dev/null +++ b/doc/source/sessions-stored/running-commands-shell.html @@ -0,0 +1,22 @@ +<!-- + WARNING: This file was generated with bst2html.py +--> +<div class="highlight" style="font-size:x-small"><pre> +<span style="color:#C4A000;font-weight:bold">user@host</span>:<span style="color:#3456A4;font-weight:bold">~/running-commands</span>$ bst shell hello.bst -- hello + +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Loading pipeline +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Loading pipeline +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Resolving pipeline +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Resolving pipeline +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Resolving cached state +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Resolving cached state +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Staging dependencies +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Staging dependencies +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Integrating sandbox +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Integrating sandbox +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000">c50da053</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#C4A000"> main</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">hello.bst </span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#06989A"><span style=""><span style="opacity:0.5">STATUS </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Running command + +<span style="opacity:0.5"> hello</span> + +Hello World +</pre></div> diff --git a/doc/source/sessions-stored/running-commands-show-after.html b/doc/source/sessions-stored/running-commands-show-after.html new file mode 100644 index 000000000..beb241112 --- /dev/null +++ b/doc/source/sessions-stored/running-commands-show-after.html @@ -0,0 +1,16 @@ +<!-- + WARNING: This file was generated with bst2html.py +--> +<div class="highlight" style="font-size:x-small"><pre> +<span style="color:#C4A000;font-weight:bold">user@host</span>:<span style="color:#3456A4;font-weight:bold">~/running-commands</span>$ bst show hello.bst + +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Loading pipeline +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Loading pipeline +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Resolving pipeline +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Resolving pipeline +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Resolving cached state +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Resolving cached state +<span style="color:#75507B"> cached</span> <span style="color:#C4A000">a352c93edfc55a41868b4f482758ad3ea1c21571532373542cd20b9135f0718d</span> <span style="color:#3465A4"><span style="">base/alpine.bst</span></span> +<span style="color:#75507B"> cached</span> <span style="color:#C4A000">a8eeb045115a4a71c18d09fe14b7b4fc3f3e838414a7d23d7c6d4c3027f28743</span> <span style="color:#3465A4"><span style="">base.bst</span></span> +<span style="color:#75507B"> cached</span> <span style="color:#C4A000">c50da0531f050b51a7ddb6f331750642ad222ae6a81a16e091e026aa4d7cc07a</span> <span style="color:#3465A4"><span style="">hello.bst</span></span> +</pre></div> diff --git a/doc/source/sessions-stored/running-commands-show-before.html b/doc/source/sessions-stored/running-commands-show-before.html new file mode 100644 index 000000000..f86a0739f --- /dev/null +++ b/doc/source/sessions-stored/running-commands-show-before.html @@ -0,0 +1,16 @@ +<!-- + WARNING: This file was generated with bst2html.py +--> +<div class="highlight" style="font-size:x-small"><pre> +<span style="color:#C4A000;font-weight:bold">user@host</span>:<span style="color:#3456A4;font-weight:bold">~/running-commands</span>$ bst show hello.bst + +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Loading pipeline +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Loading pipeline +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Resolving pipeline +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Resolving pipeline +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">--</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#3465A4"><span style=""><span style="opacity:0.5">START </span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Resolving cached state +<span style="color:#06989A"><span style="opacity:0.5">[</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">:</span></span><span style="color:#C4A000">00</span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">][</span></span><span style="color:#06989A"><span style="opacity:0.5">] </span></span><span style="color:#4E9A06"><span style=""><span style="opacity:0.5">SUCCESS</span></span></span><span style="color:#06989A"><span style="opacity:0.5"> </span></span>Resolving cached state +<span style="color:#4E9A06"> buildable</span> <span style="color:#C4A000">a352c93edfc55a41868b4f482758ad3ea1c21571532373542cd20b9135f0718d</span> <span style="color:#3465A4"><span style="">base/alpine.bst</span></span> +<span style="color:#3465A4"> waiting</span> <span style="color:#C4A000">a8eeb045115a4a71c18d09fe14b7b4fc3f3e838414a7d23d7c6d4c3027f28743</span> <span style="color:#3465A4"><span style="">base.bst</span></span> +<span style="color:#3465A4"> waiting</span> <span style="color:#C4A000">c50da0531f050b51a7ddb6f331750642ad222ae6a81a16e091e026aa4d7cc07a</span> <span style="color:#3465A4"><span style="">hello.bst</span></span> +</pre></div> diff --git a/doc/source/tutorial/running-commands.rst b/doc/source/tutorial/running-commands.rst new file mode 100644 index 000000000..78c6df648 --- /dev/null +++ b/doc/source/tutorial/running-commands.rst @@ -0,0 +1,205 @@ + + +Running commands +================ +In :ref:`the first chapter <tutorial_first_project>` we only imported +a file to create an artifact, this time lets run some commands inside +the :ref:`isolated build sandbox <sandboxing>`. + +.. note:: + + This example is distributed with BuildStream + in the `doc/examples/running-commands + <https://gitlab.com/BuildStream/buildstream/tree/master/doc/examples/running-commands>`_ + subdirectory. + + +Overview +-------- +In this chapter, we'll be running commands inside the sandboxed +execution environment and producing build output. + +We'll be compiling the following simple C file: + + +``files/src/hello.c`` +~~~~~~~~~~~~~~~~~~~~~ +.. literalinclude:: ../../examples/running-commands/files/src/hello.c + :language: c + + +And we're going to build it using ``make``, using the following Makefile: + + +``files/src/Makefile`` +~~~~~~~~~~~~~~~~~~~~~~ + +.. literalinclude:: ../../examples/running-commands/files/src/Makefile + :language: Makefile + + +We'll be using the most fundamental :ref:`build element <plugins_build_elements>`, +the :mod:`manual <elements.manual>` build element. + +The :mod:`manual <elements.manual>` element is the backbone on which all the other +build elements are built, so understanding how it works at this level is helpful. + + +Project structure +----------------- +In this project we have a ``project.conf``, a directory with some source +code, and 3 element declarations. + +Let's first take a peek at what we need to build using :ref:`bst show <invoking_show>`: + +.. raw:: html + :file: ../sessions/running-commands-show-before.html + +This time we have loaded a pipeline with 3 elements, let's go over what they do +in detail. + + +``project.conf`` +~~~~~~~~~~~~~~~~ + +.. literalinclude:: ../../examples/running-commands/project.conf + :language: yaml + +Our ``project.conf`` is very much like the last one, except that we +have defined a :ref:`source alias <project_source_aliases>` for ``alpine``. + +.. tip:: + + Using :ref:`source aliases <project_source_aliases>` for groups of sources + which are generally hosted together is encouraged. This allows one to globally + change the access scheme or URL for a group of repositories which belong together. + + +``elements/base/alpine.bst`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. literalinclude:: ../../examples/running-commands/elements/base/alpine.bst + :language: yaml + +This :mod:`import <elements.import>` element uses a :mod:`tar <sources.tar>` +source to download our Alpine Linux tarball to create our base runtime. + +This tarball is a sysroot which provides the C runtime libraries +and some programs - this is what will be providing the programs we're +going to run in this example. + + +``elements/base.bst`` +~~~~~~~~~~~~~~~~~~~~~ + +.. literalinclude:: ../../examples/running-commands/elements/base.bst + :language: yaml + +This is just a symbolic :mod:`stack <elements.stack>` element which declares that +anything which depends on it, will implicitly depend on ``base/alpine.bst``. + +It is typical to use stack elements in places where the implementing logical +software stack could change, but you rather not have your higher level components +carry knowledge about those changing components. + +Any element which :ref:`runtime depends <format_dependencies_types>` on +the ``base.bst`` will now be able to execute programs provided by the imported +``base/alpine.bst`` runtime. + + +``elements/hello.bst`` +~~~~~~~~~~~~~~~~~~~~~~ + +.. literalinclude:: ../../examples/running-commands/elements/hello.bst + :language: yaml + +Finally we have the element which executes commands. Looking at the +:mod:`manual <elements.manual>` element's documentation, we can see that +the element configuration exposes four command lists: + +* ``configure-commands`` + + Commands which are run in preparation of a build. This is where you + would normally call any configure stage build tools to configure + the build how you like and generate some files needed for the build. + +* ``build-commands`` + + Commands to run the build, usually a build system will + invoke the compiler for you here. + +* ``install-commands`` + + Commands to install the build results. + + Commands to install the build results into the target system, + these should install files somewhere under ``%{install-root}``. + +* ``strip-commands`` + + Commands to doctor the build results after the install. + + Typically this involves stripping binaries of debugging + symbols or stripping timestamps from build results to ensure + reproducibility. + +.. tip:: + + All other :ref:`build elements <plugins_build_elements>` + implement exactly the same command lists too, except that they provide + default commands specific to invoke the build systems they support. + +The :mod:`manual <elements.manual>` element however is the most basic +and does not provide any default commands, so we have instructed it +to use ``make`` to build and install our program. + + +Using the project +----------------- + + +Build the hello.bst element +~~~~~~~~~~~~~~~~~~~~~~~~~~~ +To build the project, run :ref:`bst build <invoking_build>` in the +following way: + +.. raw:: html + :file: ../sessions/running-commands-build.html + +Now we've built our hello world program, using ``make`` +and the C compiler provided by the Alpine Linux image. + +In the :ref:`first chapter <tutorial_first_project>` we observed that the inputs +and output of an element are *directory trees*. In this example, the directory tree +generated by ``base/alpine.bst`` is consumed by ``hello.bst`` due to the +:ref:`implicit runtime dependency <format_dependencies_types>` introduced by ``base.bst``. + +.. tip:: + + All of the :ref:`dependencies <format_dependencies>` which are required to run for + the sake of a build, are staged at the root of the build sandbox. These comprise the + runtime environment in which the depending element will run commands. + + The result is that the ``make`` program and C compiler provided by ``base/alpine.bst`` + were already in ``$PATH`` and ready to run when the commands were needed by ``hello.bst``. + +Now observe that all of the elements in the loaded pipeline are ``cached``, +the element is *built*: + +.. raw:: html + :file: ../sessions/running-commands-show-after.html + + +Run the hello world program +~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Now that we've built everything, we can indulge ourselves in running +the hello world program using :ref:`bst shell <invoking_build>`: + +.. raw:: html + :file: ../sessions/running-commands-shell.html + +Here, :ref:`bst shell <invoking_build>` created a runtime environment for running +the ``hello.bst`` element. This was done by staging all of the dependencies of +``hello.bst`` including the ``hello.bst`` output itself into a directory. Once a directory +with all of the dependencies was staged and ready, we ran the ``hello`` command from +within the build sandbox environment. diff --git a/doc/source/using_tutorial.rst b/doc/source/using_tutorial.rst index 8a0116d04..c9e4dfb57 100644 --- a/doc/source/using_tutorial.rst +++ b/doc/source/using_tutorial.rst @@ -9,3 +9,4 @@ projects. :maxdepth: 1 tutorial/first-project + tutorial/running-commands diff --git a/tests/examples/running-commands.py b/tests/examples/running-commands.py new file mode 100644 index 000000000..95f645d77 --- /dev/null +++ b/tests/examples/running-commands.py @@ -0,0 +1,36 @@ +import os +import pytest + +from tests.testutils import cli_integration as cli +from tests.testutils.integration import assert_contains +from tests.testutils.site import IS_LINUX + + +pytestmark = pytest.mark.integration +DATA_DIR = os.path.join( + os.path.dirname(os.path.realpath(__file__)), '..', '..', 'doc', 'examples', 'running-commands' +) + + +@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') +@pytest.mark.datafiles(DATA_DIR) +def test_running_commands_build(cli, tmpdir, datafiles): + project = os.path.join(datafiles.dirname, datafiles.basename) + checkout = os.path.join(cli.directory, 'checkout') + + result = cli.run(project=project, args=['build', 'hello.bst']) + assert result.exit_code == 0 + + +# Test running the executable +@pytest.mark.skipif(not IS_LINUX, reason='Only available on linux') +@pytest.mark.datafiles(DATA_DIR) +def test_running_commands_run(cli, tmpdir, datafiles): + project = os.path.join(datafiles.dirname, datafiles.basename) + + result = cli.run(project=project, args=['build', 'hello.bst']) + assert result.exit_code == 0 + + result = cli.run(project=project, args=['shell', 'hello.bst', '--', 'hello']) + assert result.exit_code == 0 + assert result.output == 'Hello World\n' |