Normalize rusty_v8 checksum manifest line endings (#36797)

## What changed

- Write staged `rusty_v8` checksum manifests with LF line endings on every platform.
- Strip carriage returns when verifying manifests so existing Windows-built releases with CRLF line endings remain usable.

## Testing

- Assert that staged checksum manifests contain no carriage returns.

GitOrigin-RevId: 142855c147a08a60f5e5782c61e2fcd6b2e350d6
This commit is contained in:
Adam Perry @ OpenAI
2026-08-03 20:32:51 +00:00
committed by copyberry
parent bd12b3a9ec
commit 51d4aa946c
3 changed files with 9 additions and 3 deletions

View File

@@ -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}"

View File

@@ -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:

View File

@@ -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(