Skip to content

Commit 7188da2

Browse files
committed
Merge upstream main and release v0.144.3
2 parents 01a9cf6 + 2e3a170 commit 7188da2

2,313 files changed

Lines changed: 239090 additions & 56656 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.bazelrc‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,6 @@ common:ci --disk_cache=
105105
# Shared config for the main Bazel CI workflow.
106106
common:ci-bazel --config=ci
107107
common:ci-bazel --build_metadata=TAG_workflow=bazel
108-
# Keep code-mode integration cases out of ordinary Bazel legs. The
109-
# Windows-cross config below re-enables them after generating its Windows V8
110-
# snapshot on the Windows runner. Also skip the ConPTY Ctrl-C integration test
111-
# until Windows Bazel CI can reliably interrupt foreground processes.
112-
common:ci-bazel --test_env=CODEX_BAZEL_TEST_SKIP_FILTERS=suite::code_mode::,tests::windows_tests::conpty_ctrl_c_interrupts_powershell_foreground_child
113108

114109
# Shared config for Bazel-backed Rust linting.
115110
build:clippy --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect
@@ -122,6 +117,7 @@ build:clippy --@rules_rust//rust/settings:clippy.toml=//codex-rs:clippy.toml
122117
build:clippy --@rules_rust//rust/settings:clippy_flag=-Dwarnings
123118
build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::await_holding_invalid_type
124119
build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::await_holding_lock
120+
build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::disallowed_methods
125121
build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::expect_used
126122
build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::identity_op
127123
build:clippy --@rules_rust//rust/settings:clippy_flag=--deny=clippy::manual_clamp
@@ -165,6 +161,9 @@ build:argument-comment-lint --@rules_rust//rust/toolchain/channel=nightly
165161
common:ci-windows --config=ci-bazel
166162
common:ci-windows --build_metadata=TAG_os=windows
167163
common:ci-windows --repo_contents_cache=D:/a/.cache/bazel-repo-contents-cache
164+
# The hidden dynamic-tool callback currently times out on Windows, and ConPTY
165+
# cannot reliably interrupt foreground processes on Windows Bazel runners.
166+
common:ci-windows --test_env=CODEX_BAZEL_TEST_SKIP_FILTERS=suite::code_mode::code_mode_can_call_hidden_dynamic_tools,tests::windows_tests::conpty_ctrl_c_interrupts_powershell_foreground_child
168167

169168
# We prefer to run the build actions entirely remotely so we can dial up the concurrency.
170169
# We have platform-specific tests, so we want to execute the tests on all platforms using the strongest sandboxing available on each platform.
@@ -194,9 +193,7 @@ common:ci-windows-cross --local_test_jobs=8
194193
common:ci-windows-cross --test_env=RUST_TEST_THREADS=1
195194
# Native Windows CI still covers the PowerShell parser-process tests. The
196195
# cross-built gnullvm binaries currently hang in those tests when run on the
197-
# Windows runner. Keep V8-backed code-mode tests enabled except for the hidden
198-
# dynamic-tool callback test, which currently times out on Windows. This config
199-
# replaces the base skip list, so repeat the exact ConPTY Ctrl-C test exclusion.
196+
# Windows runner. This replaces the Windows skip list, so retain its exclusions.
200197
common:ci-windows-cross --test_env=CODEX_BAZEL_TEST_SKIP_FILTERS=command_safety::powershell_parser::tests::,suite::code_mode::code_mode_can_call_hidden_dynamic_tools,tests::windows_tests::conpty_ctrl_c_interrupts_powershell_foreground_child
201198
common:ci-windows-cross --platforms=//:windows_x86_64_gnullvm
202199
common:ci-windows-cross --extra_execution_platforms=//:rbe,//:windows_x86_64_msvc

‎.codespellignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
iTerm
22
iTerm2
3+
numer
34
psuedo
45
SOM
56
te

‎.github/actions/setup-rusty-v8/action.yml‎

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,36 @@ runs:
1919
release_tag="rusty-v8-v${version}"
2020
base_url="https://github.com/openai/codex/releases/download/${release_tag}"
2121
binding_dir="${RUNNER_TEMP}/rusty_v8"
22-
archive_path="${binding_dir}/librusty_v8_release_${TARGET}.a.gz"
23-
binding_path="${binding_dir}/src_binding_release_${TARGET}.rs"
24-
checksums_path="${binding_dir}/rusty_v8_release_${TARGET}.sha256"
22+
23+
profile="ptrcomp_sandbox_release"
24+
25+
if [[ "$TARGET" == *-pc-windows-msvc ]]; then
26+
archive_name="rusty_v8_${profile}_${TARGET}.lib.gz"
27+
else
28+
archive_name="librusty_v8_${profile}_${TARGET}.a.gz"
29+
fi
30+
binding_name="src_binding_${profile}_${TARGET}.rs"
31+
checksums_name="rusty_v8_${profile}_${TARGET}.sha256"
32+
33+
archive_path="${binding_dir}/${archive_name}"
34+
binding_path="${binding_dir}/${binding_name}"
35+
checksums_path="${binding_dir}/${checksums_name}"
2536
2637
mkdir -p "${binding_dir}"
27-
curl -fsSL "${base_url}/librusty_v8_release_${TARGET}.a.gz" -o "${archive_path}"
28-
curl -fsSL "${base_url}/src_binding_release_${TARGET}.rs" -o "${binding_path}"
29-
curl -fsSL "${base_url}/rusty_v8_release_${TARGET}.sha256" -o "${checksums_path}"
38+
curl -fsSL "${base_url}/${archive_name}" -o "${archive_path}"
39+
curl -fsSL "${base_url}/${binding_name}" -o "${binding_path}"
40+
curl -fsSL "${base_url}/${checksums_name}" -o "${checksums_path}"
3041
3142
if [[ "$(wc -l < "${checksums_path}")" -ne 2 ]]; then
3243
echo "Expected exactly two checksums for ${TARGET} in ${checksums_path}" >&2
3344
exit 1
3445
fi
3546
47+
# Existing Windows-built release manifests use CRLF line endings.
3648
if command -v sha256sum >/dev/null 2>&1; then
37-
(cd "${binding_dir}" && sha256sum -c "${checksums_path}")
49+
(cd "${binding_dir}" && tr -d '\r' < "${checksums_path}" | sha256sum -c -)
3850
else
39-
(cd "${binding_dir}" && shasum -a 256 -c "${checksums_path}")
51+
(cd "${binding_dir}" && tr -d '\r' < "${checksums_path}" | shasum -a 256 -c -)
4052
fi
4153
echo "RUSTY_V8_ARCHIVE=${archive_path}" >> "${GITHUB_ENV}"
4254
echo "RUSTY_V8_SRC_BINDING_PATH=${binding_path}" >> "${GITHUB_ENV}"

‎.github/scripts/build-codex-package-archive.sh‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Usage: build-codex-package-archive.sh \
1010
--archive-dir <dir> \
1111
[--bwrap-bin <path>] \
1212
[--code-mode-host-bin <path>] \
13+
[--rg-bin <path>] \
14+
[--zsh-bin <path>] \
1315
[--zsh-manifest <path>] \
1416
[--codex-command-runner-bin <path>] \
1517
[--codex-windows-sandbox-setup-bin <path>] \
@@ -56,6 +58,14 @@ while [[ $# -gt 0 ]]; do
5658
code_mode_host_bin_provided="true"
5759
shift 2
5860
;;
61+
--rg-bin)
62+
resource_args+=(--rg-bin "${2:?--rg-bin requires a value}")
63+
shift 2
64+
;;
65+
--zsh-bin)
66+
resource_args+=(--zsh-bin "${2:?--zsh-bin requires a value}")
67+
shift 2
68+
;;
5969
--zsh-manifest)
6070
resource_args+=(--zsh-manifest "${2:?--zsh-manifest requires a value}")
6171
shift 2

.github/scripts/macos-signing/notarize_macos_binary_with_rcodesign.sh renamed to .github/scripts/macos-signing/notarize_macos_binary_with_akv.sh

Lines changed: 11 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
#!/usr/bin/env bash
22

3-
# Submits a signed standalone macOS binary to Apple notarization through
4-
# rcodesign. Standalone binaries cannot carry a stapled ticket, so the binary
5-
# is submitted in a ZIP and the successful notarization log is retained.
3+
# Notarize a standalone binary and retain its diagnostic report.
64

75
set -euo pipefail
86

97
usage() {
108
cat >&2 <<'EOF'
11-
Usage: notarize_macos_binary_with_rcodesign.sh --binary PATH [--report-dir PATH] [--max-wait-seconds SECONDS]
9+
Usage: notarize_macos_binary_with_akv.sh --binary PATH [--report-dir PATH] [--max-wait-seconds SECONDS]
1210
1311
Options:
1412
--binary PATH Signed standalone macOS binary to notarize.
1513
--report-dir PATH Directory for notarization logs.
16-
--max-wait-seconds SECONDS Maximum rcodesign notarization wait time.
14+
--max-wait-seconds SECONDS Maximum Apple notarization wait time.
1715
EOF
1816
}
1917

@@ -63,7 +61,7 @@ if [[ ! "$max_wait_seconds" =~ ^[0-9]+$ ]]; then
6361
exit 2
6462
fi
6563

66-
for command_name in rcodesign zip; do
64+
for command_name in python3 zip; do
6765
if ! command -v "$command_name" >/dev/null 2>&1; then
6866
echo "$command_name was not found on PATH." >&2
6967
exit 1
@@ -73,11 +71,11 @@ done
7371
missing_environment=0
7472
for variable_name in \
7573
APPLE_NOTARIZATION_ISSUER_ID \
76-
APPLE_NOTARIZATION_KEY_ID \
77-
APPLE_NOTARIZATION_KEY_P8
74+
APPLE_NOTARIZATION_AKV_KEY_NAME \
75+
AZURE_KEYVAULT_NAME
7876
do
7977
if [[ -z "${!variable_name:-}" ]]; then
80-
echo "$variable_name must be set from CI secrets before notarizing a binary." >&2
78+
echo "$variable_name must be configured before notarizing a binary." >&2
8179
missing_environment=1
8280
fi
8381
done
@@ -91,23 +89,6 @@ mkdir -p "$report_dir"
9189
notarization_temp_dir="$(mktemp -d)"
9290
trap 'rm -rf "$notarization_temp_dir" >/dev/null' EXIT
9391

94-
private_key_path="$notarization_temp_dir/AuthKey_${APPLE_NOTARIZATION_KEY_ID}.p8"
95-
if ! printf '%s' "$APPLE_NOTARIZATION_KEY_P8" | base64 --decode >"$private_key_path" 2>/dev/null; then
96-
if ! printf '%s' "$APPLE_NOTARIZATION_KEY_P8" | base64 -D >"$private_key_path" 2>/dev/null; then
97-
echo "APPLE_NOTARIZATION_KEY_P8 must be a base64-encoded .p8 private key." >&2
98-
exit 2
99-
fi
100-
fi
101-
chmod 600 "$private_key_path"
102-
103-
api_key_path="$notarization_temp_dir/app-store-connect-api-key.json"
104-
rcodesign encode-app-store-connect-api-key \
105-
--output-path "$api_key_path" \
106-
"$APPLE_NOTARIZATION_ISSUER_ID" \
107-
"$APPLE_NOTARIZATION_KEY_ID" \
108-
"$private_key_path" \
109-
>"$report_dir/encode-app-store-connect-api-key.log" 2>&1
110-
11192
binary_name="$(basename "$binary_path")"
11293
archive_path="$notarization_temp_dir/${binary_name}.zip"
11394
(
@@ -116,16 +97,15 @@ archive_path="$notarization_temp_dir/${binary_name}.zip"
11697
)
11798

11899
notarization_log="$report_dir/${binary_name}-notarization.log"
119-
rcodesign notarize \
120-
--api-key-file "$api_key_path" \
100+
python3 "$(dirname "$0")/notarize_with_akv.py" \
101+
--file "$archive_path" \
102+
--report-log "$report_dir/${binary_name}-notarization-developer-log.json" \
121103
--max-wait-seconds "$max_wait_seconds" \
122-
--wait \
123-
"$archive_path" \
124104
2>&1 | tee "$notarization_log"
125105

126106
{
127107
echo "binary_name=$binary_name"
128108
echo "max_wait_seconds=$max_wait_seconds"
129109
echo "binary_sha256=$(shasum -a 256 "$binary_path" | awk '{ print $1 }')"
130-
echo "rcodesign_notarize=completed"
110+
echo "notarization=completed"
131111
} >"$report_dir/${binary_name}-notarization-summary.txt"

.github/scripts/macos-signing/notarize_macos_dmg_with_rcodesign.sh renamed to .github/scripts/macos-signing/notarize_macos_dmg_with_akv.sh

Lines changed: 12 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
#!/usr/bin/env bash
22

3-
# Notarizes and staples a signed macOS DMG through rcodesign.
4-
#
5-
# This is the Linux-compatible notarization path for the AKV/PKCS#11 signing
6-
# flow. It records notarization inputs and logs so workflow artifacts can be
7-
# audited without exposing the App Store Connect private key.
3+
# Notarize a signed disk image and staple its ticket.
84

95
set -euo pipefail
106

117
usage() {
128
cat >&2 <<'EOF'
13-
Usage: notarize_macos_dmg_with_rcodesign.sh --dmg PATH [--report-dir PATH] [--max-wait-seconds SECONDS]
9+
Usage: notarize_macos_dmg_with_akv.sh --dmg PATH [--report-dir PATH] [--max-wait-seconds SECONDS]
1410
1511
Options:
1612
--dmg PATH Signed DMG to submit to Apple notarization.
1713
--report-dir PATH Directory for notarization logs.
18-
--max-wait-seconds SECONDS Maximum rcodesign notarization wait time.
14+
--max-wait-seconds SECONDS Maximum Apple notarization wait time.
1915
EOF
2016
}
2117

@@ -73,11 +69,11 @@ fi
7369
missing_environment=0
7470
for variable_name in \
7571
APPLE_NOTARIZATION_ISSUER_ID \
76-
APPLE_NOTARIZATION_KEY_ID \
77-
APPLE_NOTARIZATION_KEY_P8
72+
APPLE_NOTARIZATION_AKV_KEY_NAME \
73+
AZURE_KEYVAULT_NAME
7874
do
7975
if [[ -z "${!variable_name:-}" ]]; then
80-
echo "$variable_name must be set from CI secrets before notarizing a DMG." >&2
76+
echo "$variable_name must be configured before notarizing a DMG." >&2
8177
missing_environment=1
8278
fi
8379
done
@@ -88,37 +84,18 @@ fi
8884

8985
mkdir -p "$report_dir"
9086

91-
notarization_temp_dir="$(mktemp -d)"
92-
trap 'rm -rf "$notarization_temp_dir" > /dev/null' EXIT
93-
94-
private_key_path="$notarization_temp_dir/AuthKey_${APPLE_NOTARIZATION_KEY_ID}.p8"
95-
if ! printf '%s' "$APPLE_NOTARIZATION_KEY_P8" | base64 --decode > "$private_key_path" 2> /dev/null; then
96-
if ! printf '%s' "$APPLE_NOTARIZATION_KEY_P8" | base64 -D > "$private_key_path" 2> /dev/null; then
97-
echo "APPLE_NOTARIZATION_KEY_P8 must be a base64-encoded .p8 private key." >&2
98-
exit 2
99-
fi
100-
fi
101-
chmod 600 "$private_key_path"
102-
103-
api_key_path="$notarization_temp_dir/app-store-connect-api-key.json"
104-
rcodesign encode-app-store-connect-api-key \
105-
--output-path "$api_key_path" \
106-
"$APPLE_NOTARIZATION_ISSUER_ID" \
107-
"$APPLE_NOTARIZATION_KEY_ID" \
108-
"$private_key_path" \
109-
> "$report_dir/encode-app-store-connect-api-key.log" 2>&1
110-
11187
notarization_log="$report_dir/dmg-notarization.log"
112-
rcodesign notarize \
113-
--api-key-file "$api_key_path" \
88+
python3 "$(dirname "$0")/notarize_with_akv.py" \
89+
--file "$dmg_path" \
90+
--report-log "$report_dir/dmg-notarization-developer-log.json" \
11491
--max-wait-seconds "$max_wait_seconds" \
115-
--staple \
116-
"$dmg_path" \
11792
2>&1 | tee "$notarization_log"
11893

94+
rcodesign staple "$dmg_path" 2>&1 | tee -a "$notarization_log"
95+
11996
{
12097
echo "dmg_path=$dmg_path"
12198
echo "max_wait_seconds=$max_wait_seconds"
12299
echo "dmg_sha256=$(shasum -a 256 "$dmg_path" | awk '{ print $1 }')"
123-
echo "rcodesign_notarize_staple=completed"
100+
echo "notarization_staple=completed"
124101
} > "$report_dir/dmg-notarization-summary.txt"

0 commit comments

Comments
 (0)