about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEmery Hemingway <ehmry@posteo.net>2024-08-27T07·24+0300
committerEmery Hemingway <ehmry@posteo.net>2024-08-27T15·01+0300
commitf44684b2ed86e7c8bd0906dae6001b95789e92a6 (patch)
treed0f961043bcb34d8abb8393536f1474dc6472b8d
parent64787e3811bfa875af7c273a82f64454b4175b0a (diff)
Do not convert Preserves sets to Nix
-rw-r--r--sbom.json2
-rw-r--r--src/nix_actor.nim1
-rw-r--r--src/nix_actor/nix_values.nim10
3 files changed, 7 insertions, 6 deletions
diff --git a/sbom.json b/sbom.json
index 12deb59ddb58..ee325b4b46d1 100644
--- a/sbom.json
+++ b/sbom.json
@@ -7,7 +7,7 @@
       "bom-ref": "pkg:nim/nix_actor",
       "name": "nix_actor",
       "description": "Syndicated Nix Actor",
-      "version": "20240826",
+      "version": "20240827",
       "authors": [
         {
           "name": "Emery Hemingway"
diff --git a/src/nix_actor.nim b/src/nix_actor.nim
index f191a52f2c61..8072b0c48c08 100644
--- a/src/nix_actor.nim
+++ b/src/nix_actor.nim
@@ -129,7 +129,6 @@ proc serve(entity: NixEntity; turn: Turn; obs: Observe) =
         break stepping
     for i, path in analysis.capturePaths:
       var v = entity.state.eval.step(entity.root, path)
-      assert v.isSome
       if v.isSome:
         captures[i] = turn.facet.exportNix(v.get)
       else:
diff --git a/src/nix_actor/nix_values.nim b/src/nix_actor/nix_values.nim
index a04c6d1578fb..0b3cbee27fa9 100644
--- a/src/nix_actor/nix_values.nim
+++ b/src/nix_actor/nix_values.nim
@@ -156,16 +156,18 @@ proc translate*(nix: NixContext; state: EvalState; pr: preserves.Value): NixValu
         result = nixValRef.get.value
       else:
         raise newException(ValueError, "cannot convert Preserves record to Nix: " & $pr)
-    of pkSequence, pkSet:
+    of pkSequence:
       let b = nix.make_list_builder(state, pr.len.csize_t)
       defer: list_builder_free(b)
-      for i, e in pr:
-        checkError nix.list_builder_insert(b, i.register.cuint, nix.translate(state, e))
+      for i, e in pr.sequence:
+        checkError nix.list_builder_insert(b, i.cuint, nix.translate(state, e))
       checkError nix.make_list(b, result)
+    of pkSet:
+      raise newException(ValueError, "cannot convert Preserves sets to Nix")
     of pkDictionary:
       let b = nix.make_bindings_builder(state, pr.dict.len.csize_t)
       defer: bindings_builder_free(b)
-      for (name, value) in pr.dict:
+      for (name, value) in pr.pairs:
         if name.isSymbol:
           checkError nix.bindings_builder_insert(b, name.symbol.string, nix.translate(state, value))
         else: