Skip to content

A self-improving RLM agent for coding workflows and long-running autonomous tasks.

Rust

fix stable release source packaging checks (#3446)

kt763094e1b6a7
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 9fe27944f5..d69d3a8167 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -139,6 +139,10 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
+ - name: Trust the mounted checkout for release packaging
+ # checkout scopes its safe.directory setting to a temporary HOME.
+ # Later container steps need the same exact path in their own config.
+ run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
# The pinned SHA is the toolchain pin: this action version has no
# `toolchain` input, and its parse step hard-codes 1.98.1. Change the
# compiler by changing the SHA; a `toolchain:` input is ignored.
@@ -693,7 +697,13 @@ jobs:
- name: Verify historical native updater compatibility
run: |
set -euo pipefail
- python3 verification-source/scripts/release/native_compat.py incoming/*/prime-agent-*.tar.gz
+ archives=()
+ for archive in incoming/*/prime-agent-*.tar.gz; do
+ # Source distributions are build inputs, not runnable payloads.
+ case "$archive" in *-src.tar.gz) continue ;; esac
+ archives+=("$archive")
+ done
+ python3 verification-source/scripts/release/native_compat.py "${archives[@]}"
- name: Verify Linux decoder integrity against installed tar ELF
run: |
set -euo pipefail
diff --git a/scripts/release/test_native_compat.py b/scripts/release/test_native_compat.py
index 7f05046834..18d4632718 100644
--- a/scripts/release/test_native_compat.py
+++ b/scripts/release/test_native_compat.py
@@ -3,6 +3,9 @@
import argparse
import json
+import shutil
+import subprocess
+import tarfile
import tempfile
import unittest
from pathlib import Path
@@ -79,6 +82,36 @@ class NativeCompatibilityTests(unittest.TestCase):
self.assertTrue((staging / "prime-agent.exe").is_file())
self.assertFalse((staging / "photon_rs_bg.wasm").exists())
+ def test_promotion_validates_native_archives_beside_source_distribution(self):
+ _, archive, _ = self.assemble()
+ repo = Path(__file__).resolve().parents[2]
+ workflow = (repo / ".github/workflows/release.yml").read_text()
+ step = workflow.split(
+ " - name: Verify historical native updater compatibility\n", 1
+ )[1].split(" - name:", 1)[0]
+ script = "\n".join(
+ line[10:] for line in step.split(" run: |\n", 1)[1].splitlines()
+ )
+ native = self.root / "incoming/artifacts-native"
+ source = self.root / "incoming/artifacts-source"
+ native.mkdir(parents=True)
+ source.mkdir()
+ shutil.copyfile(archive, native / "prime-agent-1.0.0-darwin-arm64.tar.gz")
+ source_archive = source / "prime-agent-1.0.0-src.tar.gz"
+ with tarfile.open(source_archive, "w:gz") as tar:
+ tar.add(self.root / "README.md", arcname="README.md")
+ with self.assertRaisesRegex(ValueError, "missing regular compatibility asset"):
+ validate_compatibility_archive(source_archive)
+ verification = self.root / "verification-source/scripts"
+ verification.mkdir(parents=True)
+ (verification / "release").symlink_to(repo / "scripts/release", target_is_directory=True)
+ result = subprocess.run(
+ ["bash", "-c", script], cwd=self.root, capture_output=True, text=True
+ )
+ self.assertEqual(result.returncode, 0, result.stderr)
+ self.assertIn("Native compatibility verified:", result.stdout)
+ self.assertNotIn("src.tar.gz", result.stdout)
+
if __name__ == "__main__":
unittest.main()