Skip to content

Add fake ruby-build wrapper for jdx/ruby#1112

Merged
trunk-io[bot] merged 1 commit into
mainfrom
add-ruby-build-tarball
Jun 4, 2026
Merged

Add fake ruby-build wrapper for jdx/ruby#1112
trunk-io[bot] merged 1 commit into
mainfrom
add-ruby-build-tarball

Conversation

@dfrankland
Copy link
Copy Markdown
Member

@dfrankland dfrankland commented Jun 3, 2026

Summary

Trunk's ruby runtime installer works by downloading a copy of ruby-build and calling:

bin/ruby-build <version> <install-path>

This compiles Ruby from source, which is slow and requires a full build toolchain.

This PR adds .trunk/ruby-build.tar.gz — a tarball containing a fake bin/ruby-build script that intercepts that call and downloads a prebuilt, portable Ruby binary from mise (via the jdx/ruby releases) instead of compiling from source. This means Ruby installs in seconds rather than minutes, with no compiler required.

The script:

#!/bin/bash
set -euo pipefail
VERSION=$1
INSTALL_PATH=$2
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
ARCH=$(uname -m)

mkdir -p "$INSTALL_PATH"

if [ "$OS" = "darwin" ]; then
  URL="https://github.com/jdx/ruby/releases/download/${VERSION}/ruby-${VERSION}.macos.tar.gz"
elif [ "$ARCH" = "x86_64" ]; then
  URL="https://github.com/jdx/ruby/releases/download/${VERSION}/ruby-${VERSION}.x86_64_linux.tar.gz"
else
  URL="https://github.com/jdx/ruby/releases/download/${VERSION}/ruby-${VERSION}.arm64_linux.tar.gz"
fi

curl -fsSL "$URL" | tar -xz --strip-components=1 -C "$INSTALL_PATH"

The tarball is referenced by the trunk.yaml changes in the follow-up PR #1113.

Test plan

  • trunk tools install --verbose shows ruby 4.0.5 installed successfully
  • ~/.cache/trunk/tools/ruby/4.0.5/bin/ruby exists after install

🤖 Generated with Claude Code

Trunk's ruby runtime installer downloads ruby-build and calls
bin/ruby-build <version> <install-path> to compile Ruby from source.
This tarball provides a drop-in replacement that instead downloads a
pre-built Ruby binary from jdx/ruby.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented Jun 3, 2026

😎 Merged successfully - details.

@trunk-staging-io
Copy link
Copy Markdown

trunk-staging-io Bot commented Jun 3, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

Failed Test Failure Summary Logs
variant_quarantine_test should be quarantined when run with variant A test expected the sum of 2 + 2 to be 5, but it was actually 4, indicating a failing assertion. Logs ↗︎

View Full Report ↗︎Docs

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jun 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.37%. Comparing base (f584ee0) to head (9d48fd7).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1112      +/-   ##
==========================================
+ Coverage   82.12%   82.37%   +0.24%     
==========================================
  Files          69       69              
  Lines       15243    15243              
==========================================
+ Hits        12519    12556      +37     
+ Misses       2724     2687      -37     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@trunk-io
Copy link
Copy Markdown

trunk-io Bot commented Jun 3, 2026

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@trunk-io trunk-io Bot merged commit 9ed5b45 into main Jun 4, 2026
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants