stephan-nordnes-eriksen / ruby_ship

A portable MRI Ruby environment and toolset
MIT License
118 stars 16 forks source link

Reduce size of package? #2

Open noahlh opened 10 years ago

noahlh commented 10 years ago

This is a suggestion for a longer-term feature -- it would be great if there were a way to customize which parts of this are needed for a particular distribution/installation.

For example, I'm including this with an open source OSX app I wrote, so I don't need the Windows or Linux versions (I manually removed those).

But I also don't need the entire ruby standard lib -- I wonder if there were a way to specify only the modules/clases needed (or, better yet, scan a script and determine the bare-minimum dependencies)?

Anyway -- food for thought.

stephan-nordnes-eriksen commented 10 years ago

This might be possible, but I have not looked into it. It might be possible to do this compile time. I don't really know, but there might be some compile flags you can set to reduce the size if you know which parts you want.

The other approach, as you suggest, is to figure out which parts of the std. lib you need and delete the parts you don't need, though this might be very hard to do because I imagine it to be highly dependent on the Ruby version you have.

A thing that would help out a lot is if it there was a small install script that prompted you for which versions you wanted, and then downloaded only the ones you need. I have already added it to the todo-list. To do this it would require a repo of these rubies, but I imagine it is possible to have it in a github repo and simply download from there. That way we could even prompt the version of ruby you wanted and essentially make something that is similar to RVM, but for portable rubies.

If you have the spare time to help out a bit with this project it would be much appreciated. Currently it is only me developing this, but there are a lot of work that could be done to make this a very nice product indeed.

osg-cat commented 7 years ago

One simple idea for shrinking the tarball size: build ruby without RDoc.