codex-exec-server package cannot build targeting musl
Open 💬 0 comments Opened Apr 14, 2026 by evopen
What issue are you seeing?
In v0.120.0 tag or main branch, cargo build -p codex-exec-server --target x86_64-unknown-linux-musl build failed to find musl version of openssl required by openssl-sys.
rust-v0.118.0 built fine because openssl was not in the codex-exec-server deps tree.
What steps can reproduce the bug?
checkout rust-v0.120.0 and run cargo build -p codex-exec-server --target x86_64-unknown-linux-musl
What is the expected behavior?
The build passes.
Additional information
i currently fix it with this patch.
diff --git a/codex-rs/Cargo.lock b/codex-rs/Cargo.lock
index fc5c70e6b..7a1527ffe 100644
--- a/codex-rs/Cargo.lock
+++ b/codex-rs/Cargo.lock
@@ -2570,6 +2570,7 @@ dependencies = [
"icu_locale_core",
"icu_provider",
"landlock",
+ "openssl-sys",
"pretty_assertions",
"quick-xml",
"reqwest",
diff --git a/codex-rs/protocol/Cargo.toml b/codex-rs/protocol/Cargo.toml
index c4249a13b..476262e23 100644
--- a/codex-rs/protocol/Cargo.toml
+++ b/codex-rs/protocol/Cargo.toml
@@ -49,6 +49,14 @@ uuid = { workspace = true, features = ["serde", "v7", "v4"] }
landlock = { workspace = true }
seccompiler = { workspace = true }
+# Build OpenSSL from source for musl builds.
+[target.x86_64-unknown-linux-musl.dependencies]
+openssl-sys = { workspace = true, features = ["vendored"] }
+
+# Build OpenSSL from source for musl builds.
+[target.aarch64-unknown-linux-musl.dependencies]
+openssl-sys = { workspace = true, features = ["vendored"] }
+
[dev-dependencies]
anyhow = { workspace = true }
http = { workspace = true }
@@ -59,4 +67,5 @@ tempfile = { workspace = true }
# Required because:
# `icu_provider`: contains a required `sync` feature for `icu_decimal`
# `strum`: as strum_macros in non-nightly builds
-ignored = ["icu_provider", "strum"]
+# `openssl-sys`: cargo-shear cannot see the platform-specific openssl-sys usage
+ignored = ["icu_provider", "strum", "openssl-sys"]