diff options
Diffstat (limited to 'doc/tutorial')
-rw-r--r-- | doc/tutorial/proto.org | 17 | ||||
-rw-r--r-- | doc/tutorial/rebuild.org | 8 | ||||
-rw-r--r-- | doc/tutorial/target-file-glob-tree.org | 27 | ||||
-rw-r--r-- | doc/tutorial/tests.org | 15 |
4 files changed, 33 insertions, 34 deletions
diff --git a/doc/tutorial/proto.org b/doc/tutorial/proto.org index a1eab184..c8ccc5fe 100644 --- a/doc/tutorial/proto.org +++ b/doc/tutorial/proto.org @@ -55,8 +55,7 @@ those would be added to the ~"deps"~ field. When building the library, there's very little to do. #+BEGIN_SRC sh -$ CONF=$(just-mr -C repos.json setup) -$ just build -C $CONF examples address +$ just-mr build examples address INFO: Requested target is [["@","","examples","address"],{}] INFO: Analysed target [["@","","examples","address"],{}] INFO: Export targets found: 0 cached, 0 uncached, 0 not eligible for caching @@ -79,7 +78,7 @@ and did not even construct the dependency graph for that target. A proto library simply provides the dependency structure of the ~.proto~ files. #+BEGIN_SRC sh -$ just analyse --dump-nodes - -C $CONF examples address +$ just-mr analyse --dump-nodes - examples address INFO: Requested target is [["@","","examples","address"],{}] INFO: Result of target [["@","","examples","address"],{}]: { "artifacts": { @@ -178,9 +177,9 @@ a bit of time, as the proto compiler has to be built. But in follow-up builds, also in different projects, the target-level cache is filled already. #+BEGIN_SRC sh -$ just build -C $CONF examples add_person +$ just-mr build examples add_person ... -$ just build -C $CONF examples add_person +$ just-mr build examples add_person INFO: Requested target is [["@","","examples","add_person"],{}] INFO: Analysed target [["@","","examples","add_person"],{}] INFO: Export targets found: 3 cached, 0 uncached, 0 not eligible for caching @@ -196,7 +195,7 @@ If we look at the actions associated with the binary, we find that those are still the two actions we expect: a compile action and a link action. #+BEGIN_SRC sh -$ just analyse -C $CONF examples add_person --dump-actions - +$ just-mr analyse examples add_person --dump-actions - INFO: Requested target is [["@","","examples","add_person"],{}] INFO: Result of target [["@","","examples","add_person"],{}]: { "artifacts": { @@ -243,7 +242,7 @@ still analysed. In the one anonymous target, we find again the abstract node we discussed earlier. #+BEGIN_SRC sh -$ just analyse -C $CONF examples add_person --dump-targets - +$ just-mr analyse examples add_person --dump-targets - INFO: Requested target is [["@","","examples","add_person"],{}] INFO: Result of target [["@","","examples","add_person"],{}]: { "artifacts": { @@ -333,7 +332,7 @@ the expected additional targets and the one anonymous target is reused by both binaries. #+BEGIN_SRC sh -$ just analyse -C $CONF examples test --dump-targets - +$ just-mr analyse examples test --dump-targets - INFO: Requested target is [["@","","examples","test"],{}] INFO: Result of target [["@","","examples","test"],{}]: { "artifacts": { @@ -389,7 +388,7 @@ $ Finally, the test passes and the output is as expected. #+BEGIN_SRC sh -$ just build -C $CONF examples test -Pwork/out.txt +$ just-mr build examples test -Pwork/out.txt INFO: Requested target is [["@","","examples","test"],{}] INFO: Analysed target [["@","","examples","test"],{}] INFO: Export targets found: 3 cached, 0 uncached, 0 not eligible for caching diff --git a/doc/tutorial/rebuild.org b/doc/tutorial/rebuild.org index 3fa7cece..6eb6b6ba 100644 --- a/doc/tutorial/rebuild.org +++ b/doc/tutorial/rebuild.org @@ -85,7 +85,7 @@ $ cat TARGETS , "deps": ["out.txt"] } } -$ just build -C $CONF +$ just-mr build INFO: Requested target is [["@","tutorial","",""],{}] INFO: Analysed target [["@","tutorial","",""],{}] INFO: Export targets found: 0 cached, 0 uncached, 0 not eligible for caching @@ -96,7 +96,7 @@ INFO: Artifacts built, logical paths are: bin/hello [59f7af154b3b7beac4a6cab40499cb3b388220c4:16608:x] share/hello/OUT.txt [428b97b82b6c59cad7488b24e6b618ebbcd819bc:13:f] share/hello/version.txt [088ae5a8a57f62016392bdf124a9b8dfc0288763:39:f] -$ just build -C $CONF +$ just-mr build INFO: Requested target is [["@","tutorial","",""],{}] INFO: Analysed target [["@","tutorial","",""],{}] INFO: Export targets found: 0 cached, 0 uncached, 0 not eligible for caching @@ -107,7 +107,7 @@ INFO: Artifacts built, logical paths are: bin/hello [59f7af154b3b7beac4a6cab40499cb3b388220c4:16608:x] share/hello/OUT.txt [428b97b82b6c59cad7488b24e6b618ebbcd819bc:13:f] share/hello/version.txt [088ae5a8a57f62016392bdf124a9b8dfc0288763:39:f] -$ just rebuild -C $CONF +$ just-mr rebuild INFO: Requested target is [["@","tutorial","",""],{}] INFO: Analysed target [["@","tutorial","",""],{}] INFO: Export targets found: 0 cached, 0 uncached, 0 not eligible for caching @@ -138,7 +138,7 @@ of a larger, quality-assurance process. To support the automation of such processes, the findings can also be reported in machine-readable form. #+BEGIN_SRC sh -$ just rebuild -C $CONF --dump-flaky flakes.json --dump-graph actions.json +$ just-mr rebuild --dump-flaky flakes.json --dump-graph actions.json [...] $ cat flakes.json { diff --git a/doc/tutorial/target-file-glob-tree.org b/doc/tutorial/target-file-glob-tree.org index 142088d0..c0b8c6ed 100644 --- a/doc/tutorial/target-file-glob-tree.org +++ b/doc/tutorial/target-file-glob-tree.org @@ -16,12 +16,13 @@ popular in German news. The sources are an archive available on the web. As upstream uses a different build system, we have to provide our own build description; we take the top-level directory as layer for this. As we also want -to patch the definition file, we add the subdirctory ~files~ as +to patch the definition file, we add the subdirectory ~files~ as logical repository for the patches. Hence we create a file ~repos.json~ with the following content. #+BEGIN_SRC js -{ "repositories": +{ "main": "units" +, "repositories": { "just-rules":{ /* ... unchanged ... */ } , "import targets": {"repository": {"type": "file", "path": "."}} , "patches": {"repository": {"type": "file", "path": "files"}} @@ -40,11 +41,11 @@ with the following content. } #+END_SRC -The repository to set up is ~units~ and, as usual, we set the -shell variable ~CONF~ to the resulting multi-repository configuration. +The repository to set up is ~units~ and, as usual, we can use ~just-mr~ to +fetch the archive and obtain the resulting multi-repository configuration. #+BEGIN_SRC sh -$ CONF=$(/usr/src/justbuild/bin/just-mr.py -C repos.json setup units) +$ just-mr setup units #+END_SRC ** Patching a file: targets versus ~FILE~ @@ -64,7 +65,7 @@ empty object and refine it later. #+BEGIN_SRC sh $ echo {} > TARGETS.units -$ just install -C $CONF -o . definitions.units +$ just-mr install -o . definitions.units INFO: Requested target is [["@","units","","definitions.units"],{}] INFO: Analysed target [["@","units","","definitions.units"],{}] INFO: Export targets found: 0 cached, 0 uncached, 0 not eligible for caching @@ -123,7 +124,7 @@ must not modify their inputs) and, in fact, have a fixed command line. #+BEGIN_SRC sh -$ just analyse -C $CONF definitions.units --dump-actions - +$ just-mr analyse definitions.units --dump-actions - INFO: Requested target is [["@","units","","definitions.units"],{}] INFO: Result of target [["@","units","","definitions.units"],{}]: { "artifacts": { @@ -165,7 +166,7 @@ $ Building ~"definitions.units"~ we find out patch applied correctly. #+BEGIN_SRC sh -$ just build -C $CONF definitions.units -P definitions.units | grep -A 5 'German units' +$ just-mr build definitions.units -P definitions.units | grep -A 5 'German units' INFO: Requested target is [["@","units","","definitions.units"],{}] INFO: Analysed target [["@","units","","definitions.units"],{}] INFO: Export targets found: 0 cached, 0 uncached, 0 not eligible for caching @@ -196,7 +197,7 @@ In this way, we get the desired collection of one unmodified source file and the output of the patch action. #+BEGIN_SRC sh -$ just analyse -C $CONF data +$ just-mr analyse data INFO: Requested target is [["@","units","","data"],{}] INFO: Result of target [["@","units","","data"],{}]: { "artifacts": { @@ -292,7 +293,7 @@ The result basically work and shows that we have 5 source files in total, giving 5 compile and one link action. #+BEGIN_SRC sh -$ just build -C $CONF units +$ just-mr build units INFO: Requested target is [["@","units","","units"],{}] INFO: Analysed target [["@","units","","units"],{}] INFO: Export targets found: 0 cached, 0 uncached, 0 not eligible for caching @@ -314,7 +315,7 @@ simply set an appropriate compiler flag, but let's do things properly and patch away the underlying reason. To do so, we first create a patch. #+BEGIN_SRC sh -$ just install -C $CONF -o . strfunc.c +$ just-mr install -o . strfunc.c INFO: Requested target is [["@","units","","strfunc.c"],{}] INFO: Analysed target [["@","units","","strfunc.c"],{}] INFO: Export targets found: 0 cached, 0 uncached, 0 not eligible for caching @@ -366,7 +367,7 @@ the same object file as the unpatched file (after all, we only wanted to get rid of a warning), the linking step can be taken from cache. #+BEGIN_SRC sh -$ just build -C $CONF units +$ just-mr build units INFO: Requested target is [["@","units","","units"],{}] INFO: Analysed target [["@","units","","units"],{}] INFO: Export targets found: 0 cached, 0 uncached, 0 not eligible for caching @@ -388,7 +389,7 @@ artifacts according to the usual conventions. Then things work as expected #+BEGIN_SRC sh -$ just install -C $CONF -o /tmp/testinstall +$ just-mr install -o /tmp/testinstall INFO: Requested target is [["@","units","",""],{}] INFO: Analysed target [["@","units","",""],{}] INFO: Export targets found: 0 cached, 0 uncached, 0 not eligible for caching diff --git a/doc/tutorial/tests.org b/doc/tutorial/tests.org index ad763fad..7bbcf66c 100644 --- a/doc/tutorial/tests.org +++ b/doc/tutorial/tests.org @@ -92,8 +92,7 @@ $ echo '{}' > tutorial-defaults/CC/test/TARGETS Now we can run the test (i.e., build the test result): #+BEGIN_SRC sh -$ CONF=$(/usr/src/justbuild/bin/just-mr.py -C repos.json setup tutorial) -$ just build -C $CONF greet test +$ just-mr build greet test INFO: Requested target is [["@","tutorial","greet","test"],{}] INFO: Analysed target [["@","tutorial","greet","test"],{}] INFO: Export targets found: 0 cached, 0 uncached, 0 not eligible for caching @@ -128,7 +127,7 @@ of the artifact that should be printed on the command line, in our case ~stdout~: #+BEGIN_SRC sh -$ just build -C $CONF greet test --log-limit 1 -P stdout +$ just-mr build greet test --log-limit 1 -P stdout greet output: Hello World! greet output: Hello Universe! @@ -145,7 +144,7 @@ the test binary is the last action associated with the test and the test binary is, of course, one of its inputs. #+BEGIN_SRC sh -$ just analyse -C $CONF --request-action-input -1 greet test +$ just-mr analyse --request-action-input -1 greet test INFO: Requested target is [["@","tutorial","greet","test"],{}] INFO: Request is input of action #-1 INFO: Result of input of action #-1 of target [["@","tutorial","greet","test"],{}]: { @@ -182,10 +181,10 @@ The provided data also shows us the precise description of the action for which we request the input. This allows us to manually rerun the action. Or we can simply interact with the test binary manually after installing the inputs to this action. Requesting the inputs -of an action can also be usefull when debugging a build failure. +of an action can also be useful when debugging a build failure. #+BEGIN_SRC sh -$ just install -o work -C $CONF --request-action-input -1 greet test +$ just-mr install -o work --request-action-input -1 greet test INFO: Requested target is [["@","tutorial","greet","test"],{}] INFO: Request is input of action #-1 INFO: Analysed target [["@","tutorial","greet","test"],{}] @@ -250,7 +249,7 @@ $ echo '{}' > tutorial-defaults/shell/test/TARGETS Now we can run the shell test (i.e., build the test result): #+BEGIN_SRC sh -$ just build -C $CONF test +$ just-mr build test INFO: Requested target is [["@","tutorial","","test"],{}] INFO: Analysed target [["@","tutorial","","test"],{}] INFO: Export targets found: 0 cached, 0 uncached, 0 not eligible for caching @@ -305,7 +304,7 @@ Now we can run all tests at once by just building the compound test target ~"all_tests"~: #+BEGIN_SRC sh -$ just build -C $CONF all_tests +$ just-mr build all_tests INFO: Requested target is [["@","tutorial","","all_tests"],{}] INFO: Analysed target [["@","tutorial","","all_tests"],{}] INFO: Export targets found: 0 cached, 0 uncached, 0 not eligible for caching |