fix(ruby)

closes #4696

--yjit in 3.1.0-dev
fix [[maybe_unused]] build issues on linux
This commit is contained in:
Jacob Heider 2024-01-04 18:16:56 -05:00 committed by Jacob Heider
parent 8a2c01eec2
commit 291c38f095

View file

@ -28,6 +28,12 @@ build:
- ./configure $ARGS - ./configure $ARGS
# clang17 doesn't like [[maybe_unused]] on types
# fix cribbed from https://github.com/ruby/ruby/pull/4603/commits/fbdff085ef3c8a56e0a33404e8795879e3167549
- run: sed -i -e 's/elif RBIMPL_HAS_C_ATTRIBUTE(maybe_unused)/elif RBIMPL_HAS_C_ATTRIBUTE(maybe_unused) \&\& (__STDC_VERSION__ >= 202000L)/' maybe_unused.h
if: linux
working-directory: include/ruby/internal/attr
- make --jobs {{hw.concurrency}} install - make --jobs {{hw.concurrency}} install
# we provide these as `rubygems.org` # we provide these as `rubygems.org`
@ -99,8 +105,7 @@ test:
# - echo 'puts 1' | irb # - echo 'puts 1' | irb
# tests the libraries that come with Ruby can be utilized # tests the libraries that come with Ruby can be utilized
- run: - run: ruby $FIXTURE
ruby $FIXTURE
fixture: fixture:
content: | content: |
require 'date' require 'date'
@ -108,8 +113,7 @@ test:
extname: rb extname: rb
# tests the gems that come with Ruby can be utilized # tests the gems that come with Ruby can be utilized
- run: - run: ruby $FIXTURE
ruby $FIXTURE
fixture: fixture:
content: | content: |
require 'matrix' require 'matrix'
@ -121,9 +125,8 @@ test:
puts "Determinant of the matrix: #{determinant}" puts "Determinant of the matrix: #{determinant}"
extname: rb extname: rb
- run: - run: ruby --yjit $FIXTURE
ruby --yjit $FIXTURE if: ^3.1
if: ^3
fixture: fixture:
content: | content: |
def fib(n) def fib(n)