Closed maxirmx closed 2 years ago
@maxirmx Will a structure like this work?
It will work. However as far as I understood glibc redirection (as in retrace) requires dynamic linking (shared library) You will have to distribute a package that includes several files
What we have as of Sept 25th 2021:
We have it because the project started with https://github.com/tamatebako/tebako/issues/2
This will be "organic" change from using libdwarfs with FUSE wrapper towards using libdwarfs with out new wrapper
@ronaldtse we already have libdwarfs as explained above. This new libray will be libdwarfs wrapper that will provide inode <-> fd description. I believe it requires some other name. In ruby packer they just copy-paste files from squashFS but I do no believe it makes any sence.
Also the idea with glibc redirector contradicts your requirement to have statically lined single binary. Both requirement can be met but not together.
the idea with glibc redirector contradicts your requirement to have statically lined single binary. Both requirement can be met but not together.
I understand the potential contradiction. The goal is to have a single binary wrapping that allows a Ruby program with its dependencies to run, so it's not really about static / dynamic. If a dynamically compiled Ruby is linked with other dependencies wrapped within a Tebako package, to the user they are self-contained and hence achieving what we need.
What we have as of Sept 25th 2021: We have it because the project started with tamatebako/tebako#2
My only concern is that it requires the FUSE kernel module to be loaded, by default Linux and Macs don't have that enabled. So it's just the next step to also move that portion into user-space.
I understand the potential contradiction. The goal is to have a single binary wrapping that allows a Ruby program with its dependencies to run, so it's not really about static / dynamic. If a dynamically compiled Ruby is linked with other dependencies wrapped within a Tebako package, to the user they are self-contained and hence achieving what we need.
To access dwarFS image ruby needs glibc shared library that you want to place inside dwarFS image. This does not seem possible
My only concern is that it requires the FUSE kernel module to be loaded, by default Linux and Macs don't have that enabled. So it's just the next step to also move that portion into user-space.
It is possible to eliminate FUSE dependency. I can patch ruby in the same way ruby-packer does. (Actually I believe I know how to achieve much better packager performance)
Patching the Ruby interpreter is acceptable.
Right now we already have a reasonable way of getting things working by:
I was wondering whether we can "insert" a layer between the Ruby interpreter and its file reading functions.
I was wondering whether we can "insert" a layer between the Ruby interpreter and its file reading functions.
We will. It is called "ANewLibrary" in my diagram. The difference we are discussing is the following:
with glibc module we would be patching glibc.so (binary, dynamically linked) with ANewLibrary we will patch ruby interpreter source so that it will call "ANewLibrary" (statically linked)
What are the considerations for better / more extensible for the future?
What are the considerations for better / more extensible for the future?
No opinion yet. Both involve some unconventional patching. Anyway I have to start with a library that wraps existing libdwarfs and provides different interface. Ruby or glibc patching is the next step. The wrapper is the same.
The list of C functions that shall be supported for Ruby packaging: #3
Issues to be resolved in order to apply libdwarfs for tebako ruby packager