Skip to content

Commit

Permalink
Consider truffleruby as supported for yaml/json compile cache
Browse files Browse the repository at this point in the history
Tests pass with 21 less skips.

This improves the speed of `Faker::Config.locale` on truffleruby by over 50%.

This moves truffleruby from "minimal" to the full suite in CI.
  • Loading branch information
rwstauner committed Jun 30, 2023
1 parent c00c81c commit d0d0d07
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu]
ruby: ['2.6', '2.7', '3.0', '3.1', '3.2', 'ruby-head', 'debug']
ruby: ['2.6', '2.7', '3.0', '3.1', '3.2', 'ruby-head', 'debug', 'truffleruby']
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu]
ruby: ['jruby', 'truffleruby']
ruby: ['jruby']
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Unreleased

* Support YAML and JSON CompileCache on TruffleRuby.

# 1.16.0

* Use `RbConfig::CONFIG["rubylibdir"]` instead of `RbConfig::CONFIG["libdir"]` to check for stdlib files. See #431.
Expand Down
2 changes: 1 addition & 1 deletion ext/bootsnap/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

require("mkmf")

if RUBY_ENGINE == "ruby"
if %w[ruby truffleruby].include?(RUBY_ENGINE)
$CFLAGS << " -O3 "
$CFLAGS << " -std=c99"

Expand Down
2 changes: 1 addition & 1 deletion lib/bootsnap/compile_cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def self.permission_error(path)

def self.supported?
# only enable on 'ruby' (MRI), POSIX (darwin, linux, *bsd), Windows (RubyInstaller2) and >= 2.3.0
RUBY_ENGINE == "ruby" && RUBY_PLATFORM.match?(/darwin|linux|bsd|mswin|mingw|cygwin/)
%w[ruby truffleruby].include?(RUBY_ENGINE) && RUBY_PLATFORM.match?(/darwin|linux|bsd|mswin|mingw|cygwin/)
end
end
end

0 comments on commit d0d0d07

Please sign in to comment.