Skip to content

Commit f7e2541

Browse files
committed
fix: make release host builds portable
1 parent e01cc27 commit f7e2541

6 files changed

Lines changed: 29 additions & 3 deletions

File tree

.agents/skills/codex-upstream-reapply/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ bash .agents/skills/codex-upstream-reapply/scripts/start_from_tag.sh \
152152

153153
如果分支上包含 codext npm / release 相关改动,必须先看 `references/npm-release.md`。这份文档明确要求:在 `NEW_BRANCH` 上用 `OLD_BRANCH``rust-release.yml` 覆盖当前 tag 分支内容,删除其他 workflow,并直接复制 `.github/scripts/install-musl-build-tools.sh``.github/scripts/rusty_v8_bazel.py``codex-cli/package.json``codex-cli/bin/codex.js``codex-cli/bin/rg``codex-cli/scripts/build_npm_package.py``codex-cli/scripts/install_native_deps.py`;这些是必做项,不是建议。只有这些动作完成后,才允许评估上游 / 新 tag 额外新增或改动的 CI 是否要合并或忽略。
154154

155-
完成 mandatory carry-over 后,必须执行 release artifact parity audit:逐个核对 upstream TAG 的 `cargo --bin`、artifact upload、release archive、vendor tree 与 npm platform package。特别是 `codex-code-mode-host` 必须随 `codex` 一起发布;只构建 CLI 或只复制 CLI 会导致运行时出现 “codex-code-mode-host 不存在”,这不是 API 认证失败。使用 `.agents/skills/codex-upstream-reapply/scripts/check_release_artifact_parity.sh` 做静态检查。
155+
完成 mandatory carry-over 后,必须执行 release artifact parity audit:逐个核对 upstream TAG 的 `cargo --bin`、artifact upload、release archive、vendor tree 与 npm platform package。特别是 `codex-code-mode-host` 必须随 `codex` 一起发布;只构建 CLI 或只复制 CLI 会导致运行时出现 “codex-code-mode-host 不存在”,这不是 API 认证失败。若 host 需要独立 Cargo 命令,还必须核对 musl target 的 `openssl-sys` vendored 配置和 release job 的 `CARGO_NET_GIT_FETCH_WITH_CLI`使用 `.agents/skills/codex-upstream-reapply/scripts/check_release_artifact_parity.sh` 做静态检查。
156156

157157
如果这套 codext npm / release 规则生效,所有用户可见文案、提示、tooltips、README/技能文档里凡是引用安装后命令名的地方,也必须同步使用 `codext`。例如恢复会话提示应写成 `codext resume <session>`,不要继续保留 `codex resume ...` 这类上游命令名。
158158

.agents/skills/codex-upstream-reapply/references/npm-release.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ Trace every runtime binary from build to package before committing:
3535
2. Follow each binary through build output, uploaded artifact, standalone archive, vendor tree, and npm platform package.
3636
3. Include `codex-code-mode-host` anywhere the CLI is shipped. It must sit beside `codex`/`codext`; `cargo build -p codex-cli` does not build it.
3737
Because Cargo resolves `--bin` within the selected package, build it in a separate command with `-p codex-code-mode-host`; do not append its `--bin` flag to the `codex-cli` command.
38-
4. Keep Windows-only helpers (`codex-windows-sandbox-setup.exe`, `codex-command-runner.exe`) and Linux resources such as `bwrap` aligned with the current release scripts.
38+
4. When the host is built separately for musl, keep target-specific vendored `openssl-sys` dependencies on `codex-protocol`; otherwise its `reqwest` native-tls dependency falls back to host OpenSSL headers.
39+
5. Keep Windows-only helpers (`codex-windows-sandbox-setup.exe`, `codex-command-runner.exe`) and Linux resources such as `bwrap` aligned with the current release scripts.
40+
6. Preserve `CARGO_NET_GIT_FETCH_WITH_CLI: "true"` in release jobs. The workspace contains git dependencies with nested submodules, and macOS runners can fail when Cargo uses libgit2/SecureTransport.
3941

4042
Run the static parity audit after the carry-over copy:
4143

.agents/skills/codex-upstream-reapply/scripts/check_release_artifact_parity.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ required_patterns=(
1313
"--bin codex-code-mode-host"
1414
"codex-code-mode-host"
1515
"codex-bin-"
16+
"CARGO_NET_GIT_FETCH_WITH_CLI"
1617
)
1718
for pattern in "${required_patterns[@]}"; do
1819
if ! rg -F --quiet -- "${pattern}" "${workflow}"; then
@@ -33,4 +34,13 @@ for path in \
3334
fi
3435
done
3536

37+
protocol_manifest="${repo_root}/codex-rs/protocol/Cargo.toml"
38+
for target in x86_64-unknown-linux-musl aarch64-unknown-linux-musl; do
39+
if ! rg -F --quiet -- "[target.${target}.dependencies]" "${protocol_manifest}" || \
40+
! rg -F --quiet -- 'openssl-sys = { workspace = true, features = ["vendored"] }' "${protocol_manifest}"; then
41+
echo "[ERROR] Musl release dependency parity is missing vendored OpenSSL for ${target}" >&2
42+
exit 1
43+
fi
44+
done
45+
3646
echo "[OK] Release artifact parity includes codex-code-mode-host"

.github/workflows/rust-release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
env:
2424
CARGO_PROFILE_RELEASE_LTO: thin
2525
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
26+
# Avoid intermittent SecureTransport/libgit2 failures while fetching
27+
# libwebrtc's nested libyuv submodule on macOS release runners.
28+
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
2629
strategy:
2730
fail-fast: false
2831
matrix:
@@ -225,6 +228,8 @@ jobs:
225228
defaults:
226229
run:
227230
working-directory: codex-rs
231+
env:
232+
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
228233
strategy:
229234
fail-fast: false
230235
matrix:

codex-rs/Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codex-rs/protocol/Cargo.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ wildmatch = { workspace = true }
5252
landlock = { workspace = true }
5353
seccompiler = { workspace = true }
5454

55+
# Keep native-tls usable when codex-code-mode-host is built as a separate
56+
# package for musl release artifacts.
57+
[target.x86_64-unknown-linux-musl.dependencies]
58+
openssl-sys = { workspace = true, features = ["vendored"] }
59+
60+
[target.aarch64-unknown-linux-musl.dependencies]
61+
openssl-sys = { workspace = true, features = ["vendored"] }
62+
5563
[dev-dependencies]
5664
anyhow = { workspace = true }
5765
http = { workspace = true }
@@ -62,4 +70,4 @@ tempfile = { workspace = true }
6270
# Required because:
6371
# `icu_provider`: contains a required `sync` feature for `icu_decimal`
6472
# `strum`: is referenced by generated `EnumIter` derive implementations
65-
ignored = ["icu_provider", "strum"]
73+
ignored = ["icu_provider", "openssl-sys", "strum"]

0 commit comments

Comments
 (0)