engine: Fix up some send/recv corner cases

Initially I wasn't 100% clear or decided on the send/recv semantics.
After some experimenting, I think this is much closer to what we want.
Nothing should break or regress here, this only enables more
possibilities.
This commit is contained in:
James Shubin
2025-05-05 23:53:37 -04:00
parent ae1d9b94d4
commit 774d408e13
17 changed files with 412 additions and 32 deletions

View File

@@ -0,0 +1,11 @@
exec "a" {
shell => "/bin/bash",
cmd => "echo hello | tee /tmp/hello",
creates => "/tmp/hello",
}
file "/tmp/hello" {
mode => "ug=rw,o=",
}
Exec["a"].output -> File["/tmp/hello"].content

View File

@@ -0,0 +1,20 @@
import "os"
$f = "/tmp/export1"
exec "a" {
shell => "/bin/bash",
cmd => "echo hello | tee ${f}",
creates => "${f}",
send_output => os.readfile("${f}"), # extra graph event but safer in debug
Before => File["${f}"],
}
file "${f}" {
state => $const.res.file.state.exists,
mode => "ug=rw,o=",
Meta:export => ["*",],
}
Exec["a"].output -> File["${f}"].content