git.annexia.org
/
libguestfs-talks.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update notes.
[libguestfs-talks.git]
/
2020-goals
/
notes.txt
diff --git
a/2020-goals/notes.txt
b/2020-goals/notes.txt
index
65f2d22
..
e76dff1
100644
(file)
--- a/
2020-goals/notes.txt
+++ b/
2020-goals/notes.txt
@@
-16,15
+16,15
@@
we addressed some shortcomings.
-
TACTIC
PROBLEM:
+
PREDICATE
PROBLEM:
-Only one
tactic
for solving dependencies.
+Only one
predicate
for solving dependencies.
"If the target file doesn't exist, or if it's older than
one of the dependencies, then run this recipe."
If you think for a little while you'll see that other
"If the target file doesn't exist, or if it's older than
one of the dependencies, then run this recipe."
If you think for a little while you'll see that other
-
tactic
s are possible:
+
predicate
s are possible:
eg: URL, newer than any file (not all files),
Koji build, comparing checksums, test with skip
eg: URL, newer than any file (not all files),
Koji build, comparing checksums, test with skip
@@
-125,26
+125,26
@@
if you want you can also run compile ("bar") directly:
-
Tactic
s are special rules that we can use to change how we
+
Predicate
s are special rules that we can use to change how we
determine if a goal needs to be rebuilt. When you see a
determine if a goal needs to be rebuilt. When you see a
-filename string, there's an implicit
tactic called *
file, so
+filename string, there's an implicit
predicate called is-
file, so
these are equivalent, because when goals sees a bare string
these are equivalent, because when goals sees a bare string
-but it wants a
tactic it implicitly uses *
file.
+but it wants a
predicate it implicitly uses is-
file.
"target" : "foo.o", "bar.o" { ... }
"target" : "foo.o", "bar.o" { ... }
-
*file("target") : *file("foo.o"), *
file("bar.o") { ... }
+
is-file("target") : is-file("foo.o"), is-
file("bar.o") { ... }
-Apart from
*file being the default tactic
, it's not built
-into goals. In fact
*
file is defined in the goals standard
+Apart from
is-file being the default predicate
, it's not built
+into goals. In fact
is-
file is defined in the goals standard
library. The special @{...} code section means the code
doesn't print verbosely when its running. And "exit 99"
library. The special @{...} code section means the code
doesn't print verbosely when its running. And "exit 99"
-is used by the
tactic
to indicate that the target needs
+is used by the
predicate
to indicate that the target needs
to be rebuilt, but other than that it's all written in
ordinary shell script:
to be rebuilt, but other than that it's all written in
ordinary shell script:
-
tactic *
file (filename) = @{
+
predicate is-
file (filename) = @{
test -f %filename || exit 99
for f in %<; do
test %filename -ot "$f" && exit 99 ||:
test -f %filename || exit 99
for f in %<; do
test %filename -ot "$f" && exit 99 ||:
@@
-153,11
+153,11
@@
ordinary shell script:
-And you can of course write other
tactic
s in shell script.
-Here's a
tactic for running test suites. This tactic
lets
+And you can of course write other
predicate
s in shell script.
+Here's a
predicate for running test suites. This predicate
lets
you skip a test by setting an environment variable.
you skip a test by setting an environment variable.
-
tactic *
test (script) = @{
+
predicate is-
test (script) = @{
# Check if SKIP variable is set.
skip_var=$(
echo -n SKIP_%script |
# Check if SKIP variable is set.
skip_var=$(
echo -n SKIP_%script |
@@
-168,19
+168,19
@@
you skip a test by setting an environment variable.
if test %goals_final_check; then exit 0; else exit 99; fi
}
if test %goals_final_check; then exit 0; else exit 99; fi
}
-You can use the
tactic
like this. There's quite a lot to unpack
+You can use the
predicate
like this. There's quite a lot to unpack
in this example, but I'll just say that the wildcard function
expands to a list of files, and the wrap function changes them
in this example, but I'll just say that the wildcard function
expands to a list of files, and the wrap function changes them
-from a list of strings into a list of
*test tactic
s.
+from a list of strings into a list of
is-test predicate
s.
- let tests = wrap ("
*
test", wildcard ("test-*.sh"))
+ let tests = wrap ("
is-
test", wildcard ("test-*.sh"))
goal check () = : tests
goal check () = : tests
- goal run (script) =
*
test(script) : { ./%script }
+ goal run (script) =
is-
test(script) : { ./%script }
-Another
tactic we use is called *
koji-built, which I
+Another
predicate we use is called is-
koji-built, which I
use for mass rebuilding Fedora packages in dependency order.
use for mass rebuilding Fedora packages in dependency order.
-I won't go into the full definition of
*
koji-built since
+I won't go into the full definition of
is-
koji-built since
interfacing with Koji is quite complicated, but you can
write a mass rebuild tool in goals fairly easily:
interfacing with Koji is quite complicated, but you can
write a mass rebuild tool in goals fairly easily:
@@
-232,10
+232,10
@@
because they point to future ways we might explore this space.
goal link = "program" : "foo.o" { %CC %CFLAGS %< -o %@ }
goal link = "program" : "foo.o" { %CC %CFLAGS %< -o %@ }
- -
Tactic
s are constructors
+ -
Predicate
s are constructors
- Targets are patterns
- Targets are patterns
-
*file ("%name.o") : ...
match name with
+
is-file ("%name.o") : ...
match name with
| File (name + ".o") -> compile name
| ...
| File (name + ".o") -> compile name
| ...
@@
-277,19
+277,11
@@
TO-DO
f ("goals", "0.1")
f ("goals", "0.1")
-----
-to do:
-
- - Explain tactics better, Kashyap found it confusing.
-
- - Should "tactic" be "predicate"?
- Tactics might use βis-β instead of β*β, eg. is-file, is-koji-built
-
- Cover some of the other tools that are better makes.
(Note I'm not covering all DAG solvers like Ninja unless they
bring something new to the table)
- Cover some of the other tools that are better makes.
(Note I'm not covering all DAG solvers like Ninja unless they
bring something new to the table)
- * Plan 9 mk - has alternate build
tactic
s
+ * Plan 9 mk - has alternate build
predicate
s
* https://github.com/casey/just - has functions and multi-parameter rules
* https://github.com/casey/just - has functions and multi-parameter rules
@@
-299,3
+291,10
@@
to do:
* https://github.com/apenwarr/redo - similar to above
* https://web.archive.org/web/20001027183954/http://software-carpentry.codesourcery.com/entries/build/Tromey/Tromey.html
* https://github.com/apenwarr/redo - similar to above
* https://web.archive.org/web/20001027183954/http://software-carpentry.codesourcery.com/entries/build/Tromey/Tromey.html
+
+
+----
+to do:
+
+ - Explain predicates better, Kashyap found it confusing.
+