summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/mjit-bindgen.yml36
-rw-r--r--common.mk14
-rw-r--r--tool/mjit/.gitignore1
-rw-r--r--tool/mjit/Gemfile3
-rwxr-xr-xtool/mjit/bindgen.rb19
5 files changed, 28 insertions, 45 deletions
diff --git a/.github/workflows/mjit-bindgen.yml b/.github/workflows/mjit-bindgen.yml
index 1252d3b509..7c1575634d 100644
--- a/.github/workflows/mjit-bindgen.yml
+++ b/.github/workflows/mjit-bindgen.yml
@@ -28,8 +28,6 @@ jobs:
include:
- task: mjit-bindgen
fail-fast: false
- env:
- SETARCH: ${{ matrix.arch && format('setarch {0}', matrix.arch) }}
runs-on: ubuntu-20.04
if: ${{ !contains(github.event.head_commit.message, '[DOC]') && !contains(github.event.pull_request.labels.*.name, 'Documentation') }}
steps:
@@ -39,20 +37,20 @@ jobs:
run: |
echo "GNUMAKEFLAGS=-j$((1 + $(nproc --all)))" >> $GITHUB_ENV
- name: Install libraries
- env:
- arch: ${{ matrix.arch }}
run: |
set -x
- arch=${arch:+:${arch/i[3-6]86/i386}}
- ${arch:+sudo dpkg --add-architecture ${arch#:}}
sudo apt-get update -q || :
sudo apt-get install --no-install-recommends -q -y \
- ${arch:+cross}build-essential${arch/:/-} \
- libssl-dev${arch} libyaml-dev${arch} libreadline6-dev${arch} \
- zlib1g-dev${arch} libncurses5-dev${arch} libffi-dev${arch} \
- libclang1-10${arch} \
- bison autoconf ruby
- sudo apt-get install -q -y pkg-config${arch} || :
+ build-essential \
+ libssl-dev libyaml-dev libreadline6-dev \
+ zlib1g-dev libncurses5-dev libffi-dev \
+ libclang1-10 \
+ bison autoconf
+ sudo apt-get install -q -y pkg-config || :
+ - name: Set up Ruby
+ uses: ruby/setup-ruby@v1
+ with:
+ ruby-version: '3.1'
- name: git config
run: |
git config --global advice.detachedHead 0
@@ -72,15 +70,11 @@ jobs:
- run: ./autogen.sh
working-directory: src
- name: Run configure
- env:
- arch: ${{ matrix.arch }}
- run: >-
- $SETARCH ../src/configure -C --disable-install-doc --prefix=$(pwd)/install --enable-yjit=dev_nodebug
- ${arch:+--target=$arch-$OSTYPE --host=$arch-$OSTYPE}
- - run: $SETARCH make incs
- - run: $SETARCH make
- - run: $SETARCH make install
- - run: $SETARCH make ${{ matrix.task }}
+ run: ../src/configure -C --disable-install-doc --prefix=$(pwd)/install --enable-yjit=dev_nodebug
+ - run: make incs
+ - run: make
+ - run: make install
+ - run: make ${{ matrix.task }}
- run: git diff --exit-code
working-directory: src
- uses: ruby/action-slack@v3.0.0
diff --git a/common.mk b/common.mk
index 404388e935..1d11753fa5 100644
--- a/common.mk
+++ b/common.mk
@@ -249,19 +249,7 @@ mjit_config.h: Makefile
.PHONY: mjit-bindgen
mjit-bindgen:
- $(Q)$(XRUBY) -C $(srcdir) -Ilib \
- -e 'ENV["GEM_HOME"] = File.expand_path(".bundle")' \
- -e 'ENV["BUNDLE_APP_CONFIG"] = File.expand_path(".bundle")' \
- -e 'ENV["BUNDLE_PATH__SYSTEM"] = "true"' \
- -e 'ENV["BUNDLE_WITHOUT"] = "lint doc"' \
- -e 'load "spec/bundler/support/bundle.rb"' -- install --gemfile=tool/mjit/Gemfile
- $(Q)$(XRUBY) -C $(srcdir) -Ilib \
- -e 'ENV["GEM_HOME"] = File.expand_path(".bundle")' \
- -e 'ENV["BUNDLE_APP_CONFIG"] = File.expand_path(".bundle")' \
- -e 'ENV["BUNDLE_GEMFILE"] = "tool/mjit/Gemfile"' \
- -e 'ENV["BUNDLE_PATH__SYSTEM"] = "true"' \
- -e 'ENV["BUNDLE_WITHOUT"] = "lint doc"' \
- -e 'load "spec/bundler/support/bundle.rb"' -- exec tool/mjit/bindgen.rb $(CURDIR)
+ $(Q) $(BASERUBY) -rrubygems -C $(srcdir)/tool/mjit bindgen.rb $(CURDIR)
# These rules using MJIT_HEADER_SUFFIX must be in common.mk, not
# Makefile.in, in order to override the macro in defs/universal.mk.
diff --git a/tool/mjit/.gitignore b/tool/mjit/.gitignore
deleted file mode 100644
index 66f8ed35a4..0000000000
--- a/tool/mjit/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/Gemfile.lock
diff --git a/tool/mjit/Gemfile b/tool/mjit/Gemfile
deleted file mode 100644
index d7f2838765..0000000000
--- a/tool/mjit/Gemfile
+++ /dev/null
@@ -1,3 +0,0 @@
-source 'https://rubygems.org'
-
-gem 'ffi-clang', git: 'https://github.com/ioquatix/ffi-clang', ref: 'c08ca683c4f4cf73f4dc38539c3180288b360ea1'
diff --git a/tool/mjit/bindgen.rb b/tool/mjit/bindgen.rb
index 6167bdfc00..688d48ccb2 100755
--- a/tool/mjit/bindgen.rb
+++ b/tool/mjit/bindgen.rb
@@ -1,8 +1,18 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
-ENV['BUNDLE_GEMFILE'] ||= File.expand_path('./Gemfile', __dir__)
-require 'bundler/setup'
+ENV['GEM_HOME'] = File.expand_path('./.bundle', __dir__)
+require 'rubygems/source'
+require 'bundler/inline'
+gemfile do
+ source 'https://rubygems.org'
+ gem 'ffi-clang', '0.7.0', require: false
+end
+
+# Help ffi-clang find libclang
+# Hint: apt install libclang1
+ENV['LIBCLANG'] ||= Dir.glob("/usr/lib/llvm-*/lib/libclang.so.1").grep_v(/-cpp/).sort.last
+require 'ffi/clang'
require 'etc'
require 'fiddle/import'
@@ -12,11 +22,6 @@ unless build_dir = ARGV.first
abort "Usage: #{$0} BUILD_DIR"
end
-# Help ffi-clang find libclang
-# Hint: apt install libclang1
-ENV['LIBCLANG'] ||= Dir.glob("/lib/#{RUBY_PLATFORM}-gnu/libclang-*.so*").grep_v(/-cpp/).sort.last
-require 'ffi/clang'
-
class Node < Struct.new(
:kind,
:spelling,