about summary refs log tree commit diff
path: root/tvix/nix-compat/src/nar/writer/mod.rs
diff options
context:
space:
mode:
authoredef <edef@edef.eu>2023-10-09T17·51+0000
committeredef <edef@edef.eu>2023-10-09T18·39+0000
commitca1ede17cba6d029a8b60d5328ca51a43098491f (patch)
tree23b11ab0425938291d730628cfa3115f5313c9a9 /tvix/nix-compat/src/nar/writer/mod.rs
parent49b106b0cb996dd4bf5a5d4ecabc2a7e40025a5f (diff)
docs(tvix/nix-compat): document the name ordering requirement r/6753
Change-Id: Ia2c5f0b357a23d4bfac1fd52cf01845c78ebfa22
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9612
Autosubmit: edef <edef@edef.eu>
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Diffstat (limited to 'tvix/nix-compat/src/nar/writer/mod.rs')
-rw-r--r--tvix/nix-compat/src/nar/writer/mod.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/tvix/nix-compat/src/nar/writer/mod.rs b/tvix/nix-compat/src/nar/writer/mod.rs
index 71625420cc19..ffc1a9f30e8e 100644
--- a/tvix/nix-compat/src/nar/writer/mod.rs
+++ b/tvix/nix-compat/src/nar/writer/mod.rs
@@ -163,6 +163,10 @@ impl<'a, 'w> Directory<'a, 'w> {
     ///
     /// The entry is simply another [`Node`], which can then be filled like the
     /// root of a NAR (including, of course, by nesting directories).
+    ///
+    /// It is the caller's responsibility to ensure that directory entries are
+    /// written in order of ascending name. If this is not ensured, this method
+    /// may panic or silently produce invalid archives.
     pub fn entry(&mut self, name: &[u8]) -> io::Result<Node<'_, 'w>> {
         debug_assert!(
             name.len() <= wire::MAX_NAME_LEN,