Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Normalize rusty_v8 checksum manifest line endings (#36797)

Adam Perry @ OpenAI51d4aa946ca3
diff --git a/.github/actions/setup-rusty-v8/action.yml b/.github/actions/setup-rusty-v8/action.yml
index 9f0ffa2103..449ab653fd 100644
--- a/.github/actions/setup-rusty-v8/action.yml
+++ b/.github/actions/setup-rusty-v8/action.yml
@@ -44,10 +44,11 @@ runs:
exit 1
fi
+ # Existing Windows-built release manifests use CRLF line endings.
if command -v sha256sum >/dev/null 2>&1; then
- (cd "${binding_dir}" && sha256sum -c "${checksums_path}")
+ (cd "${binding_dir}" && tr -d '\r' < "${checksums_path}" | sha256sum -c -)
else
- (cd "${binding_dir}" && shasum -a 256 -c "${checksums_path}")
+ (cd "${binding_dir}" && tr -d '\r' < "${checksums_path}" | shasum -a 256 -c -)
fi
echo "RUSTY_V8_ARCHIVE=${archive_path}" >> "${GITHUB_ENV}"
echo "RUSTY_V8_SRC_BINDING_PATH=${binding_path}" >> "${GITHUB_ENV}"
diff --git a/.github/scripts/rusty_v8_bazel.py b/.github/scripts/rusty_v8_bazel.py
index 93360edfbf..6150aff5af 100644
--- a/.github/scripts/rusty_v8_bazel.py
+++ b/.github/scripts/rusty_v8_bazel.py
@@ -245,7 +245,7 @@ def stage_artifacts(
shutil.copyfile(binding_path, staged_binding)
staged_checksums = output_dir / staged_checksums_name(target, artifact_profile)
- with staged_checksums.open("w", encoding="utf-8") as checksums:
+ with staged_checksums.open("w", encoding="utf-8", newline="\n") as checksums:
for path in [staged_library, staged_binding]:
digest = hashlib.sha256()
with path.open("rb") as artifact:
diff --git a/.github/scripts/test_rusty_v8_bazel.py b/.github/scripts/test_rusty_v8_bazel.py
index b90121bb43..47cf2f16a5 100644
--- a/.github/scripts/test_rusty_v8_bazel.py
+++ b/.github/scripts/test_rusty_v8_bazel.py
@@ -191,6 +191,11 @@ class RustyV8BazelTest(unittest.TestCase):
},
{path.name for path in Path(output_dir).iterdir()},
)
+ checksums = (
+ Path(output_dir)
+ / "rusty_v8_ptrcomp_sandbox_release_aarch64-apple-darwin.sha256"
+ ).read_bytes()
+ self.assertNotIn(b"\r", checksums)
def test_upstream_release_pair_paths(self) -> None:
self.assertEqual(