summaryrefslogtreecommitdiff
path: root/doc/tutorial
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2022-12-13 16:18:58 +0100
committerOliver Reiche <oliver.reiche@huawei.com>2022-12-16 14:33:01 +0100
commit85857f74ffa4d2ecf006bb690f95d38c447bcf79 (patch)
treec41496ecb1f964a7f3c873aec48d7d5cfc04b35b /doc/tutorial
parente73c80eec3850e702f37c79ec67971bc107b091d (diff)
downloadjustbuild-85857f74ffa4d2ecf006bb690f95d38c447bcf79.tar.gz
tutorial: Add missing hello.cpp to rebuild section
Diffstat (limited to 'doc/tutorial')
-rw-r--r--doc/tutorial/rebuild.org39
1 files changed, 30 insertions, 9 deletions
diff --git a/doc/tutorial/rebuild.org b/doc/tutorial/rebuild.org
index 6eb6b6ba..115aff10 100644
--- a/doc/tutorial/rebuild.org
+++ b/doc/tutorial/rebuild.org
@@ -36,16 +36,26 @@ order) actions that yield a different output.
** Rebuilding
-To search for the root cause of non-reproducibility, ~just~ has
-a subcommand ~rebuild~. It builds the specified target again, requesting
-that every action be executed again (but target-level cache is still
-active); then the result of every action is compared to the one in the
-action cache, if present with the same inputs. So, you typically would
-first ~build~ and then ~rebuild~. Note that a repeated ~build~ simply
-takes the action result from cache.
+For the remainder of this section, we will consider the following example
+project with the C++ source file ~hello.cpp~:
-#+BEGIN_SRC sh
-$ cat TARGETS
+#+SRCNAME: hello.cpp
+#+BEGIN_SRC cpp
+#include <iostream>
+#include "version.h"
+
+int main(int argc, const char* argv[]) {
+ if (argc > 1 && std::string{argv[1]} == "-v") {
+ std::cout << VERSION << std::endl;
+ }
+ return 0;
+}
+#+END_SRC
+
+and the following ~TARGETS~ file:
+
+#+SRCNAME: TARGETS
+#+BEGIN_SRC js
{ "":
{ "type": "install"
, "files":
@@ -85,6 +95,17 @@ $ cat TARGETS
, "deps": ["out.txt"]
}
}
+#+END_SRC
+
+To search for the root cause of non-reproducibility, ~just~ has
+a subcommand ~rebuild~. It builds the specified target again, requesting
+that every action be executed again (but target-level cache is still
+active); then the result of every action is compared to the one in the
+action cache, if present with the same inputs. So, you typically would
+first ~build~ and then ~rebuild~. Note that a repeated ~build~ simply
+takes the action result from cache.
+
+#+BEGIN_SRC sh
$ just-mr build
INFO: Requested target is [["@","tutorial","",""],{}]
INFO: Analysed target [["@","tutorial","",""],{}]