Skip to content

Disable Ruby 4.0.4 install-time docs for ruby-build installs#127

Draft
Copilot wants to merge 4 commits into
automated/ruby-versions-20260512-010938from
copilot/fix-test-failures-doc-option
Draft

Disable Ruby 4.0.4 install-time docs for ruby-build installs#127
Copilot wants to merge 4 commits into
automated/ruby-versions-20260512-010938from
copilot/fix-test-failures-doc-option

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 13, 2026

Ruby 4.0.4 installs started failing in the Ruby feature due to an upstream regression during install-time documentation generation. This change makes both supported install paths skip doc generation only for Ruby 4.0.4 so the feature can provision the affected version reliably without changing other Ruby install flows.

  • What changed

    • Pass RUBY_CONFIGURE_OPTS='--disable-install-doc' when installing Ruby 4.0.4 through mise
    • Pass the same option when installing Ruby 4.0.4 through rbenv
    • Leave other Ruby versions on their existing install commands unchanged
  • Why this is scoped correctly

    • The failure being worked around is specific to Ruby 4.0.4
    • Both mise and rbenv flow through ruby-build, so both paths need the same version-specific guardrail
  • Result

    • Avoids triggering install-time RubyGems/RDoc doc generation for affected Ruby 4.0.4 builds
    • Preserves the current feature contract for other Ruby versions while narrowing the workaround to the affected install step
if [ "$VERSION" = "4.0.4" ]; then
  RUBY_CONFIGURE_OPTS='--disable-install-doc' /usr/local/share/rbenv/bin/rbenv install "$VERSION"
else
  /usr/local/share/rbenv/bin/rbenv install "$VERSION"
fi

if [ "$VERSION" = "4.0.4" ]; then
  RUBY_CONFIGURE_OPTS='--disable-install-doc' "$HOME/.local/bin/mise" install "ruby@$VERSION"
else
  "$HOME/.local/bin/mise" install "ruby@$VERSION"
fi

Copilot AI and others added 2 commits May 12, 2026 22:48
Agent-Logs-Url: https://github.com/rails/devcontainer/sessions/1837d2fa-6c84-4e73-b77b-e98819020a0e

Co-authored-by: rafaelfranca <47848+rafaelfranca@users.noreply.github.com>
Agent-Logs-Url: https://github.com/rails/devcontainer/sessions/1837d2fa-6c84-4e73-b77b-e98819020a0e

Co-authored-by: rafaelfranca <47848+rafaelfranca@users.noreply.github.com>
@rafaelfranca
Copy link
Copy Markdown
Member

@copilot does using this option cause miss to not use the precompiled versions?

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 13, 2026

@copilot does using this option cause miss to not use the precompiled versions?

No — not in the precompiled path. In cef2bc6, RUBY_CONFIGURE_OPTS is only relevant if ruby-build actually runs ./configure/make. The with_precompiled_rubies scenario still passed in CI on this branch, and its log shows mise downloading and extracting ruby-4.0.4.x86_64_linux.tar.gz, so it was still using the precompiled artifact.

Copilot AI requested a review from rafaelfranca May 13, 2026 07:50
@rafaelfranca
Copy link
Copy Markdown
Member

@copilot can we only use the disable-doc option the the Ruby version is 4.0.4?

Agent-Logs-Url: https://github.com/rails/devcontainer/sessions/599a0756-c64a-4e66-9b09-97bf987809a4

Co-authored-by: rafaelfranca <47848+rafaelfranca@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 13, 2026

@copilot can we only use the disable-doc option the the Ruby version is 4.0.4?

Done in 19f5c8d. The disable-doc flag is now only applied when the requested Ruby version is 4.0.4; other versions keep the previous install command in both the mise and rbenv paths.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • containers.dev
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/devcontainer/devcontainer/node_modules/.bin/devcontainer features test -f ruby --skip-autogenerated --skip-duplicated . (dns block)
  • mise.run
    • Triggering command: /usr/bin/curl curl REDACTED (dns block)
  • westus.data.mcr.microsoft.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/devcontainer/devcontainer/node_modules/.bin/devcontainer features test -f ruby --skip-autogenerated --skip-duplicated . (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Disable Ruby install-time docs for ruby-build installs Disable Ruby 4.0.4 install-time docs for ruby-build installs May 13, 2026
@rafaelfranca
Copy link
Copy Markdown
Member

@copilot improve your changes. There is too much duplication in your code

Agent-Logs-Url: https://github.com/rails/devcontainer/sessions/07591f78-fd4c-459b-a3dc-6bbed5e8fe5c

Co-authored-by: rafaelfranca <47848+rafaelfranca@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 13, 2026

@copilot improve your changes. There is too much duplication in your code

Done in fe3dd40. I factored the Ruby 4.0.4-specific install logic into a shared helper so the mise and rbenv paths no longer duplicate the conditional workaround.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • containers.dev
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/devcontainer/devcontainer/node_modules/.bin/devcontainer features test -f ruby --skip-autogenerated --skip-duplicated . (dns block)
  • eastus.data.mcr.microsoft.com
    • Triggering command: /home/REDACTED/work/_temp/ghcca-node/node/bin/node node /home/REDACTED/work/devcontainer/devcontainer/node_modules/.bin/devcontainer features test -f ruby --skip-autogenerated --skip-duplicated . (dns block)
  • mise.run
    • Triggering command: /usr/bin/curl curl REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR scopes a workaround for a Ruby 4.0.4 ruby-build regression by conditionally disabling install-time documentation generation during Ruby installation, while keeping all other Ruby version install behavior unchanged.

Changes:

  • Add a shared helper to run Ruby install commands under su, injecting RUBY_CONFIGURE_OPTS='--disable-install-doc' only for Ruby 4.0.4.
  • Apply the version-specific workaround to both the rbenv and mise Ruby install paths.
Comments suppressed due to low confidence (1)

features/src/ruby/install.sh:132

  • ruby@$_version is expanded into the su -c string without quoting. Because VERSION is user-controlled via feature options, this can break for unexpected values and can allow shell injection in the -c string. Wrap the version argument in quotes (e.g., pass "ruby@$_version" as done for the install command).

    run_ruby_install_command "$_user" "$_version" "$_home_dir/.local/bin/mise install \"ruby@$_version\""
    su "$_user" -c "$_home_dir/.local/bin/mise use -g ruby@$_version"
    su "$_user" -c "$_home_dir/.local/bin/mise settings add idiomatic_version_file_enable_tools ruby"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -73,11 +73,24 @@ setup_rbenv() {
}

# Function to install Ruby with rbenv
Comment on lines +93 to 95
run_ruby_install_command "$_user" "$_version" "/usr/local/share/rbenv/bin/rbenv install \"$_version\""
su "$_user" -c "/usr/local/share/rbenv/bin/rbenv global $_version"
}
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.

3 participants