Binary packages #1813
Replies: 58 comments
-
Looks like
Obviously these paths aren't going to be the same for everyone. Can we work around this? |
Beta Was this translation helpful? Give feedback.
-
Crazy idea: build Ruby with an unreasonably long
...and search-and-replace that with the actual installation location after extracting the package. We'd need to do this for the shebangs for commands like |
Beta Was this translation helpful? Give feedback.
-
Skeptical about that. Compiled constants are going to be offset by their length. So replacing the placeholder with a shorter string is probably going to fuck up the memory addresses off all the other constants after it in the data segment. |
Beta Was this translation helpful? Give feedback.
-
We'd keep the strings the same length, obviously, and just replace the rest of the space with null bytes. Proof of concept: https://gist.github.com/a95fd5e818f9237a1c9f Save as rewrite.sh and run like so:
|
Beta Was this translation helpful? Give feedback.
-
I was digging round the MacRuby source today and came across On MacRuby it is being used to replace linking to the system MacRuby with one packaged inside the executable (see MacRuby/MacRuby@master). EDIT: Also useful |
Beta Was this translation helpful? Give feedback.
-
so... what happened to this? isn't it ready to go, I remember you tweeting about this a few month ago? if not, is there anything that needs to be done? I really like the prospect to install ruby in a few seconds instead of a few minutes :) |
Beta Was this translation helpful? Give feedback.
-
Is there anything we can do to help out with this and get it finished? |
Beta Was this translation helpful? Give feedback.
-
Here is an interesting blog post: http://yehudakatz.com/2012/06/ I think Yehuda has solved that problem already! |
Beta Was this translation helpful? Give feedback.
-
is it possible by any chance to use rvm's precompiled packages? |
Beta Was this translation helpful? Give feedback.
-
When using precompiled packages ruby-build should probably build them with optimization flags ( Also, they should be also the default when compiling from source. In that case, it would be a good idea to also add |
Beta Was this translation helpful? Give feedback.
-
Any progress? It's highly desirable feature. |
Beta Was this translation helpful? Give feedback.
-
👍 Any progress? Post a gist maybe? |
Beta Was this translation helpful? Give feedback.
-
+1 Rubber (Ec2 automation) recently switched to Ruby-build (which is great!) but compiling Ruby 2.0 for each Amazon instance you spin up is something the world can really do without. |
Beta Was this translation helpful? Give feedback.
-
👍 would love to see support for this |
Beta Was this translation helpful? Give feedback.
-
+1 |
Beta Was this translation helpful? Give feedback.
-
@mconigliaro If you want to do that, you can use From the
|
Beta Was this translation helpful? Give feedback.
-
@md5 oh yeah, that's a good point. I could always just have my config management system download and unpack a set of precompiled versions to |
Beta Was this translation helpful? Give feedback.
-
Super old issue, but I just wanted to pop in and say that node-build (direct fork, minimally modified) has added support for installing precompiled binaries. nodenv/node-build@474e872 (source has been modified slightly since that PR was merged, though) We grab the system info via: platform(){
local arch="$(uname -m)"
local os="$(uname -s | tr '[:upper:]' '[:lower:]')"
case "$arch" in
x86_64 | amd64 | i686-64 ) arch=x64 ;;
i[36]86* | [ix]86pc ) arch=x86 ;;
esac
echo "${os}-${arch}"
} And a build definition looks like: binary darwin-x64 "https://nodejs.org/dist/v4.2.1/node-v4.2.1-darwin-x64.tar.gz#658686795fac9669d411ac5c5be2da8159058e386767322d8d8151dcdb4810b9"
binary linux-arm64 "https://nodejs.org/dist/v4.2.1/node-v4.2.1-linux-arm64.tar.gz#05df4aeb8a53798f8b10074600518040fc317f2919f9755aeab57b0aaf7227b0"
binary linux-armv6l "https://nodejs.org/dist/v4.2.1/node-v4.2.1-linux-armv6l.tar.gz#6f29286464efda4a362d9464d82733398b98882051c20c0f190004480b6e506a"
binary linux-armv7l "https://nodejs.org/dist/v4.2.1/node-v4.2.1-linux-armv7l.tar.gz#fb4fbef9306962e800804ab5ba615c06bba28deb4e7a3e945a291dba986ef816"
binary linux-x64 "https://nodejs.org/dist/v4.2.1/node-v4.2.1-linux-x64.tar.gz#e766e387934e17daaad92d0460ed76f756655da62b627a5c9cc07faea4a0b824"
binary linux-x86 "https://nodejs.org/dist/v4.2.1/node-v4.2.1-linux-x86.tar.gz#97b5ccea7044073c87a21bcc4b0762f4a6bd77db9cc958206f684ecdfeb89b1f"
binary sunos-x64 "https://nodejs.org/dist/v4.2.1/node-v4.2.1-sunos-x64.tar.gz#acec44790ff0069620c0fd03945d14b9f97c7ccb0a0450f766a5cbe4a906510b"
binary sunos-x86 "https://nodejs.org/dist/v4.2.1/node-v4.2.1-sunos-x86.tar.gz#d7bf8dcf353115b5e55bf64d25c2c34fa2d237e201e46dab97ae3d8e3f051583"
install_package "node-v4.2.1" "https://nodejs.org/dist/v4.2.1/node-v4.2.1.tar.gz#8861b9f4c3b4db380fcda19a710c0430c3d62d03ee176c64db63eef95a672663" How it works: The Then when It's a pretty hacky workflow, and I would love to find a more elegant solution. But it works and, I think, could be adopted for ruby-build. |
Beta Was this translation helpful? Give feedback.
-
@jasonkarns Thanks for sharing! That's an interesting approach to fetching precompiled binaries. In my opinion, it's not such a problem to make ruby-build fetch precompiled binaries as it is to make a system to package and publish precompiled binaries in the first place. |
Beta Was this translation helpful? Give feedback.
-
Travis actually has precompiled rubies: http://rubies.travis-ci.org. Edit; I believe these are build against local libraries, so are not universally usable;
|
Beta Was this translation helpful? Give feedback.
-
No progress here? Or any new ideas? |
Beta Was this translation helpful? Give feedback.
-
any update? |
Beta Was this translation helpful? Give feedback.
-
Any progress? RVM makes ruby binaries for ages and it's just fine |
Beta Was this translation helpful? Give feedback.
-
No progress yet. Anyone is welcome to pick this up! Some notes:
|
Beta Was this translation helpful? Give feedback.
-
Can we re-use http://rvm.io/binaries (cached by fastly)? Unless someone else wants to pay for the S3 traffic :-) |
Beta Was this translation helpful? Give feedback.
-
Posted this on a duplicate #1054 :
That doesn't address building the packages though. Some notes from reading through about how RVM does it:
Edit: correction, the osx patch is empty: |
Beta Was this translation helpful? Give feedback.
-
Some more thoughts after the initial work and some time to think... I'm considering if there should be a separate command for the fetch binary ruby from source or not. I'm also thinking through how we'd do checksums on the tarballs. For hosting of them, homebrew recently moved from bintray to GitHub Packages. It uses skopeo to work with remote images registries (which GitHub Packages is), like retrieving information, images, signing content. I'm not sure how they are building the tarballs to publish yet though. The big question there for me is how to organize things, and how to automate building of the various versions. My initial thought is like:
Something I'd like to enable as well is to allow organizations to be publishing their own builds, like if they have custom patches or configuration flags they use. This would also give the option to experiment with this before having a working solution for the hosting side of things. |
Beta Was this translation helpful? Give feedback.
-
Any update on this? Ten years have passed since this issues is raised🤦 |
Beta Was this translation helpful? Give feedback.
-
It's pretty hard and fragile to create movable CRuby builds, see #1761 (comment) IMHO it's fast enough and more reliable to build from source. |
Beta Was this translation helpful? Give feedback.
-
It would definitely be a bonus if "ruby-build" provides pre-built packages for multitude of aforementioned OS runtime combinations. However, the situation 10 years ago vs. today is quite different with widespread proliferation and usage of containers which subsequently reduces a need to have precompiled interpeters for OP's stated use case "[b]inary packages would make it much quicker to get up and running". |
Beta Was this translation helpful? Give feedback.
-
I'd like to add binary package support to ruby-build. I'd guess that most ruby-build installations are on one of two platforms—Mac OS X x86_64 or Linux x86_64—and most people really don't need to compile their own Ruby runtimes. Binary packages would make it much quicker to get up and running.
In order to do this, we'll need a command to build a definition into a temporary directory and make a tarball. We'll also need a way to download and install package tarballs from the internet. This implies having package repository sources, an architecture naming system, and an index of packages with checksums.
Beta Was this translation helpful? Give feedback.
All reactions