Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Investigate using --target-rbconfig when cross compiling gems #884

Closed
joshcooper opened this issue Aug 1, 2024 · 2 comments
Closed

Investigate using --target-rbconfig when cross compiling gems #884

joshcooper opened this issue Aug 1, 2024 · 2 comments
Labels
accepted Valid issue that we intend to work on when we have the bandwidth enhancement New feature or request triaged Jira issue has been created for this

Comments

@joshcooper
Copy link
Contributor

joshcooper commented Aug 1, 2024

Use Case

In order to cross-compile gems with native extensions, like ffi, the top-level RbConfig constant must be modified to pretend to the target ruby architecture. To accomplish this, we patch the host ruby, however, this is fragile because the rubygems code keeps changing how it invokes the gem command. As a result we've shipped gems with unusable native extensions multiple times. I fixed this is 58560cc but it doesn't support rubygems > 3.5.10

Describe the Solution You Would Like

Ruby's mkmf introduced a --target-rbconfig option to satisfy this use case, see https://bugs.ruby-lang.org/issues/20345. Also the gem install and gem update commands recently added support for the --target-rbconfig option. In theory, this means we could eliminate patch-hostruby and instead do gem install --target-rbconfig fake.rb nokogiri. However, you'd need to use the latest ruby/rubygems to take advantage of the option.

@joshcooper joshcooper added the enhancement New feature or request label Aug 1, 2024
@AriaXLi AriaXLi added the accepted Valid issue that we intend to work on when we have the bandwidth label Aug 6, 2024
@AriaXLi AriaXLi added the triaged Jira issue has been created for this label Jan 9, 2025
Copy link

github-actions bot commented Jan 9, 2025

Migrated issue to PA-7282

@AriaXLi
Copy link
Contributor

AriaXLi commented Jan 9, 2025

Closing this issue because puppet-runtime is being archived (see OSPTE-212)

@AriaXLi AriaXLi closed this as completed Jan 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted Valid issue that we intend to work on when we have the bandwidth enhancement New feature or request triaged Jira issue has been created for this
Projects
None yet
Development

No branches or pull requests

2 participants