Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Independence of mruby

take_cheeze
September 19, 2017

Independence of mruby

take_cheeze

September 19, 2017
Tweet

More Decks by take_cheeze

Other Decks in Programming

Transcript

  1. About me. • GitHub: @take-cheeze • Seems like a mruby

    contributor(weakest of big four). • Just a mruby pull requester. • Moved to Fukuoka this July.
  2. Things to say before • Thank my new company for

    taking me to RubyKaigi. • I want mruby jobs!
  3. What I’ll talk • Why does mruby build depend on

    CRuby? • There was a guy who love rake. • mruby was using CMake when I first saw. • We don’t want to add the dependency in some cases. • Can GNU make replace it? • I’m using GNU make(don’t know nmake). • Don’t use file names with whitespaces in GNU make.
  4. Things to know • What is minirake? • Subset of

    rake for building mruby • Can do what rake can do with single script. • How to build without CRuby 1. Build mruby only with Makefile. 2. Run mruby build with built mruby(and minirake).
  5. Things I did. • Build minirake as a single binary.

    • Run build and test with built minirake and mruby. • Make Makefile very fat. ※ There was a precedent to make minirake single binary: • https://github.com/gromnitsky/minirake
  6. Making minirake a single binary 1. Build minirake single binary

    as usual. 2. Build mruby with built minirake. 3. Fix things that didn’t work well. • Add missing things: tsort, pathname, fileutils, … • Make mrbgem compatible with CRuby. • Reusing idea before mruby-cli: https://github.com/mruby/mruby/pull/1676
  7. Remove CRuby dependency 1. Port minirake scripts to Makefile. 2.

    Do porting until you finish. • GNU make reference and stackoverflow was my friend. 3. Makefile more than 300 line is created. • I can do complex text generating with Makefile.
  8. Time taken to build • My machine: • ThinkPad X1

    Carbon 5th / Windows 10 • RAM 16GB/Intel(R) Core(TM) i7-7500U CPU @2.70GHz 2.90GHz • Command used to run: time make test • About 10 minutes on Windows Subsystem for Linux • About 4 minutes on CentOS7 on VirtualBox
  9. Thoughts after finishing • Makefile is a great build tool.

    • Too many ways for process in Ruby (`,open3,spawn,system) • Need environment variables support to system method for cross build. • Thank all the developers of mrbgems I used. • Mainly port of Dir.glob (and the great idea): https://github.com/gromnitsky/mruby-dir-glob • IIJ for many stable mrbgems. • I want keyword arguments(because of FileUtils) • Actually I implemented it: https://github.com/mruby/mruby/pull/3629
  10. When can we use this? • No plan making Pull-Request.

    • It’s too big to make a review. • How do we do with mrbgems minirake uses? • Is it really useful? • Does mruby really need to be independent from CRuby? • There is many CRuby rake code to build mruby.