more build fixes.

This commit is contained in:
David Wiesen
2025-10-07 15:07:31 -07:00
parent 6f3f78a716
commit b706fad1b6
4 changed files with 37 additions and 4 deletions
+3
View File
@@ -93,6 +93,9 @@ windows = { version = "0.58", features = [
[features]
default = []
windows_appcontainer_command_ext = []
windows_appcontainer_command_ext_raw_attribute = [
"windows_appcontainer_command_ext",
]
# Build OpenSSL from source for musl builds.
[target.x86_64-unknown-linux-musl.dependencies]
+1 -1
View File
@@ -1,7 +1,7 @@
//! Root of the `codex-core` library.
#![cfg_attr(
all(windows, feature = "windows_appcontainer_command_ext"),
all(windows, feature = "windows_appcontainer_command_ext_raw_attribute"),
feature(windows_process_extensions_raw_attribute)
)]
// Prevent accidental direct writes to stdout/stderr in library code. All
+28 -2
View File
@@ -8,7 +8,11 @@ use tracing::trace;
use crate::protocol::SandboxPolicy;
use crate::spawn::StdioPolicy;
#[cfg(feature = "windows_appcontainer_command_ext")]
#[cfg(all(
feature = "windows_appcontainer_command_ext",
feature = "windows_appcontainer_command_ext_raw_attribute",
))]
mod imp {
use super::*;
@@ -444,9 +448,31 @@ mod imp {
}
}
#[cfg(feature = "windows_appcontainer_command_ext")]
#[cfg(all(
feature = "windows_appcontainer_command_ext",
feature = "windows_appcontainer_command_ext_raw_attribute",
))]
pub use imp::spawn_command_under_windows_appcontainer;
#[cfg(all(
feature = "windows_appcontainer_command_ext",
not(feature = "windows_appcontainer_command_ext_raw_attribute"),
))]
pub async fn spawn_command_under_windows_appcontainer(
command: Vec<String>,
command_cwd: PathBuf,
_sandbox_policy: &SandboxPolicy,
_sandbox_policy_cwd: &Path,
_stdio_policy: StdioPolicy,
_env: HashMap<String, String>,
) -> io::Result<Child> {
let _ = (command, command_cwd);
Err(io::Error::new(
io::ErrorKind::Unsupported,
"AppContainer sandboxing requires the `windows_appcontainer_command_ext_raw_attribute` feature, which in turn needs a nightly compiler",
))
}
#[cfg(not(feature = "windows_appcontainer_command_ext"))]
pub async fn spawn_command_under_windows_appcontainer(
command: Vec<String>,
+5 -1
View File
@@ -1,4 +1,8 @@
#![cfg(all(windows, feature = "windows_appcontainer_command_ext"))]
#![cfg(all(
windows,
feature = "windows_appcontainer_command_ext",
feature = "windows_appcontainer_command_ext_raw_attribute",
))]
use codex_core::protocol::SandboxPolicy;
use codex_core::spawn::StdioPolicy;