Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

add support for binary rbx #1378

Closed
wants to merge 16 commits into from

3 participants

Michal Papis Brian Shirai Postmodern
Michal Papis
Collaborator

almost ready, waiting for @brixen to confirm

Michal Papis
Collaborator

waiting for something more to test:

curl -L http://binaries.rubini.us/ | grep -oE "<Key>[^<]+</Key>" | sed 's/<[^>]*>//g' | grep -vE '\.md5$|\.sha1$|\$folder\$$'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  7212    0  7212    0     0  10559      0 --:--:-- --:--:-- --:--:-- 17130
ubuntu/10.04/x86_64/rubinius-2.0.0-nightly20121210-d18.zip
ubuntu/10.04/x86_64/rubinius-2.0.0-rc1-d18.zip
ubuntu/10.04/x86_64/rubinius-2.0.0-weekly20121210-d18.zip
ubuntu/12.04/i386/rubinius-2.0.0-d18.zip
ubuntu/12.04/i386/rubinius-2.0.0-nightly20121209-d18.zip
ubuntu/12.04/i386/rubinius-2.0.0-rc1-d18.zip
ubuntu/12.04/i386/rubinius-2.0.0-weekly20121209-d18.zip
Brian Shirai

@mpapis could you elaborate? What are you waiting for, more binaries? Does that mean I can install these binaries now with RVM? If so, what are the install instructions so I can confirm?

Michal Papis
Collaborator

@brixen:

  1. you have mentioned providing .tar.gz (I personally would prefer .tar.bz2 but either will do)
  2. there is still open requirement of the archive root, if you are not going to change it I will have to add and algorithm to A) ignore the root check for rbx B) detect your root and transform it to the proper one or C) repackage your binaries with proper root and extension

I would vote for updating the root of your package so it can be easily used with other ruby switchers like https://github.com/postmodern/chruby //cc @postmodern

Brian Shirai

Ruby switchers are by definition not installers and simply use whatever directory structure is provided.

The Rubinius binaries are general purpose and use a reasonable *nix path. They will not be made special for RVM. If you choose to create your own binaries or repackage Rubinius binaries, that's up to you, but the digests will no longer match and you assume responsibility for security. We will be signing packages soon and I will advocate everywhere not using any binary package that is not signed by us.

You already have conditional code in RVM for dealing with a myriad situations. The code to unpack a binary in a single dir is not at all complex. You are asking that I make an exception for RVM when all you have to do is mkdir foo; cd foo; <unpack>. Your insistance on special treatment for RVM exceedingly unreasonable.

I am removing the melbourne/build directory from installs, so you should remove that code from RVM.

I'll add .tar.gz and .tar.bz2 versions of the binaries.

Michal Papis
Collaborator

@brixen actually I'm considering other tools, especially taking chruby into consideration: https://github.com/postmodern/chruby#system-wide where rubies are unpacked in /opt/rubies/ your path makes it complicated by requiring additional actions:

cd /opt/rubies
wget http://binaries.rubini.us/ubuntu/10.04/x86_64/rubinius-2.0.0-nightly20121210-d18.zip
unzip rubinius-2.0.0-nightly20121210-d18.zip

which would be enough if you follow my advise to use the same root dir as the package, but with your root user has two more steps:

mv usr/local/rubinius/2.0.0rc1 rubinius-2.0.0-nightly20121210-d18
rm -rf usr

which is required to allow multile versions like rubinius-2.0.0-nightly20121210-d18 and rubinius-2.0.0-nightly20121210-d19

Brian Shirai

No, it doesn't require additional steps. The switchers do not have to care where the files are. Especially if they are working with system package installs as well, they are already accounting for different paths.

Michal Papis
Collaborator

so you can extract rubinius-2.0.0-nightly20121210-d18 and rubinius-2.0.0-nightly20121210-d19 and they will have different roots? btw. for system packages you will have to prepare a new package anyway, so I do not see a point in your reasoning, especially, /usr/local/ is not a good path according to FHS which is requirement for Ubuntu

Brian Shirai

The binary is not for system packages. System packages are built with our build system for the requirements of different packagers.

No, they don't have different roots, but they will coexist side-by-side just like different versions do.

Michal Papis
Collaborator

brixen so continuing chruby (to avoid rvm) could you give me simple instruction how to use rbx with chruby?

Brian Shirai

@mpapis you are wasting my time and I have much more important things to spend it on. You know where Rubinius binaries are. If you decide to install them with RVM, I think your users will thank you. If not, they can install from source and it will be a good reason to consider an alternative Ruby installer. I am dedicating the time I have wasted on RVM bugs and problems to packages for popular platforms and features that Rubinius users need.

Michal Papis
Collaborator

@joshk you can try with this commands:

sudo apt-get install unzip
rvm get branch /features/binary-rbx
rvm install rubinius-2.0.0-nightly20121209-d18 --verify-downloads 1
Postmodern

Chiming in here. @brixen the archives should probably not include usr/local/ prefix, but instead use the -C option for tar and the -d option for unzip.

tar -xzvf rubinius-bin.tar.gz -C /usr/local
unzip rubinius-bin.zip -d /usr/local

This would also allow chruby users to manually download the rubinius binaries, and extract them where ever; I prefer /opt/rubies/ as it complies with the FHS

Michal Papis
Collaborator

ok all important changes are already on head, here is only http://binaries.rubini.us/ specific code.

all changes except https://github.com/wayneeseguin/rvm/pull/1378/files#L0R79 would be obsolete if the archive would be adjusted:

  1. remove melbourne/build/melbourne20*
  2. provide the archive as tar.bz2 (tar.gz would do too but has lower compression level)
  3. fix the root of the archive to correspond to the archive name (this is biggest part of the code)

I have prepared example build (ubuntu/12.04/i386) of rbx that works without this changes (it's hosted on http://rvm.io):

rvm get head
rvm install rubinius-2.0.0-nightly20121218-d19 --verify-downloads 1 --binary
Michal Papis mpapis referenced this pull request from a commit
Michal Papis mpapis rubinius prefers tar.gz, update #1378 bce41f4
Brian Shirai

I've uploaded a new set of test binaries for the precise32 (ubuntu/12.04/i386) platform. The following are changes:

  • the usr/local prefix has been removed
  • bzip2 is used for compression, suffix is .tar.bz2
  • the rbx executable has debugging symbols stripped to reduce size
  • only lib files for the configure version are included (eg lib/18 for 1.8 mode)
Michal Papis
Collaborator

great I will do some release to include it tomorrow (quite tired today) ... one question: the internal directory structure does not reflect the archive name, is it intentional? I think it could be an issue when trying next versions of RBX.

also is there a tagged release that corresponds weekly (daily seams to much for a tag)?

Brian Shirai

There will be weekly and rc tags along with the release tags eventually. The weekly and nightly binaries are intended to install in the same place so that someone can update to the most current one easily.

Michal Papis mpapis closed this in 0a1ba86
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 10, 2012
  1. Michal Papis

    add support for binary rbx

    mpapis authored
Commits on Dec 16, 2012
  1. Michal Papis

    Merge branch 'master' into features/binary-rbx

    mpapis authored
    Conflicts:
    	config/db
  2. Michal Papis
Commits on Dec 17, 2012
  1. Michal Papis
Commits on Dec 18, 2012
  1. Michal Papis
  2. Michal Papis
Commits on Dec 28, 2012
  1. Michal Papis
  2. Michal Papis
Commits on Jan 8, 2013
  1. Michal Papis
  2. Michal Papis
  3. Michal Papis
  4. Michal Papis

    cleaing code

    mpapis authored
  5. Michal Papis
  6. Michal Papis
  7. Michal Papis

    Merge branch 'master' into features/binary-rbx

    mpapis authored
    Conflicts:
    	scripts/external
  8. Michal Papis
This page is out of date. Refresh to see the latest.
Showing with 46 additions and 17 deletions.
  1. +1 −0  config/db
  2. +44 −16 scripts/external
  3. +1 −1  scripts/functions/utility
1  config/db
View
@@ -76,6 +76,7 @@ ironruby_1.1.3_url=http://download-codeplex.sec.s-msft.com/Download/Release?Proj
rvm_remote_server_url=https://rvm.io/binaries
rvm_remote_server_url1=http://jruby.org.s3.amazonaws.com
rvm_remote_server_path1=downloads
+rvm_remote_server_url2=http://binaries.rubini.us
# rvm_remote_server_url2=http://gentoo-binaries.my-custom-server.com
# rvm_remote_server_path2=ec2-2013.09
# Packages
60 scripts/external
View
@@ -251,8 +251,6 @@ external_import_configure()
external_import_download()
{
- typeset downloaded_names
-
if
[[ -r "${rvm_ruby_url}" ]]
then
@@ -266,30 +264,60 @@ external_import_download()
return 2
}
fi
+}
- downloaded_names="$(
+external_import_validate_archive()
+{
+ typeset -a downloaded_names path_to_bin_ruby
+
+ __rvm_read_lines path_to_bin_ruby < <(
+ __rvm_package list "$rvm_archives_path/${rvm_ruby_package_file}" | grep "bin/ruby$"
+ )
+ __rvm_read_lines downloaded_names < <(
__rvm_package list "$rvm_archives_path/${rvm_ruby_package_file}" | awk -F/ '{print $1}' | sort -u
- )"
- [[ "${rvm_ruby_string}" == "${downloaded_names}" ]] || {
- $err_command "The downloaded package ${rvm_ruby_url} contains '${downloaded_names}' instead of '${rvm_ruby_string}'."
+ )
+ if
+ [[ "${#path_to_bin_ruby[*]}" -eq 1 ]]
+ then
+ __path_to_extract="${path_to_bin_ruby[*]}"
+ __path_to_extract="${__path_to_extract%bin/ruby}"
+ elif
+ [[ "${rvm_ruby_string}" == "${downloaded_names[*]}" ]]
+ then
+ __path_to_extract="${rvm_ruby_string}"
+ else
+ $err_command "The downloaded package for ${rvm_ruby_url},
+Does not contains single 'bin/ruby' or '${rvm_ruby_string}',
+Only '${downloaded_names[*]}' were found instead."
return 4
- }
+ fi
}
+
external_import_extract()
{
- __rvm_package extract "$rvm_archives_path/${rvm_ruby_package_file}" "${rvm_rubies_path}" || {
+ rm -rf "${rvm_rubies_path}/${rvm_ruby_string}"
+ mkdir -p "${rvm_rubies_path}/${rvm_ruby_string}"
+ __rvm_package extract "$rvm_archives_path/${rvm_ruby_package_file}" "${rvm_rubies_path}/${rvm_ruby_string}" || {
$err_command "Unpacking ${rvm_ruby_package_file} failed."
return 6
}
- [[ -d "${rvm_rubies_path}/${rvm_ruby_string}" ]] || {
- $err_command "Ruby directory was not created, make "
- return 8
- }
+
+ if
+ [[ -n "${__path_to_extract}" && "${__path_to_extract}" != "/" ]]
+ then
+ [[ -d "${rvm_rubies_path}/${rvm_ruby_string}/${__path_to_extract}/bin" ]] || {
+ $err_command "Target directory '${__path_to_extract}' was not created,
+make sure '${rvm_ruby_url}' is a valid binary ruby archive."
+ return 8
+ }
+ mv "${rvm_rubies_path}/${rvm_ruby_string}/${__path_to_extract}"/* "${rvm_rubies_path}/${rvm_ruby_string}/"
+ rm -rf "${rvm_rubies_path}/${rvm_ruby_string}/${__path_to_extract%%/*}"
+ fi
}
# validate libraries - make sure everything can be loaded
-external_import_validate()
+external_import_validate_binary()
{
typeset IFS
typeset -a missing_libs
@@ -377,11 +405,11 @@ external_import_setup()
external_import()
{
- typeset step err_command rvm_ruby_url rvm_ruby_string rvm_ruby_package_file
+ typeset step err_command rvm_ruby_url rvm_ruby_string rvm_ruby_package_file __path_to_extract
- for step in configure download extract validate setup
+ for step in configure download validate_archive extract validate_binary setup
do
- rvm_log "${rvm_ruby_string:-${2:-$1}} - #$step"
+ rvm_log "${rvm_ruby_string:-${2:-$1}} - #${step//_/ }"
external_import_${step} "$@" || return $?
done
}
2  scripts/functions/utility
View
@@ -504,7 +504,7 @@ __rvm_remote_extension()
*.tar.*)
rvm_remote_extension="tar${1##*tar}"
;;
- jruby-*|rbx-*|rubinius-*)
+ jruby-*)
rvm_remote_extension="tar.gz"
;;
*)
Something went wrong with that request. Please try again.