)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"b9dc0005fd88f3090cbb761be47dcd31eab766dd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"71acb335_98f6f5b8","updated":"2023-05-17 15:53:09.000000000","message":"this is missing tvix_io.rs. can you commit it too? ;-)","commit_id":"12b0d0f87f709d363fac4bea0ed018bccc8699df"}],"tvix/cli/src/tvix_io.rs":[{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"30c0275c3bc6728665add0447c3e319f3a40182e","unresolved":true,"context_lines":[{"line_number":1,"context_line":"//! This module implements a wrapper around tvix-eval\u0027s [EvalIO] type"},{"line_number":2,"context_line":"//! which handles tvix-cli specific operations, such as marking plain"},{"line_number":3,"context_line":"//! paths as known to the reference scanner."},{"line_number":4,"context_line":"//!"},{"line_number":5,"context_line":"//! All uses of [EvalIO] in tvix-cli should make use of this wrapper."},{"line_number":6,"context_line":""}],"source_content_type":"text/x-rustsrc","patch_set":3,"id":"c814f561_336d1b17","line":3,"updated":"2023-05-18 10:43:52.000000000","message":"This is a bit of a kitchensink of various things, we should explicitly state the two things it does:\n\n - mark plain paths as known to the reference scanner\n - replace the `__corepkgs__` magic path with its contents\n\nThis should prevent further stuff to be introduced here.","commit_id":"85f169588f667513758e69724b5476b5dfb80d49"},{"author":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"change_message_id":"fd070ae206ec24e2b1e10f68f425ed7d329d3f1d","unresolved":false,"context_lines":[{"line_number":1,"context_line":"//! This module implements a wrapper around tvix-eval\u0027s [EvalIO] type"},{"line_number":2,"context_line":"//! which handles tvix-cli specific operations, such as marking plain"},{"line_number":3,"context_line":"//! paths as known to the reference scanner."},{"line_number":4,"context_line":"//!"},{"line_number":5,"context_line":"//! All uses of [EvalIO] in tvix-cli should make use of this wrapper."},{"line_number":6,"context_line":""}],"source_content_type":"text/x-rustsrc","patch_set":3,"id":"6a96b47e_b9f14b6a","line":3,"in_reply_to":"c814f561_336d1b17","updated":"2023-05-18 11:06:42.000000000","message":"It\u0027s not impossible that there\u0027s something that will need to be added here later, but I\u0027ll update this as a list of the current things it does.","commit_id":"85f169588f667513758e69724b5476b5dfb80d49"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"30c0275c3bc6728665add0447c3e319f3a40182e","unresolved":true,"context_lines":[{"line_number":2,"context_line":"//! which handles tvix-cli specific operations, such as marking plain"},{"line_number":3,"context_line":"//! paths as known to the reference scanner."},{"line_number":4,"context_line":"//!"},{"line_number":5,"context_line":"//! All uses of [EvalIO] in tvix-cli should make use of this wrapper."},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"use crate::KnownPaths;"},{"line_number":8,"context_line":"use smol_str::SmolStr;"}],"source_content_type":"text/x-rustsrc","patch_set":3,"id":"4d6b61d7_dd9ccd4f","line":5,"updated":"2023-05-18 10:43:52.000000000","message":"Explain why ;-)","commit_id":"85f169588f667513758e69724b5476b5dfb80d49"},{"author":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"change_message_id":"fd070ae206ec24e2b1e10f68f425ed7d329d3f1d","unresolved":false,"context_lines":[{"line_number":2,"context_line":"//! which handles tvix-cli specific operations, such as marking plain"},{"line_number":3,"context_line":"//! paths as known to the reference scanner."},{"line_number":4,"context_line":"//!"},{"line_number":5,"context_line":"//! All uses of [EvalIO] in tvix-cli should make use of this wrapper."},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"use crate::KnownPaths;"},{"line_number":8,"context_line":"use smol_str::SmolStr;"}],"source_content_type":"text/x-rustsrc","patch_set":3,"id":"4d4599ac_e9eb6a03","line":5,"in_reply_to":"4d6b61d7_dd9ccd4f","updated":"2023-05-18 11:06:42.000000000","message":"Done","commit_id":"85f169588f667513758e69724b5476b5dfb80d49"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"30c0275c3bc6728665add0447c3e319f3a40182e","unresolved":true,"context_lines":[{"line_number":11,"context_line":"use std::rc::Rc;"},{"line_number":12,"context_line":"use tvix_eval::{ErrorKind, EvalIO, FileType};"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"pub(crate) struct TvixIO\u003cT: EvalIO\u003e {"},{"line_number":15,"context_line":"    /// Ingested paths must be reported to this known paths tracker"},{"line_number":16,"context_line":"    /// for accurate build reference scanning."},{"line_number":17,"context_line":"    known_paths: Rc\u003cRefCell\u003cKnownPaths\u003e\u003e,"}],"source_content_type":"text/x-rustsrc","patch_set":3,"id":"4df203a1_49858803","line":14,"updated":"2023-05-18 10:43:52.000000000","message":"RefscanCorepkgsIO","commit_id":"85f169588f667513758e69724b5476b5dfb80d49"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"8380b7e340427f60f000bfb21e12bd7ed5f7e092","unresolved":false,"context_lines":[{"line_number":11,"context_line":"use std::rc::Rc;"},{"line_number":12,"context_line":"use tvix_eval::{ErrorKind, EvalIO, FileType};"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"pub(crate) struct TvixIO\u003cT: EvalIO\u003e {"},{"line_number":15,"context_line":"    /// Ingested paths must be reported to this known paths tracker"},{"line_number":16,"context_line":"    /// for accurate build reference scanning."},{"line_number":17,"context_line":"    known_paths: Rc\u003cRefCell\u003cKnownPaths\u003e\u003e,"}],"source_content_type":"text/x-rustsrc","patch_set":3,"id":"e853aaf5_48e1ff4b","line":14,"in_reply_to":"05b943ac_237efbc9","updated":"2023-05-18 14:30:50.000000000","message":"ok","commit_id":"85f169588f667513758e69724b5476b5dfb80d49"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"1508f1e1e6e2d2c724a9d2d8a518466c1188d79b","unresolved":true,"context_lines":[{"line_number":11,"context_line":"use std::rc::Rc;"},{"line_number":12,"context_line":"use tvix_eval::{ErrorKind, EvalIO, FileType};"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"pub(crate) struct TvixIO\u003cT: EvalIO\u003e {"},{"line_number":15,"context_line":"    /// Ingested paths must be reported to this known paths tracker"},{"line_number":16,"context_line":"    /// for accurate build reference scanning."},{"line_number":17,"context_line":"    known_paths: Rc\u003cRefCell\u003cKnownPaths\u003e\u003e,"}],"source_content_type":"text/x-rustsrc","patch_set":3,"id":"2e7101a6_48ac5e60","line":14,"in_reply_to":"1faccb24_9c83cfcc","updated":"2023-05-18 12:23:56.000000000","message":"What does tvix-compatible mean in this case? Compatible with how tvix is designed? That\u0027s a moving target.\n\nAlso, as explained in https://cl.tvl.fyi/c/depot/+/8579/comment/23130a79_693e95ac/, resolving `__corepkgs__` will make it Tvixbolt-compatible. Maybe these two things should be separate wrappers in the future.\n\nI\u0027m not saying we should do the splitting now, but I\u0027d like to at least have that idea in the comment, when we get back to this.\n\nThere\u0027s some interest from hsjobeki in evaluating nixpkgs from tvixbolt, and we don\u0027t need a real filesystem, but just the CorepkgsIO part, wrapping something that understands how to lookup paths in a given nixpkgs snapshot.","commit_id":"85f169588f667513758e69724b5476b5dfb80d49"},{"author":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"change_message_id":"b880cb3ecb9485c52ab14a9c05cb2aae3acdac97","unresolved":true,"context_lines":[{"line_number":11,"context_line":"use std::rc::Rc;"},{"line_number":12,"context_line":"use tvix_eval::{ErrorKind, EvalIO, FileType};"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"pub(crate) struct TvixIO\u003cT: EvalIO\u003e {"},{"line_number":15,"context_line":"    /// Ingested paths must be reported to this known paths tracker"},{"line_number":16,"context_line":"    /// for accurate build reference scanning."},{"line_number":17,"context_line":"    known_paths: Rc\u003cRefCell\u003cKnownPaths\u003e\u003e,"}],"source_content_type":"text/x-rustsrc","patch_set":3,"id":"05b943ac_237efbc9","line":14,"in_reply_to":"2e7101a6_48ac5e60","updated":"2023-05-18 14:23:25.000000000","message":"tvix-compatible means exactly what\u0027s done here, currently, and because of that being a moving target I don\u0027t wanna give it a name that requires changing every time the behaviour is reconsidered\n\nfor tvixbolt with an in-memory FS you need exactly the behaviour implemented in this wrapper still.","commit_id":"85f169588f667513758e69724b5476b5dfb80d49"},{"author":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"change_message_id":"fd070ae206ec24e2b1e10f68f425ed7d329d3f1d","unresolved":false,"context_lines":[{"line_number":11,"context_line":"use std::rc::Rc;"},{"line_number":12,"context_line":"use tvix_eval::{ErrorKind, EvalIO, FileType};"},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"pub(crate) struct TvixIO\u003cT: EvalIO\u003e {"},{"line_number":15,"context_line":"    /// Ingested paths must be reported to this known paths tracker"},{"line_number":16,"context_line":"    /// for accurate build reference scanning."},{"line_number":17,"context_line":"    known_paths: Rc\u003cRefCell\u003cKnownPaths\u003e\u003e,"}],"source_content_type":"text/x-rustsrc","patch_set":3,"id":"1faccb24_9c83cfcc","line":14,"in_reply_to":"4df203a1_49858803","updated":"2023-05-18 11:06:42.000000000","message":"No, that\u0027s not a good name. In the interface of this the internal details of which problems this solves do not matter to the user. At the call-site, you don\u0027t think \"I need refscanning for plain paths\", you think \"I need to make my IO implementation Tvix-compatible\".","commit_id":"85f169588f667513758e69724b5476b5dfb80d49"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"30c0275c3bc6728665add0447c3e319f3a40182e","unresolved":true,"context_lines":[{"line_number":17,"context_line":"    known_paths: Rc\u003cRefCell\u003cKnownPaths\u003e\u003e,"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"    // Actual underlying [EvalIO] implementation."},{"line_number":20,"context_line":"    actual: T,"},{"line_number":21,"context_line":"}"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"impl\u003cT: EvalIO\u003e TvixIO\u003cT\u003e {"}],"source_content_type":"text/x-rustsrc","patch_set":3,"id":"f56f062e_223bf382","line":20,"updated":"2023-05-18 10:43:52.000000000","message":"I think we called this `inner` in other places?","commit_id":"85f169588f667513758e69724b5476b5dfb80d49"},{"author":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"change_message_id":"fd070ae206ec24e2b1e10f68f425ed7d329d3f1d","unresolved":false,"context_lines":[{"line_number":17,"context_line":"    known_paths: Rc\u003cRefCell\u003cKnownPaths\u003e\u003e,"},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"    // Actual underlying [EvalIO] implementation."},{"line_number":20,"context_line":"    actual: T,"},{"line_number":21,"context_line":"}"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"impl\u003cT: EvalIO\u003e TvixIO\u003cT\u003e {"}],"source_content_type":"text/x-rustsrc","patch_set":3,"id":"19fe7684_7d18cede","line":20,"in_reply_to":"f56f062e_223bf382","updated":"2023-05-18 11:06:42.000000000","message":"It was `underlying` somewhere else, but there really isn\u0027t a pattern for this as long as Rust has no official delegation support.","commit_id":"85f169588f667513758e69724b5476b5dfb80d49"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"30c0275c3bc6728665add0447c3e319f3a40182e","unresolved":true,"context_lines":[{"line_number":58,"context_line":"        //"},{"line_number":59,"context_line":"        // TODO: this comparison is bad and allocates, we should use"},{"line_number":60,"context_line":"        // the sane path library."},{"line_number":61,"context_line":"        if path.starts_with(\"/__corepkgs__/fetchurl.nix\") {"},{"line_number":62,"context_line":"            return Ok(include_str!(\"fetchurl.nix\").to_string());"},{"line_number":63,"context_line":"        }"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-rustsrc","patch_set":3,"id":"23130a79_693e95ac","line":61,"updated":"2023-05-18 10:43:52.000000000","message":"Shouldn\u0027t this just be something like `if path.to_string() \u003d\u003d \"/__corepkgs__/fetchurl.nix\" {` (equality, rather than a prefix check)?\n\nWe only deal with `fetchurl.nix`, nothing else.\n\nIn the comment above, pls also refer to the place where this gets replaced to look like this, so it\u0027s easy to find the counterpart.\n\nOn that location, please also add a TODO pointing to a bug to thread through some newtype/enum, which can either be the \"fetchurl from corepkgs marker\" or a plain path.\n\nI\u0027d probably go even so far and say the bug should request splitting this wrapper to two different ones, even in a pure eval context we can deal with `\u003cnix/fetchurl.nix\u003e`.","commit_id":"85f169588f667513758e69724b5476b5dfb80d49"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"8380b7e340427f60f000bfb21e12bd7ed5f7e092","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        //"},{"line_number":59,"context_line":"        // TODO: this comparison is bad and allocates, we should use"},{"line_number":60,"context_line":"        // the sane path library."},{"line_number":61,"context_line":"        if path.starts_with(\"/__corepkgs__/fetchurl.nix\") {"},{"line_number":62,"context_line":"            return Ok(include_str!(\"fetchurl.nix\").to_string());"},{"line_number":63,"context_line":"        }"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-rustsrc","patch_set":3,"id":"c4e15d17_6a3bbabc","line":61,"in_reply_to":"12200ec9_da40323d","updated":"2023-05-18 14:30:50.000000000","message":"Ack","commit_id":"85f169588f667513758e69724b5476b5dfb80d49"},{"author":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"change_message_id":"fd070ae206ec24e2b1e10f68f425ed7d329d3f1d","unresolved":true,"context_lines":[{"line_number":58,"context_line":"        //"},{"line_number":59,"context_line":"        // TODO: this comparison is bad and allocates, we should use"},{"line_number":60,"context_line":"        // the sane path library."},{"line_number":61,"context_line":"        if path.starts_with(\"/__corepkgs__/fetchurl.nix\") {"},{"line_number":62,"context_line":"            return Ok(include_str!(\"fetchurl.nix\").to_string());"},{"line_number":63,"context_line":"        }"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-rustsrc","patch_set":3,"id":"6e969aa9_de63c893","line":61,"in_reply_to":"23130a79_693e95ac","updated":"2023-05-18 11:06:42.000000000","message":"\u003e (equality, rather than a prefix check)?\n\nThis only works if you do a lossy conversion, which opens up for theoretical weird edge-cases like `/__corepkgs__\u003cunprintable character\u003e/...`. I\u0027d rather keep this as is for now and switch it out later when we turn paths into the saner structure suggested by grfn.\n\n\u003e In the comment above, pls also refer to the place where this gets replaced to look like this, so it\u0027s easy to find the counterpart.\n\nDone.\n\n\u003e On that location, please also add a TODO pointing to a bug to thread through some newtype/enum, which can either be the \"fetchurl from corepkgs marker\" or a plain path.\n\nI\u0027m not convinced this is useful, we can\u0027t get around having to string-match the `nix` item on the NIX_PATH (as that is what\u0027s happening in nixpkgs), so what sort of intermediate structure we carry is really not that relevant. It\u0027s also not really a problem of the evaluator, where NIX_PATH resolution occurs, as someone might want to use the evaluator in a situation where nixpkgs is not involved and `nix` actually points to something else.","commit_id":"85f169588f667513758e69724b5476b5dfb80d49"},{"author":{"_account_id":1000036,"name":"flokli","email":"flokli@flokli.de","username":"flokli"},"change_message_id":"1508f1e1e6e2d2c724a9d2d8a518466c1188d79b","unresolved":true,"context_lines":[{"line_number":58,"context_line":"        //"},{"line_number":59,"context_line":"        // TODO: this comparison is bad and allocates, we should use"},{"line_number":60,"context_line":"        // the sane path library."},{"line_number":61,"context_line":"        if path.starts_with(\"/__corepkgs__/fetchurl.nix\") {"},{"line_number":62,"context_line":"            return Ok(include_str!(\"fetchurl.nix\").to_string());"},{"line_number":63,"context_line":"        }"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-rustsrc","patch_set":3,"id":"9d63771f_c160c6ae","line":61,"in_reply_to":"6e969aa9_de63c893","updated":"2023-05-18 12:23:56.000000000","message":"\u003e when we turn paths into the saner structure suggested by grfn.\n\nWhere is this suggestion, can you link to it from there? I\u0027d guess it\u0027s https://b.tvl.fyi/issues/189, linking to https://blog.burntsushi.net/bstr/.\n\nI agree paths are very annoying to deal with, and I\u0027m pretty certain we need to accept arbitrary paths as bytes.\n\nRegarding the \"override \u003cnix\" thing:\n\nIn later versions, Nix doesn\u0027t support pointing `nix` to something else anymore,and I doubt there\u0027s a real usecase for this, but sure.","commit_id":"85f169588f667513758e69724b5476b5dfb80d49"},{"author":{"_account_id":1000001,"name":"tazjin","email":"tazjin@tvl.su","username":"tazjin"},"change_message_id":"b880cb3ecb9485c52ab14a9c05cb2aae3acdac97","unresolved":true,"context_lines":[{"line_number":58,"context_line":"        //"},{"line_number":59,"context_line":"        // TODO: this comparison is bad and allocates, we should use"},{"line_number":60,"context_line":"        // the sane path library."},{"line_number":61,"context_line":"        if path.starts_with(\"/__corepkgs__/fetchurl.nix\") {"},{"line_number":62,"context_line":"            return Ok(include_str!(\"fetchurl.nix\").to_string());"},{"line_number":63,"context_line":"        }"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-rustsrc","patch_set":3,"id":"12200ec9_da40323d","line":61,"in_reply_to":"9d63771f_c160c6ae","updated":"2023-05-18 14:23:25.000000000","message":"I\u0027m not sure if he opened a bug for it, check with him on IRC ideally\n\nAs for \u003cnix\u003e, my point is just that the evaluator shouldn\u0027t know about it, it should be independent from this kind of legacy stuff in Nix wherever possible.","commit_id":"85f169588f667513758e69724b5476b5dfb80d49"}]}
