Skip to content

fix release build version stamping and smoke runtime install - #868

Merged
i386 merged 1 commit into
Mesh-LLM:mainfrom
i386:codex/fix-release-build-version-smoke
Jun 18, 2026
Merged

fix release build version stamping and smoke runtime install#868
i386 merged 1 commit into
Mesh-LLM:mainfrom
i386:codex/fix-release-build-version-smoke

Conversation

@i386

@i386 i386 commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fix the release failures exposed by the workflow-dispatch release run:

  • release-profile build scripts now stamp MESH_LLM_BUILD_VERSION to the plain Cargo package version instead of deriving +g<sha>[.dirty] metadata
  • CI smoke native-runtime setup now installs the freshly built runtime bundle directly into the native-runtime cache layout instead of invoking mesh-llm runtime install

Root Cause

PR #831 introduced separate build/display identity and release identity, but the release build scripts still derived SHA-bearing build versions. In workflow_dispatch release jobs, scripts/release-version.sh mutates tracked manifests before the build, so Windows release binaries reported versions like 0.72.0-rc2+g7E9D61.dirty; package-release.ps1 correctly rejected those artifacts because release bundles must report 0.72.0-rc2 exactly.

The smoke failure was separate: scripts/ci-install-native-runtime.sh used the just-built mesh-llm binary to run runtime install. That command runs inside the binary's Tokio runtime and tripped the nested-runtime guard before inference could start.

Validation

  • bash -n scripts/build-release.sh scripts/build-linux.sh scripts/ci-install-native-runtime.sh
  • zsh -n scripts/build-mac.sh
  • git diff --check
  • cargo run -p xtask -- repo-consistency release-targets
  • local fixture check that the CI native-runtime installer writes cache/<mesh_version>/<runtime_id>/manifest.json and the runtime library

Summary by CodeRabbit

  • Chores
    • Release builds now generate simplified version numbers without build-specific identifiers, providing cleaner and more predictable version strings.
    • Build system has been optimized across all supported platforms for consistent release behavior.
    • Runtime installation mechanism has been refactored for improved efficiency and maintainability.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Four platform build scripts (build-linux.sh, build-mac.sh, build-release.sh, build-windows.ps1) add an early-return guard to their version-stamp functions that sets MESH_LLM_BUILD_VERSION to the plain Cargo-derived version for release builds, bypassing git SHA and dirty-state suffix logic. ci-install-native-runtime.sh replaces a mesh-llm runtime install binary invocation with an inline Python script that validates manifest.json, checks library files, and copies the bundle into a computed cache path.

Changes

Release Profile Version Stamping

Layer / File(s) Summary
Early-return for release profile in all build scripts
scripts/build-release.sh, scripts/build-linux.sh, scripts/build-mac.sh, scripts/build-windows.ps1
Each script's version-stamp function gains an early-return branch: when the build profile is release, MESH_LLM_BUILD_VERSION is set to the Cargo-derived release_version and the function exits, skipping git rev-parse, git status probing, SHA uppercasing, and .dirty suffix appending. build-release.sh also removes the 18 lines of now-unused git derivation code.

CI Native Runtime Installer Replacement

Layer / File(s) Summary
Inline Python installer replaces mesh-llm binary invocation
scripts/ci-install-native-runtime.sh
The script drops the mesh-llm runtime install --bundle-dir --cache-dir command and substitutes a 35-line inline Python script that reads manifest.json, validates runtime.id, runtime.mesh_version, and library file paths, computes the cache destination as $RUNTIME_CACHE/<mesh_version>/<runtime_id>, removes any pre-existing destination, and copies the runtime bundle into place.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • ndizazzo
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the two main changes: fixing release build version stamping and fixing the smoke runtime install process.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@i386 i386 changed the title [codex] fix release build version stamping and smoke runtime install fix release build version stamping and smoke runtime install Jun 18, 2026
@i386
i386 marked this pull request as ready for review June 18, 2026 01:39
@github-actions
github-actions Bot requested a review from ndizazzo June 18, 2026 01:39

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/ci-install-native-runtime.sh`:
- Line 42: The mesh_version assignment on line 42 currently defaults to
"unknown" when the value is missing from the runtime dictionary, which masks
manifest contract breaks and causes incorrect cache directory usage. Remove the
fallback to "unknown" and instead raise an error or exception immediately when
mesh_version is not found in the runtime object, so the CI fails at the root
cause rather than silently continuing with an invalid version identifier.
- Around line 51-54: The validation loop for libraries in the native runtime
bundle currently only checks if a library file exists, but does not verify that
the resolved path stays within the intended bundle root directory. This allows
absolute paths or parent directory traversal (like `..`) to potentially
reference files outside the bundle. Modify the validation in the for loop to
first resolve the library_path to its absolute canonical form, then verify that
the resolved path is within the source directory before checking if the file
exists. If the resolved path escapes the bundle root, raise a SystemExit error
indicating that the library path is outside the allowed bundle directory.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0b849935-72da-4caa-802b-f6832c8339e3

📥 Commits

Reviewing files that changed from the base of the PR and between 9de1fc6 and f74e1b4.

📒 Files selected for processing (5)
  • scripts/build-linux.sh
  • scripts/build-mac.sh
  • scripts/build-release.sh
  • scripts/build-windows.ps1
  • scripts/ci-install-native-runtime.sh


runtime = manifest["runtime"]
runtime_id = runtime["id"]
mesh_version = runtime.get("mesh_version") or "unknown"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Fail fast when mesh_version is missing instead of defaulting to "unknown"

On Line 42, falling back to "unknown" hides manifest contract breaks and can install into the wrong cache subtree (<cache>/unknown/<runtime_id>). This should error immediately so CI fails at root cause.

Proposed fix
-mesh_version = runtime.get("mesh_version") or "unknown"
+mesh_version = runtime.get("mesh_version")
+if mesh_version is None:
+    raise SystemExit(f"native runtime mesh_version is missing in {manifest_path}")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/ci-install-native-runtime.sh` at line 42, The mesh_version assignment
on line 42 currently defaults to "unknown" when the value is missing from the
runtime dictionary, which masks manifest contract breaks and causes incorrect
cache directory usage. Remove the fallback to "unknown" and instead raise an
error or exception immediately when mesh_version is not found in the runtime
object, so the CI fails at the root cause rather than silently continuing with
an invalid version identifier.

Comment on lines +51 to +54
for library in libraries:
library_path = source / library
if not library_path.is_file():
raise SystemExit(f"native runtime library is missing: {library_path}")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Constrain library paths to stay within the runtime bundle root

On Lines 51-54, source / library allows absolute paths and parent traversal (..) to pass validation if those external files exist. That weakens the manifest integrity check for the bundle itself.

Proposed fix
 for library in libraries:
-    library_path = source / library
-    if not library_path.is_file():
+    library_path = (source / library).resolve()
+    if source.resolve() not in library_path.parents:
+        raise SystemExit(f"native runtime library escapes bundle root: {library}")
+    if not library_path.is_file():
         raise SystemExit(f"native runtime library is missing: {library_path}")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
for library in libraries:
library_path = source / library
if not library_path.is_file():
raise SystemExit(f"native runtime library is missing: {library_path}")
for library in libraries:
library_path = (source / library).resolve()
if source.resolve() not in library_path.parents:
raise SystemExit(f"native runtime library escapes bundle root: {library}")
if not library_path.is_file():
raise SystemExit(f"native runtime library is missing: {library_path}")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/ci-install-native-runtime.sh` around lines 51 - 54, The validation
loop for libraries in the native runtime bundle currently only checks if a
library file exists, but does not verify that the resolved path stays within the
intended bundle root directory. This allows absolute paths or parent directory
traversal (like `..`) to potentially reference files outside the bundle. Modify
the validation in the for loop to first resolve the library_path to its absolute
canonical form, then verify that the resolved path is within the source
directory before checking if the file exists. If the resolved path escapes the
bundle root, raise a SystemExit error indicating that the library path is
outside the allowed bundle directory.

@i386
i386 merged commit 45f2edf into Mesh-LLM:main Jun 18, 2026
43 of 65 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants