mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:50:52 +00:00
more build fixes.
This commit is contained in:
@@ -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,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
|
||||
|
||||
@@ -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>,
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user