From 3594e7ded2d1ff0cc60cbcd3147dfbaf289a5ca1 Mon Sep 17 00:00:00 2001 From: Paul Tagliamonte Date: Tue, 8 Apr 2025 14:12:52 -0400 Subject: [PATCH] re-ad deep_clone the helper we were calling was pushing a new call, which was hanging out. we can skip the middleman since we already have something properly prepared, just without a stdlib in some cases. --- rust/kcl-lib/src/execution/mod.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rust/kcl-lib/src/execution/mod.rs b/rust/kcl-lib/src/execution/mod.rs index b5cdeea50..b2df697cc 100644 --- a/rust/kcl-lib/src/execution/mod.rs +++ b/rust/kcl-lib/src/execution/mod.rs @@ -723,7 +723,9 @@ impl ExecutorContext { preserve_mem: bool, ) -> Result<(EnvironmentRef, Option), KclErrorWithOutputs> { exec_state.add_root_module_contents(program); - self.prepare_mem(exec_state).await?; + self.eval_prelude(exec_state, SourceRange::synthetic()) + .await + .map_err(KclErrorWithOutputs::no_outputs)?; let mut universe = std::collections::HashMap::new(); @@ -932,12 +934,11 @@ impl ExecutorContext { ) })?; - // TODO: fix this - /* if !self.is_mock() { + if !self.is_mock() { let mut mem = exec_state.stack().deep_clone(); mem.restore_env(env_ref); cache::write_old_memory((mem, exec_state.global.module_infos.clone())).await; - }*/ + } let session_data = self.engine.get_session_data().await; Ok((env_ref, session_data)) }