2023-11-03 12:34:37 +01:00
|
|
|
[package]
|
|
|
|
name = "tvix-glue"
|
|
|
|
version = "0.1.0"
|
|
|
|
edition = "2021"
|
|
|
|
|
|
|
|
[dependencies]
|
2024-04-30 11:17:20 +02:00
|
|
|
async-compression = { version = "0.4.9", features = ["tokio", "gzip", "bzip2", "xz"]}
|
feat(tvix/glue/derivationStrict): support __structuredAttrs
This adds support to handle the __structuredAttrs argument, which can be
passed to builtins.derivationStrict.
If __structuredAttrs is passed, and set to true, most of the arguments
passed to builtins.derivationStrict are not simply coerced to a string
and passed down to "environments", but instead kept in a more structured
fashion.
Inside ATerm, which is what's relevant as far as path calculation is
concerned, a virtual `__json` environment variable is present,
containing these structured values.
Inside Builds, these structured values are not made available as an
environment variable, but a JSON file (and source-able bash script).
This will need to be respected once we start emitting BuildRequests,
and for that we can probably just parse the `__json` key in
Derivation.environment again - or keep this additionally in
non-serialized form around during Evaluation.
No matter what, this is left for a followup CL.
The existing handle_derivation_parameters and populate_outputs helper
function were removed, as __structuredAttrs causes quite a change
in behaviour, and so handling both in the same place makes it more
readable.
There's some open questions w.r.t. string contexts for structured attrs
itself. A TODO is left for this, but at least path calculation for
individual structured attrs derivations are correct now.
Part of b/366.
Change-Id: Ic293822266ced6f8c4826d8ef0d2e098a4adccaa
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10604
Tested-by: BuildkiteCI
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
2024-01-11 14:44:31 +01:00
|
|
|
bstr = "1.6.0"
|
|
|
|
bytes = "1.4.0"
|
2023-12-30 03:01:59 +01:00
|
|
|
data-encoding = "2.3.3"
|
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-01-16 20:14:38 +01:00
|
|
|
futures = "0.3.30"
|
2024-02-23 20:42:52 +01:00
|
|
|
magic = "0.16.2"
|
2023-11-03 12:34:37 +01:00
|
|
|
nix-compat = { path = "../nix-compat" }
|
2024-02-23 20:42:52 +01:00
|
|
|
pin-project = "1.1"
|
2024-02-23 16:09:20 +01:00
|
|
|
reqwest = { version = "0.11.22", features = ["rustls-tls-native-roots"], default-features = false }
|
2023-12-09 11:53:17 +01:00
|
|
|
tvix-build = { path = "../build", default-features = false, features = []}
|
2023-11-03 12:34:37 +01:00
|
|
|
tvix-eval = { path = "../eval" }
|
|
|
|
tvix-castore = { path = "../castore" }
|
|
|
|
tvix-store = { path = "../store", default-features = false, features = []}
|
2024-06-12 23:17:18 +02:00
|
|
|
tvix-tracing = { path = "../tracing" }
|
2023-11-03 12:34:37 +01:00
|
|
|
tracing = "0.1.37"
|
2024-06-12 23:17:18 +02:00
|
|
|
tracing-indicatif = "0.3.6"
|
2023-11-03 12:34:37 +01:00
|
|
|
tokio = "1.28.0"
|
2024-02-23 20:42:52 +01:00
|
|
|
tokio-tar = "0.3.1"
|
2024-02-23 16:09:20 +01:00
|
|
|
tokio-util = { version = "0.7.9", features = ["io", "io-util", "compat"] }
|
2023-11-03 12:34:37 +01:00
|
|
|
thiserror = "1.0.38"
|
feat(tvix/glue/derivationStrict): support __structuredAttrs
This adds support to handle the __structuredAttrs argument, which can be
passed to builtins.derivationStrict.
If __structuredAttrs is passed, and set to true, most of the arguments
passed to builtins.derivationStrict are not simply coerced to a string
and passed down to "environments", but instead kept in a more structured
fashion.
Inside ATerm, which is what's relevant as far as path calculation is
concerned, a virtual `__json` environment variable is present,
containing these structured values.
Inside Builds, these structured values are not made available as an
environment variable, but a JSON file (and source-able bash script).
This will need to be respected once we start emitting BuildRequests,
and for that we can probably just parse the `__json` key in
Derivation.environment again - or keep this additionally in
non-serialized form around during Evaluation.
No matter what, this is left for a followup CL.
The existing handle_derivation_parameters and populate_outputs helper
function were removed, as __structuredAttrs causes quite a change
in behaviour, and so handling both in the same place makes it more
readable.
There's some open questions w.r.t. string contexts for structured attrs
itself. A TODO is left for this, but at least path calculation for
individual structured attrs derivations are correct now.
Part of b/366.
Change-Id: Ic293822266ced6f8c4826d8ef0d2e098a4adccaa
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10604
Tested-by: BuildkiteCI
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
2024-01-11 14:44:31 +01:00
|
|
|
serde = "1.0.195"
|
|
|
|
serde_json = "1.0"
|
2024-01-02 13:17:02 +01:00
|
|
|
sha2 = "0.10.8"
|
refactor(tvix/glue): move Fetch[er] into its own types, fetch lazily
We actually want to delay fetching until we actually need the file. A
simple evaluation asking for `.outPath` or `.drvPath` should work even
in a pure offline environment.
Before this CL, the fetching logic was quite distributed between
tvix_store_io, and builtins/fetchers.rs.
Rather than having various functions and conversions between structs,
describe a Fetch as an enum type, with the fields describing the fetch.
Define a store_path() function on top of `Fetch` which can be used to
ask for the calculated store path (if the digest has been provided
upfront).
Have a `Fetcher` struct, and give it a `fetch_and_persist` function,
taking a `Fetch` as well as a desired name, and have it deal with all
the logic of persisting the PathInfos. It also returns a StorePathRef,
similar to the `.store_path()` method on a `Fetch` struct.
In a followup CL, we can extend KnownPaths to track fetches AND
derivations, and then use `Fetcher` when we need to do IO into that
store path.
Change-Id: Ib39a96baeb661750a8706b461f8ba4abb342e777
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11500
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Autosubmit: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
2024-04-22 13:02:48 +02:00
|
|
|
sha1 = "0.10.6"
|
|
|
|
md-5 = "0.10.6"
|
2024-04-22 19:05:49 +02:00
|
|
|
url = "2.4.0"
|
2024-01-17 07:45:55 +01:00
|
|
|
walkdir = "2.4.0"
|
2023-11-03 12:34:37 +01:00
|
|
|
|
|
|
|
[dependencies.wu-manber]
|
|
|
|
git = "https://github.com/tvlfyi/wu-manber.git"
|
|
|
|
|
2024-02-13 19:23:39 +01:00
|
|
|
[target.'cfg(not(target_env = "msvc"))'.dependencies]
|
|
|
|
tikv-jemallocator = "0.5"
|
|
|
|
|
2023-11-03 12:34:37 +01:00
|
|
|
[dev-dependencies]
|
2023-12-09 17:45:39 +01:00
|
|
|
criterion = { version = "0.5", features = ["html_reports"] }
|
2024-02-17 07:10:13 +01:00
|
|
|
hex-literal = "0.4.1"
|
2023-12-09 11:53:17 +01:00
|
|
|
lazy_static = "1.4.0"
|
2024-01-17 07:45:55 +01:00
|
|
|
nix = { version = "0.27.1", features = [ "fs" ] }
|
2024-01-14 01:41:16 +01:00
|
|
|
pretty_assertions = "1.4.0"
|
2024-04-10 13:37:45 +02:00
|
|
|
rstest = "0.19.0"
|
2023-12-13 10:34:17 +01:00
|
|
|
tempfile = "3.8.1"
|
2023-12-09 17:45:39 +01:00
|
|
|
|
2024-01-14 01:41:16 +01:00
|
|
|
[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 = []
|
|
|
|
|
2023-12-09 17:45:39 +01:00
|
|
|
[[bench]]
|
|
|
|
name = "eval"
|
|
|
|
harness = false
|