From 0239e46f2ac6b4040cb0e7a38c6d08d2fb3e0edc Mon Sep 17 00:00:00 2001 From: XSpielinbox <55600187+xspielinbox@users.noreply.github.com> Date: Wed, 13 May 2026 21:56:32 +0200 Subject: [PATCH 1/6] Remove unused unsafe permissions --- cackle.toml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/cackle.toml b/cackle.toml index 44389eb..21d81da 100644 --- a/cackle.toml +++ b/cackle.toml @@ -70,7 +70,6 @@ allow_proc_macro = true allow_unsafe = true [pkg.serde] -allow_unsafe = true allow_apis = [ "fs", ] @@ -198,9 +197,6 @@ build.allow_apis = [ [pkg.twox-hash] allow_unsafe = true -[pkg.stable_deref_trait] -allow_unsafe = true - [pkg.winnow] allow_unsafe = true @@ -222,18 +218,12 @@ allow_unsafe = true [pkg.ruzstd] allow_unsafe = true -[pkg.toml_edit] -allow_unsafe = true - [pkg.memchr] allow_unsafe = true [pkg.once_cell] allow_unsafe = true -[pkg.addr2line] -allow_unsafe = true - [pkg.object] allow_unsafe = true build.allow_apis = [ @@ -257,7 +247,6 @@ test.sandbox.make_writable = [ "test_crates/custom_target_dir", ] test.sandbox.allow_network = true -test.allow_unsafe = true [pkg.clap_builder] allow_apis = [ From a35e7fb11ff4f861fa62c11f30a60671ff4f9c3b Mon Sep 17 00:00:00 2001 From: XSpielinbox <55600187+xspielinbox@users.noreply.github.com> Date: Sun, 3 May 2026 21:24:13 +0200 Subject: [PATCH 2/6] Add std::os::darwin::fs to fs API --- src/config/built_in.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/config/built_in.rs b/src/config/built_in.rs index fa07718..51e3287 100644 --- a/src/config/built_in.rs +++ b/src/config/built_in.rs @@ -10,6 +10,7 @@ pub(crate) fn get_built_ins() -> BTreeMap { perm( &[ "std::fs", + "std::os::darwin::fs", "std::os::linux::fs", "std::os::unix::fs", "std::os::unix::io", From 64aa828e9d2e4b938fec0db991c308b23b41f92e Mon Sep 17 00:00:00 2001 From: XSpielinbox <55600187+xspielinbox@users.noreply.github.com> Date: Sun, 3 May 2026 21:24:33 +0200 Subject: [PATCH 3/6] Add std::os::linux::net to net API --- src/config/built_in.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/config/built_in.rs b/src/config/built_in.rs index 51e3287..5421023 100644 --- a/src/config/built_in.rs +++ b/src/config/built_in.rs @@ -27,7 +27,12 @@ pub(crate) fn get_built_ins() -> BTreeMap { result.insert( ApiName::from("net"), perm( - &["std::net", "std::os::wasi::net", "std::os::windows::net"], + &[ + "std::net", + "std::os::linux::net", + "std::os::wasi::net", + "std::os::windows::net", + ], &[], ), ); From fb1e0c7cd844bb2216d0c1b8fbc1842ee0ebbf82 Mon Sep 17 00:00:00 2001 From: XSpielinbox <55600187+xspielinbox@users.noreply.github.com> Date: Sun, 3 May 2026 21:24:50 +0200 Subject: [PATCH 4/6] Add std::os::linux::process to process API --- src/config/built_in.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/config/built_in.rs b/src/config/built_in.rs index 5421023..19114ea 100644 --- a/src/config/built_in.rs +++ b/src/config/built_in.rs @@ -45,6 +45,7 @@ pub(crate) fn get_built_ins() -> BTreeMap { perm( &[ "std::process", + "std::os::linux::process", "std::unix::process", "std::windows::process", ], From 74854559323bd5dce3b5bb64bd05d69bff889282 Mon Sep 17 00:00:00 2001 From: XSpielinbox <55600187+xspielinbox@users.noreply.github.com> Date: Sun, 3 May 2026 21:25:42 +0200 Subject: [PATCH 5/6] Remove nonexistent std::os::wasi::net from net API --- src/config/built_in.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/config/built_in.rs b/src/config/built_in.rs index 19114ea..4d94907 100644 --- a/src/config/built_in.rs +++ b/src/config/built_in.rs @@ -27,12 +27,7 @@ pub(crate) fn get_built_ins() -> BTreeMap { result.insert( ApiName::from("net"), perm( - &[ - "std::net", - "std::os::linux::net", - "std::os::wasi::net", - "std::os::windows::net", - ], + &["std::net", "std::os::linux::net", "std::os::windows::net"], &[], ), ); From 7bf7a58e80bfeeca0e07690569f75eceb011b694 Mon Sep 17 00:00:00 2001 From: XSpielinbox <55600187+xspielinbox@users.noreply.github.com> Date: Mon, 4 May 2026 10:48:31 +0200 Subject: [PATCH 6/6] Comment out unsupported platform specific APIs --- src/config/built_in.rs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/config/built_in.rs b/src/config/built_in.rs index 4d94907..865162f 100644 --- a/src/config/built_in.rs +++ b/src/config/built_in.rs @@ -10,14 +10,17 @@ pub(crate) fn get_built_ins() -> BTreeMap { perm( &[ "std::fs", - "std::os::darwin::fs", + // Darwin is not yet supported + //"std::os::darwin::fs", "std::os::linux::fs", "std::os::unix::fs", "std::os::unix::io", - "std::os::wasi::fs", - "std::os::wasi::io", - "std::os::windows::fs", - "std::os::windows::io", + // WASI is not yet supported + //"std::os::wasi::fs", + //"std::os::wasi::io", + // Windows is not yet supported + //"std::os::windows::fs", + //"std::os::windows::io", "std::path", ], &[], @@ -27,7 +30,12 @@ pub(crate) fn get_built_ins() -> BTreeMap { result.insert( ApiName::from("net"), perm( - &["std::net", "std::os::linux::net", "std::os::windows::net"], + &[ + "std::net", + "std::os::linux::net", + // Windows is not yet supported + //"std::os::windows::net", + ], &[], ), ); @@ -42,7 +50,8 @@ pub(crate) fn get_built_ins() -> BTreeMap { "std::process", "std::os::linux::process", "std::unix::process", - "std::windows::process", + // Windows is not yet supported + //"std::windows::process", ], &["std::process::abort", "std::process::exit"], ),