From fc4fbdf8ef94dc89df12f8881c82215f7869a09a Mon Sep 17 00:00:00 2001 From: Hulto <7121375+hulto@users.noreply.github.com> Date: Fri, 3 May 2024 16:19:02 +0000 Subject: [PATCH 1/4] Prevent golem from erroring. --- implants/golem/src/main.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/implants/golem/src/main.rs b/implants/golem/src/main.rs index 4ad98eddd..ef8e9532c 100644 --- a/implants/golem/src/main.rs +++ b/implants/golem/src/main.rs @@ -39,9 +39,7 @@ async fn run_tomes(tomes: Vec) -> Result> { for msg in runtime.messages() { match msg { Message::ReportText(m) => result.push(m.text()), - Message::ReportError(m) => { - return Err(anyhow!("{}", m.error)); - } + Message::ReportError(m) => {} _ => {} } } From 2046138b93dbf3d897481b1ee388967085ad7ff1 Mon Sep 17 00:00:00 2001 From: Hulto <7121375+hulto@users.noreply.github.com> Date: Fri, 3 May 2024 16:23:14 +0000 Subject: [PATCH 2/4] Fix macos test. --- implants/lib/eldritch/src/sys/get_os_impl.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/implants/lib/eldritch/src/sys/get_os_impl.rs b/implants/lib/eldritch/src/sys/get_os_impl.rs index aef68e4cf..b7a1a67c2 100644 --- a/implants/lib/eldritch/src/sys/get_os_impl.rs +++ b/implants/lib/eldritch/src/sys/get_os_impl.rs @@ -65,7 +65,10 @@ mod tests { let test_heap = Heap::new(); let res = get_os(&test_heap)?; println!("{}", res); + #[cfg(target_arch = "x86_64")] assert!(res.to_string().contains(r#""arch": "x86_64""#)); + #[cfg(target_arch = "aarch64")] + assert!(res.to_string().contains(r#""arch": "arm64""#)); Ok(()) } } From bcfe600907473bd01e57f6b3fb5a804e583bdebe Mon Sep 17 00:00:00 2001 From: Hulto <7121375+hulto@users.noreply.github.com> Date: Fri, 3 May 2024 19:19:15 +0000 Subject: [PATCH 3/4] Should be good now --- implants/golem/src/main.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/implants/golem/src/main.rs b/implants/golem/src/main.rs index ef8e9532c..df4c45c09 100644 --- a/implants/golem/src/main.rs +++ b/implants/golem/src/main.rs @@ -33,18 +33,21 @@ async fn run_tomes(tomes: Vec) -> Result> { } let mut result = Vec::new(); + let mut errors = Vec::new(); for runtime in &mut runtimes { runtime.finish().await; for msg in runtime.messages() { match msg { Message::ReportText(m) => result.push(m.text()), - Message::ReportError(m) => {} + Message::ReportError(m) => errors.push(m.error), _ => {} } } } - + if !errors.is_empty() { + return Err(anyhow!("{:?}", errors)); + } Ok(result) } From a4c225d415477f9bc879be948b4bd9a3ddfea130 Mon Sep 17 00:00:00 2001 From: Hulto <7121375+hulto@users.noreply.github.com> Date: Fri, 3 May 2024 19:25:55 +0000 Subject: [PATCH 4/4] Fix sytax test --- implants/golem/tests/cli.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implants/golem/tests/cli.rs b/implants/golem/tests/cli.rs index 1e417e0e2..db8819b51 100644 --- a/implants/golem/tests/cli.rs +++ b/implants/golem/tests/cli.rs @@ -31,7 +31,7 @@ fn test_golem_main_syntax_fail() -> anyhow::Result<()> { cmd.arg(format!("{GOLEM_CLI_TEST_DIR}syntax_fail.tome")); cmd.assert().failure().stderr(predicate::str::contains( - r#"Parse error: unexpected string literal "win" here"#.to_string(), + r#"Parse error: unexpected string literal"#.to_string(), )); Ok(())