about summary refs log tree commit diff
path: root/tvix/eval/src/warnings.rs (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2022-09-13 r/4837 feat(corp/tvixbolt): use fancy error formattingVincent Ambo1-5/+8
Change-Id: I633154f3a2ae2b1789992a1137c944e897c56b2c Reviewed-on: https://cl.tvl.fyi/c/depot/+/6535 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2022-09-13 r/4836 feat(tvix/eval): implement initial fancy formatting for errorsVincent Ambo3-27/+145
This very closely follows the way it's done for warnings, but errors have a lot more information available in some cases which we do not surface yet. Note also that due to requiring the `CodeMap`, this is not yet called from eval.rs as the way that is threaded through needs to be refactored, so only the method for reporting these errors as strings is implemented so far. Next steps for this will be to add a generic diagnostics module that reduces some of the boilerplate for this between warnings & errors, and which will also give us a good point in the future to switch to a fancier diagnostics crate. Change-Id: If6bb209f8e7a568d866e516a90335b9b2afbf66d Reviewed-on: https://cl.tvl.fyi/c/depot/+/6534 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2022-09-13 r/4835 feat(web/blog): add ability to specify post authorVincent Ambo3-0/+6
Anyone is free to pen a post for tvl.fyi if they want, so being able to attribute the author might be useful. This wasn't originally a feature because I wrote //web/blog only for tazj.in initially. Change-Id: Ibc50b53f92113a82a53ce40bb5defa18e926cc10 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6560 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: grfn <grfn@gws.fyi>
2022-09-13 r/4834 feat(corp/tvixbolt): add an ad in the footerVincent Ambo2-0/+25
As previously mentioned on IRC, this is why tvixbolt is under //corp. The majority of people in our community probably block ads anyways, but might as well ... The ad account is linked to the TVL legal entity. The ad is configured not to use any personalised data. In testing it's showing me lamps and shoes. This is the same kind of ad as on my grammar page, predlozhnik.ru Change-Id: I172881ed5d5ceb1fdeb2298b8f822d0c2a6518a8 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6558 Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2022-09-13 r/4833 docs(web/tvl): small updates & fixes to September '22 Tvix statusVincent Ambo1-4/+9
Change-Id: I2cf57abb0f8c21c3893e68ce2c6fb92a2c0d3ee6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6559 Reviewed-by: flokli <flokli@flokli.de> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2022-09-13 r/4832 docs(web/tvl): add draft for Tvix status update postVincent Ambo2-0/+158
This adds an initial version of the post which we can play with for further layouting. The post is marked as `draft`, so it will become available at the direct link, but have a banner on it telling people not to share it yet. Change-Id: Idac69e56bee027c2b566f50ef123b54aff6ebc3e Reviewed-on: https://cl.tvl.fyi/c/depot/+/6538 Tested-by: BuildkiteCI Reviewed-by: flokli <flokli@flokli.de>
2022-09-13 r/4831 feat(corp/tvixbolt): use fancy warning formattingVincent Ambo1-5/+3
Unfortunately the codemap-diagnostic crate doesn't provide a way to get colour control characters written to an arbitrary writer, so this is black & white only, but we can look at this later if we introduce something even fancier. For now it's reasonable. Change-Id: I1c7655cc4b254f77768b5931bc95fa13b3bd7e12 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6533 Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2022-09-13 r/4830 feat(tvix/eval): implement initial fancy display for warningsVincent Ambo3-9/+94
This implements an initial fancy display for warnings emitted by the tvix compiler, using the codemap_diagnostic crate. Each warning variant has an associated message, and optionally an associated annotation for the span displayed to the user. In theory we could get a lot more fancy with the display for specific variants if needed (e.g. re-parse the AST and actually add multiple semantic spans based on context), but this is already a good start. Example: tvix-repl> let toString = https://tvl.fyi; in let inherit toString; in ({}: 42) rec {} warning[W004]: declared variable 'toString' shadows a built-in global! --> [tvix-repl]:1:5 | 1 | let toString = https://tvl.fyi; in let inherit toString; in ({}: 42) rec {} | ^^^^^^^^ variable declared here warning[W001]: URL literal syntax is deprecated, use a quoted string instead --> [tvix-repl]:1:16 | 1 | let toString = https://tvl.fyi; in let inherit toString; in ({}: 42) rec {} | ^^^^^^^^^^^^^^^ warning[W002]: inherited variable already exists with the same value --> [tvix-repl]:1:40 | 1 | let toString = https://tvl.fyi; in let inherit toString; in ({}: 42) rec {} | ^^^^^^^^^^^^^^^^^ warning[W999]: feature not yet implemented in tvix: recursive attribute sets --> [tvix-repl]:1:70 | 1 | let toString = https://tvl.fyi; in let inherit toString; in ({}: 42) rec {} | ^^^^^^ warning[W999]: feature not yet implemented in tvix: closed formals --> [tvix-repl]:1:62 | 1 | let toString = https://tvl.fyi; in let inherit toString; in ({}: 42) rec {} | ^^ warning[W003]: variable 'toString' is declared, but never used: --> [tvix-repl]:1:5 | 1 | let toString = https://tvl.fyi; in let inherit toString; in ({}: 42) rec {} | ^^^^^^^^ variable declared here => 42 :: int These are coloured when output to a terminal. Change-Id: If315648a07e333895db4ae1d0915ee2013806585 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6532 Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI
2022-09-13 r/4829 feat(ops/modules): deploy tvixbolt to tvixbolt.tvl.suVincent Ambo3-0/+27
Change-Id: I534cf918fc3e03ce8c14cf15f6d3280b6a657c8d Reviewed-on: https://cl.tvl.fyi/c/depot/+/6536 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2022-09-13 r/4828 feat(ops/glesys): add CNAME for tvixbolt.tvl.suVincent Ambo1-0/+11
I could not get nginx to serve it from `tvl.su/tvixbolt`, and ran out of interest in trying to fix it, so lets put it on a subdomain instead. Change-Id: I1313d75cc9831d94a894191376534b1e5186a76a Reviewed-on: https://cl.tvl.fyi/c/depot/+/6537 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2022-09-13 r/4827 chore(tvix/eval): add dependency on codemap-diagnosticVincent Ambo3-0/+72
This is a crate for source-span based error reporting. Since all of our spans are already codemap spans, it is a good starting point. We have to figure out quite a bit of logic for neat error printing; later on if we want fancier presentation we might want to look at one of the other libraries in this space like miette. Change-Id: I4e28886af1ed199b7112d9dbf063c9f29b612bf1 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6531 Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org> Reviewed-by: grfn <grfn@gws.fyi>
2022-09-12 r/4826 feat(wpcarro/ssh): Support iPhone SSH keyWilliam Carroll3-12/+18
For termius access Change-Id: Ic91b80bfc8deb816b5a7634ca5e74bb026729067 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6542 Reviewed-by: wpcarro <wpcarro@gmail.com> Autosubmit: wpcarro <wpcarro@gmail.com> Tested-by: BuildkiteCI
2022-09-12 r/4825 feat(wpcarro/ava): Enable printingWilliam Carroll1-0/+5
Gotta print stuffs at the office (every decade or so) Change-Id: I3241b7a86eead50cadf785bb0204c803e40ac360 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6543 Reviewed-by: wpcarro <wpcarro@gmail.com> Autosubmit: wpcarro <wpcarro@gmail.com> Tested-by: BuildkiteCI
2022-09-11 r/4824 chore(tvix/eval): address current clippy lintsVincent Ambo1-2/+1
Change-Id: I76326c20a525044e89d3cd1392a29faa3414ca04 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6529 Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
2022-09-11 r/4823 refactor(tvix/eval): remove `todo!()` calls in compilerVincent Ambo4-5/+29
It is impossible for tvixbolt to recover from panics, so the user experience of typing an expression using an unsupported feature was that it would get sad and stop responding to input. Instead, raise a normal value-level error of a new variant and continue where possible. Change-Id: Ibe016c92cacb87b85095c0f83758eddc6468053e Reviewed-on: https://cl.tvl.fyi/c/depot/+/6528 Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-11 r/4822 fix(tazjin/emacs): globally unbind `C-x s`Vincent Ambo1-0/+4
This shortcut is so unbelievably annoying on some keyboards. Change-Id: I5c96d490fd42aa8422fa48be87079b60af81fcd3 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6527 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2022-09-11 r/4821 docs(tvix/eval): propose builtin "inlining" optimisationsterni1-0/+18
Change-Id: I96a187792a1fd48cffd6b56ec22347aee8cae3af Reviewed-on: https://cl.tvl.fyi/c/depot/+/6526 Autosubmit: sterni <sternenseemann@systemli.org> Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2022-09-11 r/4820 docs(tvix/eval): mention `?` and `or` for builtins optimisationsterni1-1/+3
Change-Id: Ifaa6da345d408a69ce46d6a0e7483352715c75bd Reviewed-on: https://cl.tvl.fyi/c/depot/+/6525 Autosubmit: sterni <sternenseemann@systemli.org> Reviewed-by: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2022-09-11 r/4819 docs(tvix/eval): remove the note on the private repoVincent Ambo1-8/+6
... because we are basically caught up now! Change-Id: Icdc06ff7ca5729c21301f009e94acfcd0f80879a Reviewed-on: https://cl.tvl.fyi/c/depot/+/6503 Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: flokli <flokli@flokli.de> Reviewed-by: grfn <grfn@gws.fyi> Reviewed-by: sterni <sternenseemann@systemli.org> Tested-by: BuildkiteCI
2022-09-11 r/4818 docs(tvix/eval): add some notes on cloning & building tvix-evalVincent Ambo1-0/+23
Change-Id: I8cc359952b41994c2ba8bcfb8b0b6fc629bb81ea Reviewed-on: https://cl.tvl.fyi/c/depot/+/6502 Reviewed-by: sterni <sternenseemann@systemli.org> Autosubmit: tazjin <tazjin@tvl.su> Tested-by: BuildkiteCI
2022-09-11 r/4817 chore(3p): gerrit: 3.4.0 -> 3.6.1Luke Granger-Brown12-282/+125
This change cannot be deployed OOTB: you must upgrade by 3.5.2+ first, and run copy-approvals. Change-Id: Ia2e49da4d801a21a3db59e2d5b054eeb46d7dc79 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6505 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2022-09-11 r/4816 chore(tvix/nix_cli): build with testsFlorian Klink3-2/+5
only run test_nix_store_add() when the feature integration_tests is enabled. Change-Id: I600f08ecaefe1ce77651ae07a58d7987107ab969 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6084 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
2022-09-11 r/4815 chore(corp/tvixbolt): check in generated Cargo.lock changeVincent Ambo1-0/+1
Change-Id: I9f87ced716a4328b24fd8fa2eec077ce8dc4a7db Reviewed-on: https://cl.tvl.fyi/c/depot/+/6504 Tested-by: BuildkiteCI Autosubmit: tazjin <tazjin@tvl.su> Reviewed-by: tazjin <tazjin@tvl.su>
2022-09-11 r/4814 fix(tvix/eval): pass correct slot when compiling attr valuesVincent Ambo1-1/+1
Change-Id: I90722d59dea4c7694eb5a7cf505db31196ba6c6c Reviewed-on: https://cl.tvl.fyi/c/depot/+/6501 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-11 r/4813 fix(tvix/eval): reduce scope depth in scope moduleVincent Ambo2-2/+2
Change-Id: If32f9e4c9212f20a39baa15d479ff1387c17570d Reviewed-on: https://cl.tvl.fyi/c/depot/+/6500 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-11 r/4812 feat(tvix/eval): add Chunk::pop_op methodVincent Ambo1-0/+22
This is used to drop an already emitted operation from a chunk again and clean up its span tracking. This is required in cases where the compiler has to backtrack. Change-Id: I8112da9427688bb2dec96a2ddd12390f6e9734c3 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6499 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-11 r/4811 refactor(tvix/eval): refactor methods for parsing static identsVincent Ambo1-22/+39
Refactors the methods used for determining whether an identifier in a binding (i.e. an `rnix::Attr` node) is a static string, and extracting it. Previously all uses of this logic were for `let`-expressions, where dynamic attributes are always an error. However, we need the same logic to properly implement the phase separation of attribute set compilation. To facilitate this, the actual core logic of these methods now return `Option`, and are only converted to errors in cases where the errors are actually required. Change-Id: Iad7826eff2cb428182521c6f92276310edeae1eb Reviewed-on: https://cl.tvl.fyi/c/depot/+/6498 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-11 r/4810 refactor(tvix/eval): move attrset-related code to compiler::attrsVincent Ambo2-202/+209
There's about to be a lot more code for attrsets (hopefully temporarily as part of an expand&contract cycle), while nested attribute logic is being refactored in preparation for recursive attribute sets. This does not change any functionality. Change-Id: I667565cd810ca7d9046120d1721c2ceb9095550b Reviewed-on: https://cl.tvl.fyi/c/depot/+/6497 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-11 r/4809 fix(tvix/eval): place plain inherits in correct stack slotssterni3-27/+62
We need to make sure that we compile all plain inherits in a let expression before declaring any other locals. Plain inherits are special in the sense that they can never be recursive, instead resolving to a higher scope. Thus we need to compile their value, before declaring them. If we don't do that, before any other local can be declared, we cause a situation where the plain inherits' values are placed into other locals' stack slots. Note that we can't integrate the plain inherit compilation into the regular 2-3 phase model where we defer the compilation of the value or we'd compile `let inherit x; in …` as `let x = x; in …`. Change-Id: I951d5df3c9661a054e12401546875f4685b5bf08 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6496 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-11 r/4808 test(tvix/eval): add test for mutually recursive let bindingssterni2-0/+15
This test shows that let bindings' dependencies can form a cyclical graph, so we need to use thunking to break this cycle. Change-Id: I2a4de71fd7024f3d3d1166154784139a82f39411 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6495 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-11 r/4807 fix(tvix/eval): wrap asserts in a thunksterni3-1/+12
As the new test case demonstrates, asserts need to be evaluated lazily. Change-Id: I808046722c5a504e9497855ca5026d255c7a4c34 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6494 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-11 r/4806 test(tvix/eval): test “useful” plain inheritssterni2-0/+10
Change-Id: Ic4700f0618a393e45a2ee7c70045edff97e30c49 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6493 Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su> Reviewed-by: sterni <sternenseemann@systemli.org>
2022-09-11