Skip to content

Release archives ship the C API's libironruby-capi - #236

Merged
Largo merged 2 commits into
masterfrom
release-capi
Nov 19, 2026
Merged

Largo merged 2 commits into
masterfrom
release-capi

Conversation

@Largo

@Largo Largo commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

The release archives have the C API's headers but not its native shim: Util/build-capi.sh never runs in release.yml, and Ruby.csproj only ships libironruby-capi when that script has built it. Requiring any C extension from a release therefore raises a LoadError. (v4.0.5 predates the C API, but the next release would have shipped without it too.)

  • release.yml: build libironruby-capi on Linux and Windows before packaging. On Linux, build a small C extension with mkmf against the unpacked archive and call it.
  • Util/build-capi.sh: LC_ALL=C. In a UTF-8 locale, sort and comm disagreed on the order and the script stopped before linking.

Checked locally on an in-place build:

  • The smoke step, extracted from the workflow, passes.
  • ruby/spec optional/capi runs all 47 files: 1641 examples, 118 failures, 143 errors.

Context: rubyspec-stats (Largo/rubyspec-stats) uses the latest release. Its capi column can be enabled once a release ships the shim.

Summary by CodeRabbit

  • Release Improvements
    • Non-macOS release builds now compile the C API library, with Windows build tools configured as needed.
    • Linux release archives are checked for C extension compatibility using packaged headers and libraries, including basic return-value checks.

In a UTF-8 locale such as en_GB.UTF-8, sort orders the symbol lists
differently from what comm expects (`_Exit`, `StringValue`), comm stops
with "file 1 is not in sorted order", and set -e ends the build before
the shim is linked. LC_ALL=C makes both use byte order. Checked by
running the script under en_GB.UTF-8: it failed before and now links
libironruby-capi.so (710 functions, 2443 stubs).
Ruby.csproj ships libironruby-capi next to IronRuby.dll only when
Util/build-capi.sh has built it, and release.yml never ran the script:
the archives carry the C headers but no shim, so requiring any C
extension raises a LoadError. v4.0.5 predates the C API; the next
release would have shipped without it all the same.

The release job now builds the shim on Linux and Windows (the platforms
build-capi.sh supports) before packaging, and on Linux builds a small
C extension with mkmf against the unpacked archive and calls it. The
check was run locally against an in-place build: mkmf links the
extension and it returns 42 and "abab". ruby/spec's optional/capi
suite runs all 47 files on that build (1641 examples, 118 failures,
143 errors).
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The release workflow now builds the C API shim for non-macOS packages and runs a Linux-only smoke test against the packaged C API. The build script sets the locale used for symbol-list sorting and comparison.

Changes: C API release packaging

Layer / File(s) Summary
Build the C API shim
.github/workflows/release.yml, Util/build-capi.sh
Changes to Util/build-capi.sh trigger the workflow. Non-macOS package jobs build the shim; Windows jobs add MinGW directories to PATH if gcc is unavailable. The script sets LC_ALL=C before sorting and comparing symbol lists.
Test the packaged C API
.github/workflows/release.yml
A Linux-only smoke test compiles a C extension against the packaged headers and library, runs it through the unpacked archive’s ir, and checks for 42 and "abab".

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: claude, greptile-apps

Merge Risk: Minimal · up to 5a246

This change builds the C API shim before packaging and adds a Linux smoke test of the packaged archive. No concrete merge-blocking risk was found. The workflow itself has not been run end to end.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title states the main change: release archives now include the C API shim libironruby-capi. The raw summary shows the release workflow builds libironruby-capi via Util/build-capi.sh for non-macOS …
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.
Full details: Title check

Explanation

The title states the main change: release archives now include the C API shim libironruby-capi. The raw summary shows the release workflow builds libironruby-capi via Util/build-capi.sh for non-macOS package jobs and adds a Linux smoke test that builds and calls a C extension against the packaged library. The title is specific and matches the objectives, which describe the shim being missing from releases and causing LoadError. The LC_ALL=C change in build-capi.sh is a supporting fix and does not need to appear in the title.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between e2b2896 and 5a24660.

Files selected for processing: 2

  • .github/workflows/release.yml
  • Util/build-capi.sh

Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.

@coderabbitai coderabbitai Bot mentioned this pull request Nov 19, 2026
@Largo
Largo merged commit 22f2f73 into master Nov 19, 2026
15 of 17 checks passed
@Largo
Largo deleted the release-capi branch November 19, 2026 14:17
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.

1 participant