Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split out Ruby to another repository / Tebako image #48

Open
ronaldtse opened this issue Dec 13, 2021 · 2 comments
Open

Split out Ruby to another repository / Tebako image #48

ronaldtse opened this issue Dec 13, 2021 · 2 comments
Assignees

Comments

@ronaldtse
Copy link
Contributor

We should split out the Ruby that is compiled for Tebako usage into a separate repository. And we should have it pre-built so people who use Tebako can just "download the appropriate compiled Ruby archive" and incorporate into their Tebako image.

@maxirmx
Copy link
Member

maxirmx commented Dec 13, 2021

It works the opposite way. Tebako image is incorporated into Ruby binary.
So it is not possible to 'download Ruby', you have to build it during packaging.

@maxirmx
Copy link
Member

maxirmx commented Dec 17, 2021

We have tebako ruby that is patched as follows:

  1. Calls to certain OS io functions are replaced with calls to libdwarfs. Using c #define directives
  2. In main function command line parameters are adjusted so that Ruby 'thinks' that it has been called to execute tebako-packaged application entry point script
  3. Ruby build scripts are adjusted to refer to libdwarfs and to include cpp file that embeds tebako image
  4. Ruby build scripts are adjusted to refer to as little shared libraries as possible

We have:

  1. Tebako Ruby source code
  2. Tebako Ruby build scripts
  3. libdwarfs_wr, libdwarfs and a set of other libraries
  4. Cpp file with embedded tebako image. I create a library out of it but it is just to simplify item 2.

The process then runs as follows:

  • Ruby code is compiled on tebako setup
  • On tebako press just a couple of files are compiled. However, if I link Ruby binary, build script executes full setup sequence for all native extensions. It implies complex bootstrap procedure that includes linking libruby.a, linking miniruby, extension configuration and rebuild, linking ruby, extension setup, linking ruby once again. This is the way ruby build script works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants