From abae20efae1b93ee686f2c0a7b5a7197e386b83a Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Tue, 10 Jan 2023 14:17:24 +0100 Subject: [PATCH] Skip compilation on TruffleRuby * Running libv8 on GraalVM LLVM is unlikely to ever work, instead using Graal.js makes more sense. This is already the case in mini_racer. libv8-node is a necessary dependency of mini_racer on CRuby, so for TruffleRuby the extconf.rb simply creates a dummy Makefile. --- .github/workflows/build.yml | 10 ++++++++++ ext/libv8-node/extconf.rb | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1c521a2..b4039c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,6 +25,16 @@ jobs: run: apt-get update && apt-get install -y shellcheck - name: Shellcheck run: shellcheck libexec/* + compile-truffleruby: + name: Compile on truffleruby + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: truffleruby + bundler-cache: true + - run: bundle exec rake compile build-ruby: name: Build (ruby) outputs: diff --git a/ext/libv8-node/extconf.rb b/ext/libv8-node/extconf.rb index 20bc370..c2d97d3 100644 --- a/ext/libv8-node/extconf.rb +++ b/ext/libv8-node/extconf.rb @@ -1,6 +1,12 @@ # frozen_string_literal: true require 'mkmf' + +if RUBY_ENGINE == "truffleruby" + File.write("Makefile", dummy_makefile($srcdir).join("")) + return +end + create_makefile('libv8-node') require File.expand_path('location', __dir__)