about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorFilesLines
2022-09-01 r/4568 fix(tvix/eval): fix several string escapingsVincent Ambo1-2/+4
These were missing an additional level of escaping, silly oversight caught by an upstream test. Change-Id: I0312084475e4b88c83945614e9aa5b34c6bc3ec2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6232 Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2022-09-01 r/4567 refactor(tvix/eval): Upgrade to latest rnix-parserVincent Ambo6-490/+382
Since the latest published version of rnix-parser on crates.io, the crate has undergone major changes which are only available in the git repository at the moment. This commit updates the compiler to this newer version of rnix. Most notably, the entire AST provided by rnix is now wrapped in the AST type system. As a result of this traversal is much nicer in many places, especially for things like nested attribute selection. There are a handful of smaller features missing for full feature parity with the previous version, especially handling of path literals, but PRs for these already exist in rnix-parser. Change-Id: Icde6d393067976549492b7d89c4cc49e5e575fc7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6231 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
2022-09-01 r/4566 feat(tvix/eval): implement `assert` operatorVincent Ambo4-0/+27
This implements `assert`, which evaluates an expression and aborts evaluation if the value is not `true`. At this point we should introduce eval-failed-* tests; probably asserting against some representation of the error enum? Change-Id: If54c8f616d89b829c1860a4835dde60a2cd70d7a Reviewed-on: https://cl.tvl.fyi/c/depot/+/6230 Reviewed-by: grfn <grfn@gws.fyi> Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
2022-09-01 r/4565 feat(buildkite/mkPipeline): allow fast failure for build stepsEvgeny Zemtsov1-3/+10
This is supposed to help with resource wasting in situations when multiple dynamic steps depend on a failing derivation. Cost of failure currently is `C = T * D` where: - T -> time to compile the failing derivation - D -> amount of CI targets depending on a failing derivation Switching to `Fail Fast` limits it to just T (time of a single failure). Which helps a lot, especially while upgrading nixpkgs. Fast fail at this moment is in preview, so to enable it: - Enable `Fail Fast` feature at pipeline or organization level - Set `cancelOnBuildFailing` parameter to true for `mkPipeline` Change-Id: I4373a46633522d21e94cfa8bac35243b4eeb0b9c Reviewed-on: https://cl.tvl.fyi/c/depot/+/6243 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2022-09-01 r/4564 docs(users/Profpatsch/netencode): add docstrings to Netencode.hsProfpatsch1-3/+46
Change-Id: I509ea7949990e8c652133bd9ef21243a41f58e44 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6202 Reviewed-by: Profpatsch <mail@profpatsch.de> Autosubmit: Profpatsch <mail@profpatsch.de> Tested-by: BuildkiteCI
2022-09-01 r/4563 refactor(tvix/eval): use pretty_assertions for testsVincent Ambo3-4/+50
This makes for much more readable output especially when long strings are involved. Change-Id: I43dd73a0480535d7181a760788c42883a9b083f8 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6229 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-01 r/4562 refactor(tvix/eval): improve naming for locals manipulator methodsVincent Ambo1-5/+9
`push_local`/`push_phantom` were worse names because they sound like the value itself is being pushed, where in actuality it is just being declared to the compiler. Change-Id: Ibfda5c4c8e47d5d3262bfe005b0f1f84908a117e Reviewed-on: https://cl.tvl.fyi/c/depot/+/6228 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-08-31 r/4561 feat(tvix/eval): implement scope poisoning for true/false/nullVincent Ambo5-5/+60
These tokens are optionally parsed as identifiers by Nix, which means that within any scopes that resolve them the compiler needs to track whether they have been overridden to know whether to emit the literal instructions or resolve a variable. This is implemented by a new concept of "scope poisoning", where the compiler's scope structure tracks whether or not any builtin identifiers have been overridden. Change-Id: I3ab711146e229f843f6e1f0343385382ee0aecb6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6227 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: grfn <grfn@gws.fyi>
2022-08-31 r/4560 refactor(tvix/eval): simplify `let ... in ...` before recursionVincent Ambo3-30/+14
While full recursion through thunking is not available, there are actually incorrect behaviours introduced by declaring before binding (example in the newly introduced test). This commit simplifies the implementation to avoid this issue, and also because I intend to explore a bit more how far we can get in non left-to-right bindings *without* introducing thunks immediately. Change-Id: I21fd3007ac3946570639772d7d624d70bd209958 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6226 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: grfn <grfn@gws.fyi>
2022-08-31 r/4559 test(tvix/eval): add basic tests for with expressionsVincent Ambo4-0/+11
Change-Id: I94664090e7a2b060dfbe21c1eeb859fb31e417b0 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6225 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: grfn <grfn@gws.fyi>
2022-08-31 r/4558 chore(tvix/eval): return parse errors out of eval::interpretVincent Ambo2-2/+10
Change-Id: I14f25b9c85260c68be38abf07ed80121ead60c7b Reviewed-on: https://cl.tvl.fyi/c/depot/+/6224 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: grfn <grfn@gws.fyi>
2022-08-31 r/4557 feat(tvix/eval): emit instructions for dynamic var resolutionVincent Ambo1-1/+11
If an unknown variable is encountered and the with stack is not empty, emit instructions for resolving the variable at runtime. Change-Id: I752f4bd0025335744e4747364abd1bd34130374e Reviewed-on: https://cl.tvl.fyi/c/depot/+/6223 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: grfn <grfn@gws.fyi>
2022-08-31 r/4556 feat(tvix/eval): Implement OpResolveWith instructionVincent Ambo3-1/+24
Change-Id: I4d2a69f28a6b6199b3ff48ef81135e7da9fe1c3b Reviewed-on: https://cl.tvl.fyi/c/depot/+/6222 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: grfn <grfn@gws.fyi>
2022-08-31 r/4555 feat(tvix/eval): add Value::as_attrs methodVincent Ambo1-0/+10
Change-Id: I2f39122ac85b67837335aab308d845907160e132 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6221 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: grfn <grfn@gws.fyi>
2022-08-31 r/4554 feat(tvix/eval): emit instructions to close `with` at scope endVincent Ambo1-0/+7
Change-Id: I340b7a0964a4d4c5be58f46d00d2376ec5682517 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6220 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: grfn <grfn@gws.fyi>
2022-08-31 r/4553 feat(tvix/eval): implement OpPopWithVincent Ambo2-0/+4
Change-Id: I752d9428a73f893741746e9d5b79e8d8d570bb81 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6219 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: grfn <grfn@gws.fyi>
2022-08-31 r/4552 feat(tvix/eval): implement with_stack in VMVincent Ambo1-1/+6
Change-Id: I805c24c9a751ded15725ba9be651aa0869e013e5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6218 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: grfn <grfn@gws.fyi>
2022-08-31 r/4551 feat(tvix/eval): compile `with` expressionVincent Ambo3-11/+65
Adds an additional structure to the compiler's scope to track the runtime "with stack", i.e. the stack of values through which identifiers should be dynamically resolved within a with-scope. When encountering a `with` expression, the value from which the bindings should be resolved is pushed onto the stack and tracked by the compiler in the "with stack", as well as with a "phantom value" which indicates that the stack contains an additional slot which is not available to users via identifiers. Runtime handling of this is not yet implemented. Change-Id: I5e96fb55b6378e8e2a59c20c8518caa6df83da1c Reviewed-on: https://cl.tvl.fyi/c/depot/+/6217 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-08-31 r/4550 refactor(tvix/eval): rename `Locals` to `Scope`Vincent Ambo1-11/+11
This name is much more sensible actually; its more than just a collection of locals as it tracks additional scope information in the case of Nix. Change-Id: Ia2739bbd39aab222b1c4355e9248828973b0db43 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6216 Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2022-08-31 r/4549 feat(tvix/eval): implement inherit in let expressionsVincent Ambo3-14/+49
Note that at this point recursive bindings do not yet work in either attrsets or let, so inheriting from the same scope is generally not possible yet. Change-Id: I6ca820d04b8ded5c22fb7ea18e2ec203bcaa8e9c Reviewed-on: https://cl.tvl.fyi/c/depot/+/6215 Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2022-08-31 r/4548 feat(tvix/eval): implement `inherit` in attribute set literalsVincent Ambo5-12/+39
Straightforward implementation, evaluating the elements of an inherit and preparing the stack so that `OpAttrs` sees all relevant values when constructing the attribute set itself. The emitted instructions for inheriting a lot of values from the same attribute set are inefficient, but it's too early to say whether this actually matters. Change-Id: Icb55a20936d4ef77173f34433811c5fa5d2c9ecc Reviewed-on: https://cl.tvl.fyi/c/depot/+/6214 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2022-08-31 r/4547 fix(tvix/eval): gently attempt to create state dirVincent Ambo1-1/+3
If the directory in which REPL history is stored does not exist, gently try to create it, but do not raise an error if it doesn't work. We may want to warn about it, but in general this sort of non-essential feature should not cause a hard failure. Change-Id: If4fe8db0c7893c39627efe72c9cd9ebf7ed63f04 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6213 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2022-08-30 r/4546 feat(nix/buildLisp): re-enable CCLsterni2-4/+3
The problem went away once again, let's see how long it'll last this time. As it turns out, CCL has a Unicode Standard conforming string implementation that doesn't allow the use of (lone) surrogate code points, requiring us to disable a test in cl-json which tested the behavior of en- and decoding of such a (technically illegal) string. Change-Id: I8bfa482934bbf94f86cecdde02d5c3d4e77950a5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6204 Tested-by: BuildkiteCI Autosubmit: sterni <sternenseemann@systemli.org> Reviewed-by: tazjin <tazjin@tvl.su>
2022-08-30 r/4545 feat(tvix/eval): Implement inherit from outer scope in attrsVincent Ambo3-0/+31
Change-Id: I97fa45059b7f2cbe96eb60bd1821e3e25832df66 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6212 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2022-08-30 r/4544 fix(tvix/eval): `?` operator should use OpAttrsOrNotFoundVincent Ambo3-1/+5
Using `OpAttrSelect`, the ? operator will fail when encountering a nested value that is not an attribute set. This however breaks valid code, such as: { bs = 42; } ? bs.a.b The fix is simply to use the same operator used in the `or` statement, which leaves a sentinal on the stack if a field is not found or the value is not an attribute set. Change-Id: Ib28fc8a96e6d592b4cdbc3e65ba129ad8faecd66 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6211 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2022-08-30 r/4543 fix(tvix/eval): `or` should handle non-attrset values, tooVincent Ambo3-5/+12
If a nested attrpath encounters a non-set value, the sentinel value denoting a lack of next values should be emitted. This mirrors the behaviour of Nix. Change-Id: Ia80443d5a11243cc6d98dcab1249a3f5fdf77e27 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6210 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2022-08-30 r/4542 fix(tvix/eval): allow use of ? operator on non-set typesVincent Ambo4-4/+14
Nix allows this, but always returns false. Tvix needs to do the same. Change-Id: Ic9eec90834a0d0969eea5316d5c25032d3691d94 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6209 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2022-08-30 r/4541 fix(tvix/eval): emit correct count in OpAttrPathVincent Ambo4-2/+4
Not sure how exactly this snuck in, but it caused some subtle breakages in deeply nested attribute sets. Change-Id: I8049ce912405d3750031f79cc8d86ff1c3c02c2b Reviewed-on: https://cl.tvl.fyi/c/depot/+/6208 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2022-08-30 r/4540 docs(tvix/eval): Use correct syntax for module doc commentsVincent Ambo4-13/+12
Change-Id: I35741856f34b86a538f226a8eaf8806edede60ec Reviewed-on: https://cl.tvl.fyi/c/depot/+/6207 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2022-08-30 r/4539 chore(tvix/eval): minor readability improvement in attrsVincent Ambo1-12/+9
Change-Id: If9d9eaf60934e96ec4b41c57818afe0c2a99c862 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6206 Reviewed-by: grfn <grfn@gws.fyi> Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
2022-08-30 r/4538 refactor(tvix/eval): remove Error::InvalidKeyTypeVincent Ambo2-9/+1
We're confident that we're handling all branches that can reasonably occur from valid AST, any other cases should be considered a critical evaluator bug and panic rather than surfacing something that looks like user error. Change-Id: If96966eb32b8ff12fcaeb9ea3b0c8fc51b6abd11 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6205 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2022-08-30 r/4537 fix(tvix/eval): address various clippy lintsVincent Ambo6-41/+30
Change-Id: I3ea0f51475e80948adfeb5d1620c1f2665cc39bc Reviewed-on: https://cl.tvl.fyi/c/depot/+/6201 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-08-30 r/4536 feat(tvix/eval): implement attribute set equalityVincent Ambo1-2/+48
Change-Id: Ia25f02610f2575e5e7fca81643e05b40f4a07820 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6200 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
2022-08-30 r/4535 fix(tvix/eval): `null` in dynamic attribute keys skips the elementVincent Ambo1-0/+7
This is actually *tested* behaviour in C++ Nix, so we need to implement it here, too. Change-Id: Ic4a4659a2f04cdd928cbe78a85dae90401515371 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6199 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
2022-08-30 r/4534 feat(tvix/eval): implement chunk disassembler outputVincent Ambo3-2/+35
This makes for a much nicer view of an execution if `--feature disassembler` is set, for example: tvix-repl> let value = [ 1 2 { a = 1; } ]; in value ++ [ 1 ] === compiled bytecode (11 operations) === 02 OpConstant(1) 02 OpConstant(2) 02 OpConstant("a") 02 OpConstant(1) 02 OpAttrs(1) 02 OpList(3) 02 OpGetLocal(0) 02 OpConstant(1) 02 OpList(1) 02 OpConcat 02 OpCloseScope(1) === runtime trace === 0001 OpConstant(ConstantIdx(0)) [ 1 ] 0002 OpConstant(ConstantIdx(1)) [ 1 2 ] 0003 OpConstant(ConstantIdx(2)) [ 1 2 "a" ] 0004 OpConstant(ConstantIdx(3)) [ 1 2 "a" 1 ] 0005 OpAttrs(1) [ 1 2 { a = 1; } ] 0006 OpList(3) [ [ 1 2 { a = 1; } ] ] 0007 OpGetLocal(0) [ [ 1 2 { a = 1; } ] [ 1 2 { a = 1; } ] ] 0008 OpConstant(ConstantIdx(4)) [ [ 1 2 { a = 1; } ] [ 1 2 { a = 1; } ] 1 ] 0009 OpList(1) [ [ 1 2 { a = 1; } ] [ 1 2 { a = 1; } ] [ 1 ] ] 0010 OpConcat [ [ 1 2 { a = 1; } ] [ 1 2 { a = 1; } 1 ] ] 0011 OpCloseScope(1) [ [ 1 2 { a = 1; } 1 ] ] => [ 1 2 { a = 1; } 1 ] :: list Change-Id: If79c7fd1f0f18255ddb3763c1ba585fda8041b1b Reviewed-on: https://cl.tvl.fyi/c/depot/+/6195 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-08-30 r/4533 feat(tvix/eval): implement optional runtime tracingVincent Ambo5-1/+67
This adds a `disassembler` feature to the crate configuration that traces the operations executed and the state of the stack at runtime. This can be enabled by compiling with `--feature disassembler`. This will also gain a more sensible layout of code slices eventually. Change-Id: I34c15e1cd346ecc4362b5afba6bf82dd49359d20 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6193 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-08-30 r/4532 refactor(sterni/emacs): switch to pure gtk emacssterni1-4/+12
This means it'll no longer run under Xwayland. Requires applying small fix to bqn-mode which stopped compiling with emacs HEAD. Change-Id: I998a303a0b98bcd45c1de430462b1069bef8718e Reviewed-on: https://cl.tvl.fyi/c/depot/+/6203 Autosubmit: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-08-30 r/4531 chore(tvix/nix_cli): add default.nixFlorian Klink1-2/+8
This exposes tvix.nix_cli as a proper attribute to readTree, so it's actually built by CI. Change-Id: I3cef085bd872b61c5944270c8926727bf1fa705d Reviewed-on: https://cl.tvl.fyi/c/depot/+/6083 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2022-08-30 r/4530 chore(3p/sources): Bump channels & overlayssterni2-16/+17
* //users/Profpatsch/writers: adjust for API change in makePythonWriter: Since it has become cross-aware, we also need to provide the buildPackages python set we want to use. Change-Id: I4a201647281827ad983eb2dda6f6305f1ed824e7 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6196 Tested-by: BuildkiteCI Autosubmit: sterni <sternenseemann@systemli.org> Reviewed-by: Profpatsch <mail@profpatsch.de>
2022-08-29 r/4529 feat(tvix/eval): emit warnings on useless inheritVincent Ambo2-1/+9
Change-Id: Ifb9993cf8b85393eb43e1b204c7ab2f889b7113b Reviewed-on: https://cl.tvl.fyi/c/depot/+/6194 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-08-29 r/4528 fix(tvix/eval): skip inherit with no explicit parent in letVincent Ambo1-2/+7
Using `inherit` in a let-binding can not possibly have an effect, as the given identifier is already bound exactly the same way in the current scope. This introduces a subtle bug that is fixed later on, as there actually *is* a (single) condition where these inherits are meaningful. Change-Id: I8b24f0edcfe80db8153bb7e86cf478d36957d6f8 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6192 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-29 r/4527 test(tvix/eval): add basic tests for let expressionsVincent Ambo6-0/+17
Change-Id: I788504f0c1848a1422c99006bf659738df614716 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6191 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-29 r/4526 fix(wpcarro/emacs): Support rust.el PATH depsWilliam Carroll1-0/+3
There might be a better way to do this using `direnv`'s `use_nix` and shlevy's `nix-buffer` Elisp package, but I'm doing this for now. Change-Id: I4246c519f39eea1bde3191762b184b37d30fbeed Reviewed-on: https://cl.tvl.fyi/c/depot/+/6049 Tested-by: BuildkiteCI Reviewed-by: wpcarro <wpcarro@gmail.com> Autosubmit: wpcarro <wpcarro@gmail.com>
2022-08-29 r/4525 feat(wpcarro/rust): Define stdin exampleWilliam Carroll2-6/+24
Pipe Rust strings to shell commands. Change-Id: Id8afeed642d30c79e193fa9b353de081a5843eb5 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6197 Reviewed-by: wpcarro <wpcarro@gmail.com> Autosubmit: wpcarro <wpcarro@gmail.com> Tested-by: BuildkiteCI
2022-08-28 r/4524 feat(tvix/eval): add local identifier accessVincent Ambo4-1/+31
This makes basic `let ... in ...` statements work correctly. It does not yet account for the call frames pushed into the VM during function application. Change-Id: I67155171daf1a43011b96716dd9d1ab04b27db33 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6190 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-28 r/4523 feat(tvix/eval): detect dynamic identifier names in `let`Vincent Ambo2-4/+48
Nix does not allow dynamic identifiers in let expressions (only in attribute sets), but there are several different kinds of things it considers static identifiers. The functions introduced here put the path components of a let expression into normalised (string) form, and surface an error about dynamic keys if one is encountered. Change-Id: Ia3ebd95c6f3ed3cd33b94e156930d2e9c39b6cbf Reviewed-on: https://cl.tvl.fyi/c/depot/+/6189 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-28 r/4522 feat(tvix/eval): compile simple `let ... in ...` expressionsVincent Ambo3-0/+98
These expressions now leave the binding values on the stack, and clean up the scope after the body of the expression. While variable access is not yet implemented (as the identifier node remains unhandled), this already gives us the correct stack behaviour. Change-Id: I138c20ace9c64502c94b2c0f99a6077cd912c00d Reviewed-on: https://cl.tvl.fyi/c/depot/+/6188 Tested-by: BuildkiteCI Reviewed-by: grfn <grfn@gws.fyi>
2022-08-28 r/4521 feat(tvix/eval): prepare structures for simulating locals stackVincent Ambo1-0/+24
These are going to be used during compilation of `let`-expressions to determine stack offsets for local variables. Change-Id: Ibb79f3f1ae86650303f88eacf623ae456458de87 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6187 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2022-08-28 r/4520 fix(tvix/eval): use path_clean instead of fs::canonicalize for pathsVincent Ambo3-10/+14
Canonicalisation performs much more functionality than what C++ Nix implements for paths, and causes some undesirable behaviour (e.g. handling non-existant files becomes difficult, but should be possible in literals). Instead, the path_clean crate provides a pure normalisation method. There is an intention to add this to Rust itself: https://github.com/rust-lang/rfcs/issues/2208 Change-Id: I775d238136db0a52cf6b12a68985833c8fb32882 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6186 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-08-28 r/4519 feat(tvix/eval): resolve relative path literalsVincent Ambo4-10/+37
Resolves relative paths (e.g. `./foo`) either relative to the location of the Nix file, or relative to the working directory if none is supplied. Change-Id: I70ec574657b221b458015117a004b6e4a9c25a30 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6185 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>