From 9c1220e14df94a1ffc7c9041719aaa3b77186ad7 Mon Sep 17 00:00:00 2001 From: dearblue Date: Wed, 29 Apr 2020 16:23:55 +0900 Subject: Sorting the list of gems at build time by name Printing them in sorted order makes it easier to find the desired gem. But it has come to completely ignore the dependency. --- lib/mruby/build.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/mruby/build.rb b/lib/mruby/build.rb index 5c7832dff..8154b2b19 100644 --- a/lib/mruby/build.rb +++ b/lib/mruby/build.rb @@ -336,7 +336,8 @@ EOS puts " Binaries: #{@bins.join(', ')}" unless @bins.empty? unless @gems.empty? puts " Included Gems:" - @gems.map do |gem| + gems = @gems.sort_by { |gem| gem.name } + gems.each do |gem| gem_version = " - #{gem.version}" if gem.version != '0.0.0' gem_summary = " - #{gem.summary}" if gem.summary puts " #{gem.name}#{gem_version}#{gem_summary}" -- cgit v1.2.3 From 4ce3997ca4821394ed9ce572daace59383a62b41 Mon Sep 17 00:00:00 2001 From: Takeshi Watanabe Date: Sat, 14 Dec 2019 00:39:54 +0900 Subject: Start GitHub Actions; close #4903 --- .github/workflows/build.yml | 108 ++++++++++++++++++++++++++++++++++++++++++++ lib/mruby/build.rb | 8 ++++ lib/mruby/source.rb | 4 +- travis_config.rb | 18 ++++++++ 4 files changed, 137 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml (limited to 'lib') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..d743d4ffb --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,108 @@ +name: Build & Test + +on: [push, pull_request] + +jobs: + Ubuntu-1604: + runs-on: ubuntu-16.04 + steps: + - uses: actions/checkout@v1 + - name: apt + run: sudo apt install ruby gperf bison + - name: build and test + run: rake -m -j4 all test + env: + MRUBY_CONFIG: travis_config.rb + + Ubuntu-1804-gcc: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v1 + - name: apt + run: sudo apt install ruby gperf bison gcc g++ + - name: build and test + run: rake -m -j4 all test + env: + MRUBY_CONFIG: travis_config.rb + CC: gcc + CXX: g++ + + Ubuntu-1804-clang: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v1 + - name: apt + run: sudo apt install ruby gperf bison + - name: build and test + run: rake -m -j4 all test + env: + MRUBY_CONFIG: travis_config.rb + CC: clang + CXX: clang++ + + macOS: + runs-on: macos-latest + steps: + - uses: actions/checkout@v1 + - name: brew + run: brew install ruby gperf bison + - name: build and test + run: rake -m -j4 all test + env: + MRUBY_CONFIG: travis_config.rb + + Windows-MinGW: + runs-on: windows-latest + steps: + - uses: actions/checkout@v1 + - name: chocolatey + run: choco install -y ruby winflexbison gperf + - name: build and test + run: rake -E '$stdout.sync=true' -j4 test + env: + MRUBY_CONFIG: travis_config.rb + YACC: win_bison + CFLAGS: -g -O1 -Wall -Wundef + + Windows-Cygwin: + runs-on: windows-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/cache@v1 + with: + path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey + key: ${{ runner.os }}-cygwin-chocolatey-${{ matrix.os }}-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-cygwin-chocolatey-${{ matrix.os }}- + ${{ runner.os }}-cygwin-chocolatey- + - name: chocolatey + run: choco install -y cygwin + - name: Install cygwin packages + shell: cmd + run: C:\tools\cygwin\cygwinsetup.exe -qgnNdO -R C:/tools/cygwin -l C:/tools/cygwin/package -s http://mirrors.kernel.org/sourceware/cygwin/ -P gcc-core,gcc-g++,bison,make,gperf,ruby + - name: Set ENV + run: | + echo '::set-env name=PATH::C:\tools\cygwin\bin;C:\tools\cygwin\usr\bin' + - name: build and test + shell: cmd + run: C:\tools\cygwin\bin\ruby.exe /usr/bin/rake -m -j4 -v -E 'STDOUT.sync=true' test + env: + MRUBY_CONFIG: travis_config.rb + + Windows-VC: + runs-on: windows-latest + steps: + - uses: actions/checkout@v1 + - name: chocolatey + run: choco install -y ruby winflexbison gperf + - name: build and test + shell: cmd + run: | + call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + rake -E "STDOUT.sync=true" -m -j4 -v test + env: + MRUBY_CONFIG: appveyor_config.rb + YACC: win_bison + # TODO(take-cheeze): Re-enable /O2 + CFLAGS: "/c /nologo /W3 /we4013 /Zi /MD /D_CRT_SECURE_NO_WARNINGS" + CXXFLAGS: "/c /nologo /W3 /Zi /MD /EHs /D_CRT_SECURE_NO_WARNINGS" diff --git a/lib/mruby/build.rb b/lib/mruby/build.rb index 8154b2b19..763334cf5 100644 --- a/lib/mruby/build.rb +++ b/lib/mruby/build.rb @@ -276,6 +276,14 @@ EOS end end + def cygwin_filename(name) + if name.is_a?(Array) + name.flatten.map { |n| cygwin_filename(n) } + else + `cygpath -w "#{filename(name)}"`.strip + end + end + def exefile(name) if name.is_a?(Array) name.flatten.map { |n| exefile(n) } diff --git a/lib/mruby/source.rb b/lib/mruby/source.rb index 5819a322b..a305c7b04 100644 --- a/lib/mruby/source.rb +++ b/lib/mruby/source.rb @@ -6,7 +6,9 @@ module MRuby ROOT = Pathname.new(File.expand_path('../../../',__FILE__)) # Reads a constant defined at version.h - MRUBY_READ_VERSION_CONSTANT = Proc.new { |name| ROOT.join('include','mruby','version.h').read.match(/^#define #{name} +"?([\w\. ]+)"?$/)[1] } + MRUBY_READ_VERSION_CONSTANT = Proc.new do |name| + ROOT.join('include','mruby','version.h').read.match(/^#define #{name} +"?([\w\. ]+)"?\r?$/)[1] + end MRUBY_RUBY_VERSION = MRUBY_READ_VERSION_CONSTANT['MRUBY_RUBY_VERSION'] MRUBY_RUBY_ENGINE = MRUBY_READ_VERSION_CONSTANT['MRUBY_RUBY_ENGINE'] diff --git a/travis_config.rb b/travis_config.rb index f4bef0a52..6af9c98d2 100644 --- a/travis_config.rb +++ b/travis_config.rb @@ -1,5 +1,21 @@ +MRuby::Build.new('debug') do |conf| + toolchain :gcc + yacc.command = ENV['YACC'] || 'bison' + enable_debug + + # include all core GEMs + conf.gembox 'full-core' + conf.cc.flags += %w(-Werror=declaration-after-statement) + conf.compilers.each do |c| + c.defines += %w(MRB_GC_STRESS MRB_GC_FIXED_ARENA MRB_METHOD_CACHE) + end + + build_mrbc_exec +end + MRuby::Build.new('full-debug') do |conf| toolchain :gcc + yacc.command = ENV['YACC'] || 'bison' enable_debug # include all core GEMs @@ -12,6 +28,7 @@ end MRuby::Build.new do |conf| toolchain :gcc + yacc.command = ENV['YACC'] || 'bison' # include all core GEMs conf.gembox 'full-core' @@ -25,6 +42,7 @@ end MRuby::Build.new('cxx_abi') do |conf| toolchain :gcc + yacc.command = ENV['YACC'] || 'bison' conf.gembox 'full-core' conf.cc.flags += %w(-fpermissive) -- cgit v1.2.3 From 53ea8abea674f096517ac4499424fafce379eb09 Mon Sep 17 00:00:00 2001 From: KOBAYASHI Shuji Date: Tue, 26 May 2020 11:48:42 +0900 Subject: Revert part of "Start GitHub Actions" (4ce3997c) Because some changes have been overridden. --- lib/mruby/build.rb | 8 -------- travis_config.rb | 18 ------------------ 2 files changed, 26 deletions(-) (limited to 'lib') diff --git a/lib/mruby/build.rb b/lib/mruby/build.rb index 763334cf5..8154b2b19 100644 --- a/lib/mruby/build.rb +++ b/lib/mruby/build.rb @@ -276,14 +276,6 @@ EOS end end - def cygwin_filename(name) - if name.is_a?(Array) - name.flatten.map { |n| cygwin_filename(n) } - else - `cygpath -w "#{filename(name)}"`.strip - end - end - def exefile(name) if name.is_a?(Array) name.flatten.map { |n| exefile(n) } diff --git a/travis_config.rb b/travis_config.rb index 6af9c98d2..f4bef0a52 100644 --- a/travis_config.rb +++ b/travis_config.rb @@ -1,21 +1,5 @@ -MRuby::Build.new('debug') do |conf| - toolchain :gcc - yacc.command = ENV['YACC'] || 'bison' - enable_debug - - # include all core GEMs - conf.gembox 'full-core' - conf.cc.flags += %w(-Werror=declaration-after-statement) - conf.compilers.each do |c| - c.defines += %w(MRB_GC_STRESS MRB_GC_FIXED_ARENA MRB_METHOD_CACHE) - end - - build_mrbc_exec -end - MRuby::Build.new('full-debug') do |conf| toolchain :gcc - yacc.command = ENV['YACC'] || 'bison' enable_debug # include all core GEMs @@ -28,7 +12,6 @@ end MRuby::Build.new do |conf| toolchain :gcc - yacc.command = ENV['YACC'] || 'bison' # include all core GEMs conf.gembox 'full-core' @@ -42,7 +25,6 @@ end MRuby::Build.new('cxx_abi') do |conf| toolchain :gcc - yacc.command = ENV['YACC'] || 'bison' conf.gembox 'full-core' conf.cc.flags += %w(-fpermissive) -- cgit v1.2.3