feat(tvix/eval): use EvalIO::import_path when coercing paths
This "ties the knot" of importing files into a store when referring to them through path literals, e.g. inside of strings. I'm not yet sure if this interface is sufficient for builtins.path (which we haven't implemented at all yet), but it's enough to wire up eval & store initially. In the default implementations nothing interesting happens in this function at all. Change-Id: Ie01ff4161617d1e743a68dbd1a5e54c1b40c0990 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7582 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
This commit is contained in:
parent
edd13573f5
commit
270b1084e8
3 changed files with 28 additions and 3 deletions
|
|
@ -185,7 +185,8 @@ impl Value {
|
|||
// sequences without NUL bytes, whereas Tvix only allows valid
|
||||
// Unicode. See also b/189.
|
||||
(Value::Path(p), kind) if kind != CoercionKind::ThunksOnly => {
|
||||
Ok(p.to_string_lossy().into_owned().into())
|
||||
let imported = vm.io().import_path(p)?;
|
||||
Ok(imported.to_string_lossy().into_owned().into())
|
||||
}
|
||||
|
||||
// Attribute sets can be converted to strings if they either have an
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue