Skip to content

Validate the Linux glibc floor in runtime manifests - #33

Open
ndizazzo wants to merge 1 commit into
feat/upstream-archive-license-allowlistfrom
feat/validate-runtime-min-glibc
Open

ndizazzo wants to merge 1 commit into
feat/upstream-archive-license-allowlistfrom
feat/validate-runtime-min-glibc

Conversation

@ndizazzo

Copy link
Copy Markdown
Contributor

Stacked on #30, which adds the runtime-manifest parser this reuses. Review #30 first; this diff is only the second commit.

Why

Upstream 325e4bc added runtime.platform.min_glibc so a host can refuse a Linux runtime its glibc cannot load. Packaging copies the runtime manifest through unchanged and never looked at the field, so a malformed or wrongly-attached floor would ship.

Worth knowing how sharp the upstream edge is. has_startup_compatibility_metadata (resolver.rs:404) treats a Linux runtime with no min_glibc as ineligible, and native_runtime.rs:609 logs "Skipping locally installed Linux native runtime without platform.min_glibc metadata; reinstall or repackage it before startup". A package whose runtime lacks the field, installed next to a host that has the check, has no usable runtime at all.

What changed

Extraction rejects a min_glibc that is not a major.minor version or that is attached to a non-Linux runtime, matching upstream's parse_glibc_version and its non-Linux bail. The declared floor lands in upstream-provenance.json as runtime_min_glibc, so release evidence carries it.

Why absence is safe

The field stays optional, and that isn't a compromise. Host and runtime always travel together in one product bundle, so a runtime predating the field is always paired with a host predating the check that would skip it. The mismatch that bites can't be produced by this pipeline. Releases through v0.76.2 verify exactly as before.

What this deliberately does not do

It does not re-derive the floor from ELF headers. Upstream's verify_linux_min_glibc_consistency already does that with readelf and refuses to publish a misleading floor, and the runtime manifest is digest-bound to that verified producer before we read it. Recomputing here would duplicate the producer rather than check it, and would need readelf in the packaging container.

QA

tests/upstream-archive.test.ts, 17/17:

  • a declared 2.35 floor is accepted and surfaces in provenance
  • 2.35.1, 2, "", two.35, the number 2.35, and true are all rejected
  • a 2.35 floor on a macos runtime is rejected
  • all three shapes a pre-field release can take verify clean: no platform block, a platform block without the key, and an explicit null

Full suite 168/171; the 2 workflow-provenance failures reproduce on unmodified origin/main on macOS and were green on ubuntu CI in #30, #31, and #32.

Note for review

The provenance object gains a key. release-evidence.ts copies the file opaquely and the workflow's jq -e checks named fields rather than an exact key set, so nothing downstream needed changing, but that's the thing worth a second pair of eyes.

Upstream 325e4bc added runtime.platform.min_glibc so a host can refuse
a Linux runtime its glibc cannot load. Packaging copied the runtime
manifest through unchanged and never looked at the field, so a
malformed or wrongly-attached floor would ship.

Reject a min_glibc that is not a major.minor version or that is
attached to a non-Linux runtime, and record the declared floor in
upstream-provenance.json as runtime_min_glibc.

The field stays optional. Absence makes no claim, and host and runtime
always travel together in one product bundle, so a runtime predating
the field is always paired with a host predating the check that would
skip it. Releases through v0.76.2 verify exactly as before.

Packaging does not re-derive the floor from ELF headers.
verify_linux_min_glibc_consistency upstream owns that, and the runtime
manifest is already digest-bound to the verified producer, so
recomputing it here would duplicate the producer rather than check it.
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: da216229-4ee2-4e32-99cf-d4217bee4660

📥 Commits

Reviewing files that changed from the base of the PR and between e5cb84c and d828cd0.

📒 Files selected for processing (4)
  • TODO.md
  • docs/native-packages.md
  • scripts/upstream-archive.ts
  • tests/upstream-archive.test.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@ndizazzo
ndizazzo marked this pull request as ready for review September 16, 2026 22:44
@ndizazzo

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.


Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 59 minutes.

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