tvl-depot/tvix/glue/Cargo.toml
Florian Klink c6605992c0 feat(tvix/glue): drive builds on IO
That's one possible abstraction to drive builds.
Whenever IO into a store path is requested, we look up the root node,
and in case we don't have it in PathInfoService, but KnownPaths gives us
a Derivation for that output path, trigger a build and await the result.

This recursively might trigger builds for parent paths if they haven't
been built yet.

Another option would be to simply expose a PathInfoService interface for
a builder too, and loop all building into IO via PathInfoService
composition - but let's start with something.

Note tvix-cli doesn't have a configurable BuildService yet, it's plugged
to the DummyBuildService, so whenever it needs to do a build, it'll fail,
but that's how it can be provoked:

```
(builtins.readFile (import <nixpkgs> {}).hello.outPath + "/bin/hello")
[…]
error[E029]: I/O error: /nix/store/cg8a576pz2yfc1wbhxm1zy4x7lrk8pix-hello-2.12.1: builds are not supported with DummyBuildService
 --> [code]:1:2
  |
1 | (builtins.readFile (import <nixpkgs> {}).hello.outPath + "/bin/hello")
  |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

Note how this fails, while pure output path calculation
(`(import <nixpkgs> {}).hello.outPath + "/bin/hello")`) still succeeds.

Change-Id: Id2075d8a2b18554d0dd608b4b29146a8cd411e7f
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10793
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Tested-by: BuildkiteCI
2024-02-18 08:59:49 +00:00

44 lines
1 KiB
TOML

[package]
name = "tvix-glue"
version = "0.1.0"
edition = "2021"
[dependencies]
async-recursion = "1.0.5"
bstr = "1.6.0"
bytes = "1.4.0"
data-encoding = "2.3.3"
futures = "0.3.30"
nix-compat = { path = "../nix-compat" }
tvix-build = { path = "../build", default-features = false, features = []}
tvix-eval = { path = "../eval" }
tvix-castore = { path = "../castore" }
tvix-store = { path = "../store", default-features = false, features = []}
tracing = "0.1.37"
tokio = "1.28.0"
thiserror = "1.0.38"
serde = "1.0.195"
serde_json = "1.0"
sha2 = "0.10.8"
[dependencies.wu-manber]
git = "https://github.com/tvlfyi/wu-manber.git"
[dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }
hex-literal = "0.4.1"
lazy_static = "1.4.0"
pretty_assertions = "1.4.0"
rstest = "0.18.2"
tempfile = "3.8.1"
test-case = "3.3.1"
[features]
default = ["nix_tests"]
# Enables running the Nix language test suite from the original C++
# Nix implementation (at version 2.3) against Tvix.
nix_tests = []
[[bench]]
name = "eval"
harness = false