codex - 💡(How to fix) Fix codex-exec-server package cannot build targeting musl [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#17769Fetched 2026-04-15 06:28:43
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

Root Cause

rust-v0.118.0 built fine because openssl was not in the codex-exec-server deps tree.

Fix Action

Fix / Workaround

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 }

Code Example

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"]
RAW_BUFFERClick to expand / collapse

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"]

extent analysis

TL;DR

The build failure can be resolved by adding openssl-sys as a dependency with the vendored feature for musl targets in the Cargo.toml file.

Guidance

  • The issue is caused by the absence of a musl version of openssl required by openssl-sys in the codex-exec-server dependencies.
  • To fix the issue, add the following lines to the Cargo.toml file:
    • [target.x86_64-unknown-linux-musl.dependencies]
    • openssl-sys = { workspace = true, features = ["vendored"] }
    • Repeat the above step for other musl targets, such as aarch64-unknown-linux-musl.
  • Verify the fix by running cargo build -p codex-exec-server --target x86_64-unknown-linux-musl after applying the changes.

Example

The provided patch file demonstrates the necessary changes to the Cargo.lock and Cargo.toml files.

Notes

The provided patch file assumes that the openssl-sys crate is already present in the workspace. If not, additional steps may be required to add it.

Recommendation

Apply the workaround by adding openssl-sys as a dependency with the vendored feature for musl targets, as this allows the build to use a vendored version of OpenSSL.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING