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

Create custom-built releases to replace traveling ruby #46

Open
noteflakes opened this issue Jan 5, 2017 · 0 comments
Open

Create custom-built releases to replace traveling ruby #46

noteflakes opened this issue Jan 5, 2017 · 0 comments
Milestone

Comments

@noteflakes
Copy link
Collaborator

Why not traveling ruby?

  • The available compiled rugged gem is relatively outdated (0.22). To you git tags we need version 0.23 or later. There's no compiled rugged gem for Windows.
  • The available version of ruby itself is relatively outdated, at 2.2.2.
  • For any updates we are dependent on the traveling-ruby project, which has been practically neglected in the last year.
  • The Rakefile is kinda ugly - lots of sh commands.

The alternative

If we wish to replace traveling ruby with something better, we need to have:

  • platform-specific portable versions of Ruby, i.e. a Ruby that will work regardless its location.
  • compiled rugged gem for each platform, bundled together with the corresponding Ruby.
  • a simple way to build the portable Ruby for each platform: install Ruby from source, install the lyp dependencies, cleanup unneeded files, compress to tar archive.
  • a simple way to package lyp itself, together with the pre-packaged version of lyp, into a compressed tar archive.

Plan of action

We will target three platforms: macOS, Windows, Linux X86-64 (the latter two will be built by spinning up small machines on AWS).

For each platform, a ruby installation will be maintained. Each installation will include a "raw version" and a "clean version". Each time the raw version is changed, it is copied to ruby.clean, and then unneeded files are removed. The clean version is what will be distributed.

Once we have the three archive files for the three platforms, we copy them into the lyp repository. To build a release, we prepare a release directory for each platform, unarchive the corresponding ruby, add the lyp files and some wrapper scripts, then create an archive and we're all done.

Tree structure

lyp
  bin - lyp binary files and wrappers
  lib - lyp source files
  ruby - a version of ruby

For each platform:

  • Install ruby from source

  • Create a bootstrapping ruby wrapper script - placed in the ruby bin directory

  • Use wrapper to install lyp dependencies:

    ruby/bin/ruby_wrapper ruby/bin/gem install http-client rugged ...

  • Cleanup and create archive:

    cp -R ruby ruby.original
    # remove all *.c *.a *.so *.o *.ri files
    # archive ruby
    mv ruby ruby.clean
    mv ruby.original ruby
    

Building a release

For each platform:

  • Create a release-specific directory, i.e. dist/release/lyp-1.3.2-osx
  • Open the ruby-2.4.0-osx archive to dist/release/lyp-1.3.2-osx/ruby
  • Copy the lyp bin and lib directories to dist/release/lyp-1.3.2-osx
  • Rename bin/lyp to bin/lyp.rb, bin/lilypond to bin/lilypond.rb
  • Add wrapper scripts lyp, lilypond, lyp_env.sh (see here)
  • Create archive of release
@noteflakes noteflakes added this to the v2.0.0 milestone Jan 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant