diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-04-22 15:50:27 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-04-23 12:47:11 +0200 |
commit | 72d8bb2c3bf74f24e5def6b16c932c9c0165c6ee (patch) | |
tree | 2f40406c2fb2cfbe79e815479a8c14bdf048ce70 /doc/tutorial/hello-world.md | |
parent | 66ee4bff8d5d54e63517f89ec1a2927e9c29638d (diff) | |
download | justbuild-72d8bb2c3bf74f24e5def6b16c932c9c0165c6ee.tar.gz |
tutorial: Update outputs and other improvements
When tutorial docs were changed to showcase running commands with
just-mr instead of just, the outputs were not changed. This is now
fixed to showcase the results run with current master just-mr (and
just), together with other small improvements and fixes.
Diffstat (limited to 'doc/tutorial/hello-world.md')
-rw-r--r-- | doc/tutorial/hello-world.md | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/doc/tutorial/hello-world.md b/doc/tutorial/hello-world.md index 23c63d9a..52efbc8f 100644 --- a/doc/tutorial/hello-world.md +++ b/doc/tutorial/hello-world.md @@ -116,6 +116,9 @@ command line: ``` sh $ just-mr build helloworld +INFO: Performing repositories setup +INFO: Found 2 repositories to set up +INFO: Setup finished, exec ["just","build","-C","...","helloworld"] INFO: Requested target is [["@","tutorial","","helloworld"],{}] INFO: Analysed target [["@","tutorial","","helloworld"],{}] INFO: Discovered 2 actions, 1 trees, 0 blobs @@ -139,10 +142,10 @@ performs the actual build. Note that these two programs, `just-mr` and `just`, can also be run individually. To do so, first run `just-mr` with `setup` and capture the -path to the generated build configuration from stdout by assigning it to -a shell variable (e.g., `CONF`). Afterwards, `just` can be called to -perform the actual build by explicitly specifying the configuration file -via `-C`: +path to the generated build configuration from stdout (above omitted from the +log message as `"..."`) by assigning it to a shell variable (e.g., `CONF`). +Afterwards, `just` can be called to perform the actual build by explicitly +specifying the configuration file via `-C`, e.g.: ``` sh $ CONF=$(just-mr setup tutorial) @@ -162,6 +165,9 @@ object that sets `"CXX"` to `"clang++"`: ``` sh $ just-mr build helloworld -D'{"CXX":"clang++"}' +INFO: Performing repositories setup +INFO: Found 2 repositories to set up +INFO: Setup finished, exec ["just","build","-C","...","helloworld","-D{\"CXX\":\"clang++\"}"] INFO: Requested target is [["@","tutorial","","helloworld"],{"CXX":"clang++"}] INFO: Analysed target [["@","tutorial","","helloworld"],{"CXX":"clang++"}] INFO: Discovered 2 actions, 1 trees, 0 blobs @@ -252,11 +258,15 @@ directory. As our `"defaults"` target is in the directory `"CC"` of the rules repository we could also have written the rule `"type"` simply as `"defaults"`. -To rebuild the project, we need to rerun `just-mr` (note that due to -configuration changes, rerunning only `just` would not suffice): +To rebuild the project, we rerun `just-mr` (note that due to configuration +changes, we expect the intermediary configuration file hash reported to also +change): ``` sh $ just-mr build helloworld +INFO: Performing repositories setup +INFO: Found 3 repositories to set up +INFO: Setup finished, exec ["just","build","-C","...","helloworld"] INFO: Requested target is [["@","tutorial","","helloworld"],{}] INFO: Analysed target [["@","tutorial","","helloworld"],{}] INFO: Discovered 2 actions, 1 trees, 0 blobs @@ -296,8 +306,13 @@ Modeling target dependencies For demonstration purposes, we will separate the print statements into a static library `greet`, which will become a dependency to our binary. -Therefore, we create a new subdirectory `greet` with the files -`greet/greet.hpp`: +Therefore, we create a new subdirectory `greet` + +``` sh +$ mkdir -p ./greet +``` + +with the files `greet/greet.hpp`: ``` {.cpp srcname="greet/greet.hpp"} #include <string> @@ -376,6 +391,9 @@ binary can be built with the same command as before (no need to rerun ``` sh $ just-mr build helloworld +INFO: Performing repositories setup +INFO: Found 3 repositories to set up +INFO: Setup finished, exec ["just","build","-C","...","helloworld"] INFO: Requested target is [["@","tutorial","","helloworld"],{}] INFO: Analysed target [["@","tutorial","","helloworld"],{}] INFO: Discovered 4 actions, 2 trees, 0 blobs @@ -391,6 +409,9 @@ run the following command: ``` sh $ just-mr build greet greet +INFO: Performing repositories setup +INFO: Found 3 repositories to set up +INFO: Setup finished, exec ["just","build","-C","...","greet","greet"] INFO: Requested target is [["@","tutorial","greet","greet"],{}] INFO: Analysed target [["@","tutorial","greet","greet"],{}] INFO: Discovered 2 actions, 1 trees, 0 blobs |