From 12b366aa087f3fe2b40ed251dbef461db65b6967 Mon Sep 17 00:00:00 2001 From: Ahmed Ibrahim Date: Fri, 8 May 2026 20:40:13 +0300 Subject: [PATCH] Keep Python runtime resources platform neutral Use generic resource fixture names and comments so runtime package staging can support Linux bwrap as well as Windows helpers. Co-authored-by: Codex --- sdk/python/scripts/update_sdk_artifacts.py | 6 ++-- .../test_artifact_workflow_and_binaries.py | 29 +++++++++---------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/sdk/python/scripts/update_sdk_artifacts.py b/sdk/python/scripts/update_sdk_artifacts.py index fe37cc53e3..be9a115914 100755 --- a/sdk/python/scripts/update_sdk_artifacts.py +++ b/sdk/python/scripts/update_sdk_artifacts.py @@ -239,9 +239,9 @@ def stage_python_runtime_package( out_bin.stat().st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH ) for resource_binary in resource_binaries: - # Windows sandbox support needs helper executables next to codex.exe. - # The option is generic so release workflows own the platform-specific - # list without baking Windows names into the staging script. + # Some release targets need helper executables beside the main binary + # (for example Linux bwrap or Windows sandbox helpers). Keep this + # generic so release workflows own the platform-specific list. out_resource = staged_runtime_resource_path(staging_dir, resource_binary) shutil.copy2(resource_binary, out_resource) if not _is_windows(): diff --git a/sdk/python/tests/test_artifact_workflow_and_binaries.py b/sdk/python/tests/test_artifact_workflow_and_binaries.py index fc01d4beb6..f3a3cc1dee 100644 --- a/sdk/python/tests/test_artifact_workflow_and_binaries.py +++ b/sdk/python/tests/test_artifact_workflow_and_binaries.py @@ -354,17 +354,17 @@ def test_stage_runtime_release_can_pin_wheel_platform_tag(tmp_path: Path) -> Non def test_stage_runtime_release_copies_resource_binaries(tmp_path: Path) -> None: script = _load_update_script_module() fake_binary = tmp_path / script.runtime_binary_name() - command_runner = tmp_path / "codex-command-runner.exe" - setup = tmp_path / "codex-windows-sandbox-setup.exe" + helper = tmp_path / "helper" + fallback = tmp_path / "fallback-helper" fake_binary.write_text("fake codex\n") - command_runner.write_text("fake command runner\n") - setup.write_text("fake setup\n") + helper.write_text("fake helper\n") + fallback.write_text("fake fallback\n") staged = script.stage_python_runtime_package( tmp_path / "runtime-stage", "1.2.3", fake_binary, - resource_binaries=(command_runner, setup), + resource_binaries=(helper, fallback), ) assert { @@ -374,8 +374,8 @@ def test_stage_runtime_release_copies_resource_binaries(tmp_path: Path) -> None: for path in (staged / "src" / "codex_cli_bin" / "bin").iterdir() } == { script.runtime_binary_name(): "fake codex\n", - "codex-command-runner.exe": "fake command runner\n", - "codex-windows-sandbox-setup.exe": "fake setup\n", + "fallback-helper": "fake fallback\n", + "helper": "fake helper\n", } @@ -506,11 +506,11 @@ def test_stage_sdk_rejects_mismatched_legacy_versions(tmp_path: Path) -> None: def test_stage_runtime_stages_binary_without_type_generation(tmp_path: Path) -> None: script = _load_update_script_module() fake_binary = tmp_path / script.runtime_binary_name() - command_runner = tmp_path / "codex-command-runner.exe" - setup = tmp_path / "codex-windows-sandbox-setup.exe" + helper = tmp_path / "helper" + fallback = tmp_path / "fallback-helper" fake_binary.write_text("fake codex\n") - command_runner.write_text("fake command runner\n") - setup.write_text("fake setup\n") + helper.write_text("fake helper\n") + fallback.write_text("fake fallback\n") calls: list[str] = [] args = script.parse_args( [ @@ -522,9 +522,9 @@ def test_stage_runtime_stages_binary_without_type_generation(tmp_path: Path) -> "--platform-tag", "musllinux_1_1_x86_64", "--resource-binary", - str(command_runner), + str(helper), "--resource-binary", - str(setup), + str(fallback), ] ) @@ -560,8 +560,7 @@ def test_stage_runtime_stages_binary_without_type_generation(tmp_path: Path) -> script.run_command(args, ops) assert calls == [ - "stage_runtime:0.116.0a1:musllinux_1_1_x86_64:" - "codex-command-runner.exe,codex-windows-sandbox-setup.exe" + "stage_runtime:0.116.0a1:musllinux_1_1_x86_64:helper,fallback-helper" ]