about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorFilesLines
2024-07-21 r/8394 refactor(tvix/nix-compat): rename PubKey to VerifyingKeyFlorian Klink4-25/+25
Align these with the way it's called in the ed25519 crates. Change-Id: Ia52d3bb9bf831dc6b5f7d5356f5ac62135672883 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12013 Tested-by: BuildkiteCI Reviewed-by: raitobezarius <tvl@lahfa.xyz> Autosubmit: flokli <flokli@flokli.de>
2024-07-21 r/8393 docs(tvix): document the builder APIFlorian Klink2-0/+62
This documents some thoughts and goals of the Tvix Build protocol, and how it is possible to express Nix builds with it. Additionally, it explains a proposed design for reference scanning. Change-Id: I4b1f3feb2278e3c7ce06de831eb8eb1715cba1c9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12012 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: yuka <yuka@yuka.dev> Tested-by: BuildkiteCI
2024-07-21 r/8392 test(tvix/composition): add recursion and concurrent testsYureka1-0/+63
Change-Id: Ic10773b08d940b45c3067bd514c3080cadac9606 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12003 Autosubmit: yuka <yuka@yuka.dev> Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-07-21 r/8391 docs(tvix/composition): add comment about stackYureka1-0/+3
Change-Id: I3888b5034c53728e2f9cfe24213f8854eb38bfe1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12005 Autosubmit: yuka <yuka@yuka.dev> Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-07-21 r/8390 feat(tvix/composition): downcast boxed error if possibleYureka1-4/+7
We still have the unique store name to identify which instantiation caused the error. For recursion errors, the full chain is still retained inside the CompositionError. Change-Id: Iaddcece445a5df331e578d7c69d710db3d5f8dcd Reviewed-on: https://cl.tvl.fyi/c/depot/+/12002 Tested-by: BuildkiteCI Autosubmit: yuka <yuka@yuka.dev> Reviewed-by: flokli <flokli@flokli.de>
2024-07-21 r/8389 feat(ops/users): add sinavir to userssinavir1-0/+5
Change-Id: I54c47f8119d38f7403e27cbc23efd919dcf8e8d5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/12006 Reviewed-by: yuka <yuka@yuka.dev> Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-07-21 r/8388 fix(tvix/composition): include typeid in recursion checkYureka1-5/+13
Change-Id: Icc279d41a4980d4b57acbb4243bbd509039b753f Reviewed-on: https://cl.tvl.fyi/c/depot/+/12000 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-07-21 r/8387 fix(tvix/nar-bridge): remove leftover debug statementFlorian Klink1-3/+1
Change-Id: Ie6fb822e1a4b76f2f6aef15bbe846e0a89c644fb Reviewed-on: https://cl.tvl.fyi/c/depot/+/11999 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: yuka <yuka@yuka.dev>
2024-07-21 r/8386 feat(tvix/nar-bridge): change default portFlorian Klink1-1/+1
Having `tvix-store daemon` and `nar-bridge` listen on the same port by default is silly. Use the same port that nar-bridge-go was using previously. Change-Id: Id374a12e52ba9dac4318e43d0ca0853866eadabc Reviewed-on: https://cl.tvl.fyi/c/depot/+/11998 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: yuka <yuka@yuka.dev> Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
2024-07-21 r/8385 chore(tvix): upgrade to tonic 0.12 / hyper 1.0Yureka15-739/+1828
Change-Id: Idd8ce48869ddd869d51a10959b920f1290a8a9b3 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11991 Autosubmit: yuka <yuka@yuka.dev> Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-07-21 r/8384 feat(tvix/tracing): http propagation for axumSimon Hauser8-11/+207
It introduces a new accept_trace function for axum0.7 which can be used to accept a header trace from a received request. This function can be used for tonic 0.12 once that version is released, and the specific `accept_trace` function within `tvix_tracing::propagate::tonic` can then be removed. This also integrates http propagation into the nar_bridge crate. Change-Id: I46dcc797d494bb3977c2633753e7060d88d29129 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11925 Reviewed-by: Brian Olsen <me@griff.name> Tested-by: BuildkiteCI Reviewed-by: Simon Hauser <simon.hauser@helsinki-systems.de> Reviewed-by: flokli <flokli@flokli.de>
2024-07-21 r/8383 refactor(tvix/boot/tests): use nar-bridge-rsFlorian Klink1-4/+3
This switches the boot tests from the golang implementation to the rust one. Change-Id: Ide2a47aebe40c172077147c05bb6dacd74ba6b1e Reviewed-on: https://cl.tvl.fyi/c/depot/+/11997 Tested-by: BuildkiteCI Reviewed-by: Brian Olsen <me@griff.name>
2024-07-21 r/8382 fix(tvix/nar-bridge): fix root node decoding and validationFlorian Klink1-2/+7
This got broken while moving things around. We need to parse the b64-decoded bytes. Since we're now validating the root node, we also need to rename the root node to get past the node name validation. There probably should be some tests for this. Co-Authored-By: sinavir@sinavir.fr Change-Id: I8f24a4a0ac107b1ea5b94c0e0ed872a34eb7b587 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11996 Reviewed-by: Brian Olsen <me@griff.name> Tested-by: BuildkiteCI
2024-07-20 r/8381 fix(tvix): fix outputHashes calculation for crates with versionsFlorian Klink1-2/+2
In case two crate versions are present, the key in the Cargo.nix file includes the version number too. To be able to set a specific hash for "tracing-opentelemetry 0.25.0" for example, this needs to account for keys with the version included. Access `crateName`, `version` and `src.outputHash` individually. Change-Id: Ib9800691a445ac403ff646cb32e85a7a4cbef9d8 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11994 Tested-by: BuildkiteCI Reviewed-by: yuka <yuka@yuka.dev>
2024-07-20 r/8380 refactor(tvix/store): use composition in tvix_store crateYureka20-254/+572
Change-Id: Ie6290b296baba2b987f1a61c9bb4c78549ac11f1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11983 Reviewed-by: flokli <flokli@flokli.de> Autosubmit: yuka <yuka@yuka.dev> Tested-by: BuildkiteCI
2024-07-20 r/8379 feat(tvix/nar-bridge): implement PUT $outhash.narinfoFlorian Klink2-3/+79
This adds support to upload NARInfo files. We lookup the root node from the LRU cache, rename it appropriately and then put it into the PathInfoService. Change-Id: I5479032b51cd855363bc016dee63cf84b3304a36 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11988 Tested-by: BuildkiteCI Reviewed-by: Brian Olsen <me@griff.name>
2024-07-20 r/8378 feat(tvix/nar-bridge): add 404 handler for GET/HEAD `/nar/…`Florian Klink1-0/+9
We currently send 405, and that confuses `nix copy`. Send a 404 for now, and add a futurework, as we can actually at least do something more meaningful in case we still have that nar hash in our LRU, which would avoid some unnecessary uploads in some cases. Change-Id: If625e9bd0fd6506cb73b88962d889aa08315fcea Reviewed-on: https://cl.tvl.fyi/c/depot/+/11987 Tested-by: BuildkiteCI Reviewed-by: Brian Olsen <me@griff.name>
2024-07-20 r/8377 feat(tvix/nar-bridge): support uploading NAR filesFlorian Klink5-13/+158
This ingests NAR files into the {Blob,Directory}Service, which are already part of the AppState. As we then need to correlate the root node to the uploaded PathInfo, we need to keep a (short-lived) lookup table from NARHash to root node around. We insert it into a `LruCache` after the NAR is uploaded, and use `peek()` to do the lookup, which doesn't update the LRU list. Change-Id: I48a4c6246bacf76559c5a4ccad2a0bc25c1b7900 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11986 Tested-by: BuildkiteCI Reviewed-by: Brian Olsen <me@griff.name>
2024-07-20 r/8376 feat(tvix/nar-bridge): initFlorian Klink9-87/+1460
This adds an implementation of nar-bridge in Rust. Currently, only the GET parts are implemented. Contrary to the Go variant, this doesn't try to keep a mapping from nar hashes to root node in memory, it simply encodes the root node itself (stripped by its basename) into the URL. This pulls in a more recent version of axum than what we use in tonic, causing two versions of http and hyper, however dealing with `Body::from_stream` in axum 0.6 is much more annoying, and https://github.com/hyperium/tonic/pull/1740 suggests this will be fixed soon. Change-Id: Ia4c2dbda7cd3fdbe47a75f3e33544d19eac6e44e Reviewed-on: https://cl.tvl.fyi/c/depot/+/11898 Autosubmit: flokli <flokli@flokli.de> Reviewed-by: Brian Olsen <me@griff.name> Tested-by: BuildkiteCI
2024-07-20 r/8375 feat(tvix/castore/protos): return root node after validationFlorian Klink1-2/+4
This allows avoiding a `.node.unwrap()`` after validation. Change-Id: Ieef1ffebab16cdca94c979ca6831a7ab4f6007da Reviewed-on: https://cl.tvl.fyi/c/depot/+/11989 Reviewed-by: Brian Olsen <me@griff.name> Tested-by: BuildkiteCI
2024-07-20 r/8374 fix(tvix/store): add missing nar_info::ca::Hash::TextSha256Florian Klink1-21/+26
Also reorder to how it's ordered in the .proto file. Change-Id: I87c422feac4d12f6a84f99aa889f9c524a9878b9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11985 Tested-by: BuildkiteCI Reviewed-by: Brian Olsen <me@griff.name>
2024-07-20 r/8373 docs: More documentation of nix daemon protocolBrian Olsen6-154/+303
Uses `Set` to mark that the given list is actually a set. The format on stream is no different from `List` but is nice to know. Best effort document string formats. Documents default values for fields not used in old protocol versions. Document handshake, AddMultipleToStore format, Export format and Import paths format. Change-Id: I6cbe4c7de3770cc5caafc26229f99a07353ee3e2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11984 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Autosubmit: Brian Olsen <me@griff.name>
2024-07-19 r/8372 feat(tvix): different service types in one compositionYureka11-46/+64
This will be necessary for the PathInfoService composition, as some PathInfoService implementations require a BlobService & DirectoryService to ingest into. Using the Extend trait for creating compositions allows extending the same composition with configs of various types e.g. BlobStore, DirectoryStore Generics are moved from the Composition struct to the functions.The storage of the InstantiatonStates uses the TypeId in the key and a Box<dyn Any> in the value, which is downcasted to InstantiatonState<T>. Change-Id: I2af11f26c535029adfb1c62905e0e7c4aaed7b51 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11980 Reviewed-by: flokli <flokli@flokli.de> Reviewed-by: raitobezarius <tvl@lahfa.xyz> Tested-by: BuildkiteCI Autosubmit: yuka <yuka@yuka.dev>
2024-07-19 r/8371 test(tvix/castore/ObjectStoreBlobService): test correct chunkingYureka1-6/+23
Change-Id: I4a8f5cda2705560a6d52a2eb2be0dde35b784c8f Reviewed-on: https://cl.tvl.fyi/c/depot/+/11982 Tested-by: BuildkiteCI Autosubmit: yuka <yuka@yuka.dev> Reviewed-by: flokli <flokli@flokli.de>
2024-07-19 r/8370 fix(tvix/castore/blob/object_store): empty chunk list for single chunkYureka1-0/+9
Change-Id: Ie3609ac6184ecead11c4e03073433c26ce129848 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11981 Autosubmit: yuka <yuka@yuka.dev> Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-07-18 r/8369 fix(tvix/nix-compat): use `buf.filled()` to track read bytesRyan Lahfa1-1/+1
We were wrongly using `buf.initialized()` which contains more than the filled portion to compute the number of bytes read during a poll call. This made us go into the trailer reading state too early and finally failing due to invalid trailer data. Fixes b/405. Co-authored-by: Florian Klink <flokli@flokli.de> Change-Id: I66ba6e2116389e6b97305f85c4e0922195000e45 Signed-off-by: Ryan Lahfa <tvl@lahfa.xyz> Reviewed-on: https://cl.tvl.fyi/c/depot/+/11978 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de> Reviewed-by: edef <edef@edef.eu>
2024-07-18 r/8368 refactor(tvix): use composition & registry for from_addrYureka18-229/+316
Change-Id: I3c94ecb5958294b5973c6fcdf5ee9c0d37fa54ad Reviewed-on: https://cl.tvl.fyi/c/depot/+/11976 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Autosubmit: yuka <yuka@yuka.dev>
2024-07-18 r/8367 feat(tvix/castore): add sled to composition registryYureka2-1/+51
Change-Id: I03fa8dfabcee14c5f657380f86bb1a7aa00e08ef Reviewed-on: https://cl.tvl.fyi/c/depot/+/11977 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2024-07-18 r/8366 feat(tvix/composition): allow creating a blank CompositionContextYureka1-6/+13
this is useful when oneshot-instantiating a store from a single config Change-Id: I08538fdee1d0bb26b3ae2da7d3b2339b2e93bc0a Reviewed-on: https://cl.tvl.fyi/c/depot/+/11975 Reviewed-by: flokli <flokli@flokli.de> Autosubmit: yuka <yuka@yuka.dev> Tested-by: BuildkiteCI
2024-07-18 r/8365 feat(tvix/castore): add composition moduleYureka16-51/+747
Change-Id: I0868f3278db85ae5fe030089ee9033837bc08748 Signed-off-by: Yureka <tvl@yuka.dev> Reviewed-on: https://cl.tvl.fyi/c/depot/+/11853 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-07-09 r/8364 chore(tvix/tools/weave): Regenerate Cargo.nix and filter srcIlan Joselevich3-42/+101
The Cargo.lock also got changed because of crate2nix using --freezed. Change-Id: I79b062eddb13f59c4656a62735df1e527fc91a44 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11970 Autosubmit: Ilan Joselevich <personal@ilanjoselevich.com> Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2024-07-09 r/8363 chore(tvix/tools/turbofetch): Regenerate Cargo.nix and filter srcIlan Joselevich3-37/+28
The Cargo.lock also got changed because of crate2nix using --freezed. Change-Id: I48cabe514e0cf1dd1f00870bcb7958a2a49663d5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11969 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Autosubmit: Ilan Joselevich <personal@ilanjoselevich.com>
2024-07-09 r/8362 chore(tvix/tools/crunch-v2): Regenerate Cargo.nix and filter srcIlan Joselevich3-68/+104
The Cargo.lock also got changed because of crate2nix using --freezed. Change-Id: I90245bad27f6fee01455557bbccc865301a4f1a0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11968 Autosubmit: Ilan Joselevich <personal@ilanjoselevich.com> Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2024-07-09 r/8361 chore(tvix/tools/narinfo2parquet): Regenerate Cargo.nix and filter srcIlan Joselevich3-38/+31
The Cargo.lock also got changed because of crate2nix using --freezed. Change-Id: Id5225e73ec5894bc324f363660472a7efdd803cf Reviewed-on: https://cl.tvl.fyi/c/depot/+/11967 Autosubmit: Ilan Joselevich <personal@ilanjoselevich.com> Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
2024-07-09 r/8360 fix(tvix/{store,castore,build}): Compile tonic w/o config in build.rsIlan Joselevich3-21/+9
Previously we had to make a mutable Config instance and set bytes and other values in it because they were not exposed to the builder pattern (https://github.com/hyperium/tonic/issues/908) but now they are, so we just set them through the builder. Change-Id: I8904c6b93f09173b56586024b1ced59d622bce66 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11966 Autosubmit: Ilan Joselevich <personal@ilanjoselevich.com> Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2024-07-08 r/8359 chore(3p/gerrit): downgrade mina SSHd againLuke Granger-Brown3-44/+2
This breaks it with "ssh_dispatch_run_fatal: Connection to 2a01:4f8:242:5b21:0:feed:edef:beef port 29418: incorrect signature" Change-Id: I9bafc5fb6d4743ce4f097158ec14fecc791366ca Reviewed-on: https://cl.tvl.fyi/c/depot/+/11965 Tested-by: BuildkiteCI Autosubmit: lukegb <lukegb@tvl.fyi> Reviewed-by: flokli <flokli@flokli.de> Reviewed-by: lukegb <lukegb@tvl.fyi>
2024-07-08 r/8358 chore(3p/gerrit): create buildBazelPackageNG and migrate gerrit to itLuke Granger-Brown27-263/+458
This bumps Gerrit to 3.10.0, and also introduces a new mechanism for building it that should hopefully have some more stable hashes than the previous bodgery. In this world, we only cache what we explicitly want to. There are some hooks implemented for `rules_java` and `rules_nodejs` (before version 6) that force use of local binaries; this means we can drop the use of the FHSUserEnv and use the java and nodejs binaries provided by nixpkgs instead. detzip is deleted; it hasn't been used in yonks. We also add https://gerrit-review.googlesource.com/c/gerrit/+/431977, which bumps the SSHd version so that we can have U2F-based SSH keys. Change-Id: Ie12a9a33bbb1e4bd96aa252580aca3b8bc4a1205 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11963 Reviewed-by: lukegb <lukegb@tvl.fyi> Autosubmit: lukegb <lukegb@tvl.fyi> Tested-by: BuildkiteCI
2024-07-07 r/8357 refactor(tvix): point SSL_CERT_FILE to /dev/nullFlorian Klink5-12/+12
reqwest wants to be able to read a file of trust roots when constructed, but as it doesn't actually do any HTTPS connections inside the nix build, an empty list of trust roots is totally sufficient. Thankfully /dev/null provides such a file. Change-Id: I9bd1619b2c9f8ff2a6640d2ac410d4de5b20c2ea Reviewed-on: https://cl.tvl.fyi/c/depot/+/11961 Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Reviewed-by: aspen <root@gws.fyi>
2024-07-07 r/8356 feat(tvix/eval): Bump imbl to 3.0.0Aspen Smith3-5/+6
Change-Id: I88053fa2df35dc486c51d015f4b2156541c07af3 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11962 Tested-by: BuildkiteCI Autosubmit: aspen <root@gws.fyi> Reviewed-by: flokli <flokli@flokli.de>
2024-07-07 r/8355 fix(tvix/repl): Share globals and sourcemap across evaluationsAspen Smith10-60/+221
Now that we can bind (potentially lazy, potentially lambda-containing) values in the REPL and then reference them in subsequent evaluations, it's important that the values to which we construct shared references are shared across those subsequent evaluations - otherwise, we get panics due to unknown source map locations, or dropped weak references to globals. This change assigns both the globals and the source map as fields on the Repl after the first evaluation, and then passes those in (to the EvaluationBuilder) on subsequent evaluations. On the EvaluationBuilder side, there's some panicking introduced - this is intentional, as my intent is for the builder to be configured statically enough that panicking is the best way to report errors here (it's always a bug to misconfigure an Evaluation, and we'd never want to handle it dynamically). Change-Id: I37225697235c22b683ca48a17d30fa8fedd12d1b Reviewed-on: https://cl.tvl.fyi/c/depot/+/11960 Reviewed-by: flokli <flokli@flokli.de> Autosubmit: aspen <root@gws.fyi> Tested-by: BuildkiteCI
2024-07-07 r/8354 test(tvix/cli): Add some additional REPL testsAspen Smith1-0/+42
A couple of already-passing tests covering REPL behavior Change-Id: Ie21f4abf68ab12827fd15128a8ef810cd8592d07 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11959 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Autosubmit: aspen <root@gws.fyi>
2024-07-07 r/8353 test(tvix/cli): Make the REPL testableAspen Smith9-346/+522
Juggle around the internals of the tvix-cli crate so that we expose the Repl as a public type with a `send` method, that sends a string to the repl and *captures all output* so that it can be subsequently asserted on in tests. Then, demonstrate that this works with a single (for now) REPL test using expect-test to assert on the output of a single command sent to the REPL. As the REPL gets more complicated, this will allow us to make tests that cover that complex behavior. Change-Id: I88175bd72d8760c79faade95ebb1d956f08a7b83 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11958 Autosubmit: aspen <root@gws.fyi> Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2024-07-06 r/8352 refactor(tvix/eval): Construct globals in EvaluationBuilder::buildAspen Smith2-58/+47
Construct the Rc<GlobalsMap> for the evaluation as part of EvaluiationBuilder::build, rather than deferring it until we actually compile. This changes nothing functionally, but gets us one step closer to sharing this globals map across evaluations. Change-Id: Id92e9fb88d974d763056d4f15ce61962ab776e84 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11957 Tested-by: BuildkiteCI Autosubmit: aspen <root@gws.fyi> Reviewed-by: flokli <flokli@flokli.de>
2024-07-06 r/8351 refactor(tvix/eval): Builderize EvaluationAspen Smith15-155/+326
Make constructing of a new Evaluation use the builder pattern rather than setting public mutable fields. This is currently a pure refactor (no functionality has changed) but has a few advantages: - We've encapsulated the internals of the fields in Evaluation, meaning we can change them without too much breakage of clients - We have type safety that prevents us from ever changing the fields of an Evaluation after it's built (which matters more in a world where we reuse Evaluations). More importantly, this paves the road for doing different things with the construction of an Evaluation - notably, sharing certain things like the GlobalsMap across subsequent evaluations in eg the REPL. Fixes: b/262 Change-Id: I4a27116faac14cdd144fc7c992d14ae095a1aca4 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11956 Tested-by: BuildkiteCI Autosubmit: aspen <root@gws.fyi> Reviewed-by: flokli <flokli@flokli.de>
2024-07-06 r/8350 chore(tvix/docs): Cross off a TODOAspen Smith1-6/+0
This is done now, as of fc6359463 (feat(tvix/repl): Allow binding variables at the top-level, 2024-07-04) Change-Id: I2126cbadeb66625cda93a7cd7ddb31409ec60fd9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11955 Reviewed-by: flokli <flokli@flokli.de> Autosubmit: aspen <root@gws.fyi> Tested-by: BuildkiteCI
2024-07-05 r/8349 refactor(web/tvixbolt): buildRustPackage -> crate2nixIlan Joselevich9-122/+4595
With the recent changes to crate2nix and buildRustCrate in nixpkgs it is now possible to build tvixbolt via crate2nix like we do for other tvix crates. We can reuse a lot of the customizations done in //tvix in tvixbolt to avoid repeating ourselves. A script for serving tvixbolt locally for testing purposes is also available now through the .serve attribute of tvixbolt. This change supersedes https://cl.tvl.fyi/c/depot/+/11821. Change-Id: I4864df8b75aec73cf5fee2428924ed4cfbb32902 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11952 Tested-by: BuildkiteCI Autosubmit: Ilan Joselevich <personal@ilanjoselevich.com> Reviewed-by: flokli <flokli@flokli.de>
2024-07-05 r/8348 feat(tvix/utils): Add defaultCrateOverridesForPkgs functionIlan Joselevich2-78/+78
This function can be reused across the rest of the repo to make use of our overriden defaultCrateOverrides with support for tvix crates. Change-Id: I8c554dece052bd9dd32acac13dab8114933272a7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11951 Autosubmit: Ilan Joselevich <personal@ilanjoselevich.com> Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2024-07-05 r/8347 fix(tvix/utils): Optionally add support for Cargo in filterRustCrateSrcIlan Joselevich2-5/+7
Previously we would unconditionally add Cargo.toml to the fileset. We mostly use buildRustCrate in tvix so it does not make sense to add it by default, instead I made it so you enable cargoSupport if you want Cargo.{toml,lock} to be added to the fileset. Change-Id: I5a6016534fc5599e85ab581fe3d9b81e7a24f940 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11950 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Autosubmit: Ilan Joselevich <personal@ilanjoselevich.com>
2024-07-05 r/8346 feat(tvix/repl): Allow binding variables at the top-levelAspen Smith6-16/+157
Allow binding variables at the REPL's toplevel in the same way the Nix REPL does, using the syntax <ident> = <expr>. This fully, strictly evaluates the value and sets it in the repl's "env", which gets passed in at the toplevel when evaluating expressions. The laziness behavior differs from Nix's, but I think this is good: ❯ nix repl Welcome to Nix version 2.3.18. Type :? for help. nix-repl> x = builtins.trace "x" 1 nix-repl> x trace: x 1 nix-repl> x 1 vs tvix: tvix-repl> x = builtins.trace "x" 1 trace: "x" :: string tvix-repl> x => 1 :: int tvix-repl> x => 1 :: int Bug: https://b.tvl.fyi/issues/371 Change-Id: Ieb2d626b7195fa87be638c9a4dae2eee45eb9ab1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11954 Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI Autosubmit: aspen <root@gws.fyi>
2024-07-05 r/8345 feat(tvix/eval): Allow passing in an env to evaluationAspen Smith7-15/+99
Allow passing in a top-level env, a map from name to value, to evaluation. The intent is to support bound identifiers in the REPL just like upstream nix does. Getting this working involves mucking around a bit with internals - most notably, locals now only optionally have a Span (since locals don't have an easy span we can use) - and getting that working requires propagating some minor hacks to places where we currently *need* a span (and which would require too much changing now to make spans optional; my guess is that that would essentially end up making spans optional throughout the codebase). Also, some extra care has to be taken to close out the scope in the case that we do pass in an env, to avoid breaking our assumptions about the size of the stack when we return from the toplevel Change-Id: Ie475b2d3dfc72ccbf298d2a3ea28c63ac877d653 Reviewed-on: https://cl.tvl.fyi/c/depot/+/11953 Tested-by: BuildkiteCI Autosubmit: aspen <root@gws.fyi> Reviewed-by: flokli <flokli@flokli.de>