Skip to content

Commit

Permalink
Upgrade to Ruby2.6 (#4)
Browse files Browse the repository at this point in the history
* Add vanilla 2.6

* Add enclose/squash/vendor files

* Move 2.6 over old ruby

* Update version numbers in ruby.patch

* Apply patch

* Change rubyc version to 0.6.0

* Add ncurses 6.1

* Overwrite ncurses with ncurses 6.1

* Add texinfo?

* Replace deploy stage with travis github releases deploy?

* Trying to see some errors

* Update zlib to 1.2.11

* Trying to see more output on phase1 configure

* More patch

* Raise on error when capturing

* Umm still 2.5.1 in .travis.yml

* Actually dont raise there

* Fix zlib

* Actually it should raise there to not eat exceptions

* Gitignore eats configure

* Add ruby/configure

* Why enc ignored?

* Strange ignores

* Readd

* enc

* enc2

* Try to fix did-you-know gem

* And still fixing did_you_mean

* Did_you_mean gemspec is horrible

* What the

* What is wrong with this gem!??

* Switch version number assertion in spec

* Fix packaging
  • Loading branch information
kke authored Jan 15, 2019
1 parent 7180dbc commit 7fda70a
Show file tree
Hide file tree
Showing 7,886 changed files with 321,973 additions and 373,568 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
35 changes: 14 additions & 21 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,30 @@ language: ruby
cache: bundler
sudo: enabled
before_install:
- "./.travis/install_deps.sh"
- gem update --system
- gem install bundler
- "./.travis/install_deps.sh"
- gem update --system
- gem install bundler
stages:
- name: test
- name: deploy
if: tag IS present
jobs:
include:
- stage: test
rvm: 2.5.1
rvm: 2.6.0
name: test osx
script: "./.travis/test.sh"
os: osx
- stage: test
name: test linux
rvm: 2.5.1
rvm: 2.6.0
script: "./.travis/test.sh"
os: linux
dist: xenial
- stage: deploy
name: deploy osx
rvm: 2.5.1
os: osx
script: "./.travis/deploy.sh"
- stage: deploy
name: deploy linux
rvm: 2.5.1
os: linux
dist: xenial
script: "./.travis/deploy.sh"
env:
global:
- secure: W+7Ex9Jg2qGsMSiVBDV4pppPrQI8NdWRZK8EEAdUF7vuM2gON9jHOTNHPbHe1SEuJJu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2tEU3K0i2u5/vGtx11eg8pNcxWYgPjvmnZtYleOgFdu1SmkKZOCQffFemMJh/vEppPWknIEZBFK4GzFaEoPA3utXlQh20I37sRk3N/BQKUY5U7mEtc6lH4+LkeRl3H2UEM0fmo8LyE3fgKC5P1zVyXyI0IGlcMIXojr77RAnvjw4Ttjw+wrjRArAuw+QZfXCc+76qLiIykb+bRaJU0tLcMXfC0FAvZIE2uxOuFJ3xA6rynuP6MaGWhASalRvVd64mb1MmW6g7Km5My67196BzUPP2YutQM88=
41 changes: 0 additions & 41 deletions .travis/deploy.sh

This file was deleted.

2 changes: 1 addition & 1 deletion .travis/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ if [ "$TRAVIS_OS_NAME" = "osx" ]; then
brew install openssl
else
sudo apt-get update
sudo apt-get install -y -q openssl squashfs-tools curl install-info info
sudo apt-get install -y -q openssl squashfs-tools curl install-info info texinfo texi2html
fi
24 changes: 22 additions & 2 deletions .travis/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,34 @@ ruby -Ilib bin/rubyc bin/rubyc \
--tmpdir=${TEMP_DIR} \
--clean-tmpdir \
--ignore-file=.git \
--ignore-file=.gitignore \
--ignore-file=.gitmodules \
--ignore-file=CHANGELOG.md \
--ignore-file=ruby.patch \
--ignore-file=.travis.yml \
--ignore-file=.travis/deploy.sh \
--ignore-file=.travis/test.sh \
--ignore-file=.travis/install_deps.sh \
-o rubyc

strip rubyc || true

./rubyc --version
RUBY_VERSION=`./rubyc --ruby-version`
RUBYC_VERSION=`./rubyc --version`

echo "------------------------------------"
echo "Ruby version: $RUBY_VERSION"
echo "Rubyc version: $RUBYC_VERSION"
echo "------------------------------------"

bundle exec rake test

gzip rubyc

if [ "$TRAVIS_TAG" = "" ]; then
VERSION="${RUBY_VERSION}-${RUBYC_VERSION}"
else
VERSION="${TRAVIS_TAG}"
fi

mv rubyc.gz rubyc-${VERSION}-${TRAVIS_OS_NAME}-amd64.gz
ls -al rubyc*gz
54 changes: 33 additions & 21 deletions lib/compiler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,17 +159,24 @@ def build_ruby_pass_1_unix
@compile_env['ENCLOSE_IO_RUBYC_2ND_PASS'] = nil

Dir.chdir(@build_pass_1) do
@utils.run(@compile_env,
@ruby_configure,
"--prefix", @ruby_install_1,
"--enable-bundled-libyaml",
"--without-gmp",
"--disable-dtrace",
"--enable-debug-env",
"--disable-install-rdoc")
@utils.capture_run_io "phase1_configure", true do
@utils.run(@compile_env,
@ruby_configure,
"--prefix", @ruby_install_1,
"--enable-bundled-libyaml",
"--without-gmp",
"--disable-dtrace",
"--enable-debug-env",
"--disable-install-rdoc")
end

@utils.run(@compile_env, "make #{@options[:make_args]}")
@utils.run(@compile_env, "make install")
@utils.capture_run_io "phase1_make" do
@utils.run(@compile_env, "make #{@options[:make_args]}")
end

@utils.capture_run_io "phase1_make_install" do
@utils.run(@compile_env, "make install")
end
end
end

Expand Down Expand Up @@ -200,21 +207,26 @@ def build_ruby_pass_2_unix
Dir.chdir(@build_pass_2) do
baseruby = File.join(@ruby_install_1_bin, "ruby")

@utils.run(@compile_env,
@ruby_configure,
"--prefix", @ruby_install_2,
"--with-baseruby=#{baseruby}",
"--enable-bundled-libyaml",
"--without-gmp",
"--disable-dtrace",
"--enable-debug-env",
"--disable-install-rdoc",
"--with-static-linked-ext")
@utils.capture_run_io "phase2_configure" do
@utils.run(@compile_env,
@ruby_configure,
"--prefix", @ruby_install_2,
"--with-baseruby=#{baseruby}",
"--enable-bundled-libyaml",
"--without-gmp",
"--disable-dtrace",
"--enable-debug-env",
"--disable-install-rdoc",
"--with-static-linked-ext")
end

make_enclose_io_memfs
make_enclose_io_vars

@utils.run(@compile_env, "make #{@options[:make_args]}")
@utils.capture_run_io "phase2_make" do
@utils.run(@compile_env, "make #{@options[:make_args]}")
end

@utils.cp('ruby', @options[:output])
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/compiler/constants.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Copyright (c) 2017 Minqi Pan <[email protected]>
#
#
# This file is part of Ruby Compiler, distributed under the MIT License
# For full terms see the included LICENSE file

class Compiler
VERSION = '0.5.0'
VERSION = '0.6.0'
PRJ_ROOT = File.expand_path('../../..', __FILE__)
VENDOR_DIR = File.expand_path('vendor', PRJ_ROOT)
MEMFS = '/__enclose_io_memfs__'
Expand Down
17 changes: 11 additions & 6 deletions lib/compiler/utils.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright (c) 2017 Minqi Pan <[email protected]>
#
#
# This file is part of Ruby Compiler, distributed under the MIT License
# For full terms see the included LICENSE file

Expand All @@ -17,7 +17,7 @@ def initialize(options = {})
@capture_io = nil
end

def capture_run_io(log_name)
def capture_run_io(log_name, output_on_success = false)
log_file = File.join @options[:tmpdir], "#{log_name}.log"

STDERR.puts "=> Saving output to #{log_file}"
Expand All @@ -27,8 +27,13 @@ def capture_run_io(log_name)

yield
end
if output_on_success
puts "(output_on_success: true) - #{log_file}:"
IO.copy_stream log_file, $stdout
end
rescue Error
IO.copy_stream log_file, $stdout
raise
ensure
@capture_io = nil
end
Expand Down Expand Up @@ -86,12 +91,12 @@ def chdir(path)
Dir.chdir(path) { yield }
STDERR.puts "-> cd #{Dir.pwd}" unless @options[:quiet]
end

def cp(x, y)
STDERR.puts "-> cp #{x.inspect} #{y.inspect}" unless @options[:quiet]
FileUtils.cp(x, y)
end

def cp_r(x, y, options = {})
STDERR.puts "-> cp -r #{x.inspect} #{y.inspect}" unless @options[:quiet]
FileUtils.cp_r(x, y, options)
Expand All @@ -116,12 +121,12 @@ def mkdir(x)
STDERR.puts "-> mkdir #{x}" unless @options[:quiet]
FileUtils.mkdir(x)
end

def mkdir_p(x)
STDERR.puts "-> mkdir -p #{x}" unless @options[:quiet]
FileUtils.mkdir_p(x)
end

def remove_dynamic_libs(path)
['dll', 'dylib', 'so'].each do |extname|
Dir["#{path}/**/*.#{extname}"].each do |x|
Expand Down
Loading

0 comments on commit 7fda70a

Please sign in to comment.