fix(tvix/eval): catchable-aware builtins
A bunch of operations in Tvix are not aware of catchable values and does not propagate them. In the meantime, as we wait for a better solution, we just offer this commit for moving the needle. Change-Id: Ic3f0e1550126b0847b597dfc1402c35e0eeef469 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10473 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
This commit is contained in:
parent
37cc88897e
commit
2750e1e640
6 changed files with 328 additions and 41 deletions
|
|
@ -589,16 +589,19 @@ impl Value {
|
|||
.context("comparing derivations")?
|
||||
.clone();
|
||||
|
||||
let result = out1
|
||||
.clone()
|
||||
.force(co, span.clone())
|
||||
.await?
|
||||
.to_contextful_str()?
|
||||
== out2
|
||||
.clone()
|
||||
.force(co, span.clone())
|
||||
.await?
|
||||
.to_contextful_str()?;
|
||||
let out1 = out1.clone().force(co, span.clone()).await?;
|
||||
let out2 = out2.clone().force(co, span.clone()).await?;
|
||||
|
||||
if out1.is_catchable() {
|
||||
return Ok(out1);
|
||||
}
|
||||
|
||||
if out2.is_catchable() {
|
||||
return Ok(out2);
|
||||
}
|
||||
|
||||
let result =
|
||||
out1.to_contextful_str()? == out2.to_contextful_str()?;
|
||||
if !result {
|
||||
return Ok(Value::Bool(false));
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue