diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2022-11-15 23:42:41 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-15 23:42:41 -0800 |
commit | fca50abb7c7e5369fdb8d2d3b6c1750076f3d846 (patch) | |
tree | 9d1f541a56b486a0a1991ebd5b646dbd27461494 /tool | |
parent | cd2da0941035c231bc95007a269b6dc3d4b62ca9 (diff) |
Let mjit-bindgen use BASERUBY and bundle/inline (#6740)
Notes
Notes:
Merged-By: k0kubun <takashikkbn@gmail.com>
Diffstat (limited to 'tool')
-rw-r--r-- | tool/mjit/.gitignore | 1 | ||||
-rw-r--r-- | tool/mjit/Gemfile | 3 | ||||
-rwxr-xr-x | tool/mjit/bindgen.rb | 19 |
3 files changed, 12 insertions, 11 deletions
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, |