Skip to content

feat: support compilation with TruffleRuby#8

Merged
yoshoku merged 1 commit into
yoshoku:mainfrom
ankane:truffleruby
Feb 5, 2026
Merged

feat: support compilation with TruffleRuby#8
yoshoku merged 1 commit into
yoshoku:mainfrom
ankane:truffleruby

Conversation

@ankane

@ankane ankane commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

Purpose

Hi @yoshoku, this PR fixes a compilation error with TruffleRuby.

compiling ../../../../../ext/numo/narray/narray.c
../../../../../ext/numo/narray/narray.c: In function ‘nary_copy_flags’:
../../../../../ext/numo/narray/narray.c:855:3: error: implicit declaration of function ‘RBASIC’ [-Werror=implicit-function-declaration]
  855 |   RBASIC(dst)->flags |= (RBASIC(src)->flags) & (FL_USER1 | FL_USER2 | FL_USER3 | FL_USER4 |
      |   ^~~~~~
../../../../../ext/numo/narray/narray.c:855:14: error: invalid type argument of ‘->’ (have ‘int’)
  855 |   RBASIC(dst)->flags |= (RBASIC(src)->flags) & (FL_USER1 | FL_USER2 | FL_USER3 | FL_USER4 |
      |              ^~
../../../../../ext/numo/narray/narray.c:855:37: error: invalid type argument of ‘->’ (have ‘int’)
  855 |   RBASIC(dst)->flags |= (RBASIC(src)->flags) & (FL_USER1 | FL_USER2 | FL_USER3 | FL_USER4 |

Summary of Changes

Uses RBASIC_FLAGS and RBASIC_SET_FLAGS to access flags as recommended in truffleruby/truffleruby#3751.

Testing

  • Tests pass locally (with CRuby)
  • Manual testing completed

There are still 16 test failures with TruffleRuby, which can hopefully be addressed in future PRs (see the discussion in truffleruby/truffleruby#3751).

Related Issues

None

@ankane

ankane commented Feb 5, 2026

Copy link
Copy Markdown
Contributor Author

Also fixes this error on CI.

@yoshoku yoshoku merged commit 975f79d into yoshoku:main Feb 5, 2026
12 checks passed
@ankane

ankane commented Feb 5, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @yoshoku!

@yoshoku

yoshoku commented Feb 6, 2026

Copy link
Copy Markdown
Owner

@ankane Thank you for your contribution! I am not very familiar with TruffleRuby, so your help was greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants