Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to resolve type uint32_t with FFI #3981

djberg96 opened this issue Jun 27, 2016 · 6 comments

Unable to resolve type uint32_t with FFI #3981

djberg96 opened this issue Jun 27, 2016 · 6 comments


Copy link

djberg96 commented Jun 27, 2016

It seems there's no uint32_t or uint64_t for JRuby/FFI on OS X:


jruby (2.3.0) 2016-05-26 7357c8f Java HotSpot(TM) 64-Bit Server VM 25.45-b02 on 1.8.0_45-b14 +jit [darwin-x86_64]

Darwin Daniels-MacBook-Pro.local 15.5.0 Darwin Kernel Version 15.5.0: Tue Apr 19 18:36:36 PDT 2016; root:xnu-3248.50.21~8/RELEASE_X86_64 x86_64

ffi (1.9.10 java)

When running against some dev sys-proctable code I get this warning and error:

jruby: warning: unknown property jruby.cext.enabled
TypeError: unable to resolve type 'uint32_t'
Copy link

headius commented Jul 11, 2016

Oops. I believe @Lan5432 had been working on unifying the C ext FFI and JRuby's FFI but perhaps we never got to this point...

Copy link

headius commented Jul 11, 2016

FWIW we derive almost no functionality from the FFI gem. Most of JRuby's FFI support is built-in (because we need it at boot).

@headius headius added this to the JRuby milestone Jul 11, 2016
@headius headius added the ffi label Jul 11, 2016
Copy link

headius commented Aug 12, 2016

This is odd...the configuration files for FFI types appear to be inconsistent. Some define uint32_t and some only define __uint32_t.

lib/ffi/platform/aarch64-linux/types.conf:rbx.platform.typedef.__uint32_t = uint
lib/ffi/platform/arm-linux/types.conf:rbx.platform.typedef.__uint32_t = uint
lib/ffi/platform/i386-darwin/types.conf:rbx.platform.typedef.__uint32_t = uint
lib/ffi/platform/i386-freebsd/types.conf:rbx.platform.typedef.__uint32_t = uint
lib/ffi/platform/i386-freebsd/types.conf:rbx.platform.typedef.uint32_t = uint
lib/ffi/platform/i386-gnu/types.conf:rbx.platform.typedef.__uint32_t = uint
lib/ffi/platform/i386-linux/types.conf:rbx.platform.typedef.__uint32_t = uint
lib/ffi/platform/i386-netbsd/types.conf:rbx.platform.typedef.__uint32_t = uint
lib/ffi/platform/i386-netbsd/types.conf:rbx.platform.typedef.uint32_t = uint
lib/ffi/platform/i386-openbsd/types.conf:rbx.platform.typedef.__uint32_t = uint
lib/ffi/platform/i386-openbsd/types.conf:rbx.platform.typedef.uint32_t = uint
lib/ffi/platform/i386-solaris/types.conf:rbx.platform.typedef.uint32_t = uint
lib/ffi/platform/i386-windows/types.conf:rbx.platform.typedef.__uint32_t = uint
lib/ffi/platform/i386-windows/types.conf:rbx.platform.typedef.uint32_t = ulong
lib/ffi/platform/ia64-linux/types.conf:rbx.platform.typedef.__uint32_t = uint
lib/ffi/platform/mips-linux/types.conf:rbx.platform.typedef.__uint32_t = uint
lib/ffi/platform/mips64el-linux/types.conf:rbx.platform.typedef.__uint32_t = uint
lib/ffi/platform/mipsel-linux/types.conf:rbx.platform.typedef.__uint32_t = uint
lib/ffi/platform/powerpc-aix/types.conf:rbx.platform.typedef.uint32_t = uint
lib/ffi/platform/powerpc-darwin/types.conf:rbx.platform.typedef.__uint32_t = uint
lib/ffi/platform/powerpc-linux/types.conf:rbx.platform.typedef.__uint32_t = uint
lib/ffi/platform/powerpc64-linux/types.conf:rbx.platform.typedef.__uint32_t = uint
lib/ffi/platform/s390-linux/types.conf:rbx.platform.typedef.__uint32_t = uint
lib/ffi/platform/s390x-linux/types.conf:rbx.platform.typedef.__uint32_t = uint
lib/ffi/platform/sparc-linux/types.conf:rbx.platform.typedef.__uint32_t = uint
lib/ffi/platform/sparc-solaris/types.conf:rbx.platform.typedef.uint32_t = uint
lib/ffi/platform/sparcv9-solaris/types.conf:rbx.platform.typedef.uint32_t = uint
lib/ffi/platform/x86_64-darwin/types.conf:rbx.platform.typedef.__uint32_t = uint
lib/ffi/platform/x86_64-darwin/types.conf:rbx.platform.typedef.uint32_t = uint
lib/ffi/platform/x86_64-freebsd/types.conf:rbx.platform.typedef.__uint32_t = uint
lib/ffi/platform/x86_64-freebsd/types.conf:rbx.platform.typedef.uint32_t = uint
lib/ffi/platform/x86_64-linux/types.conf:rbx.platform.typedef.__uint32_t = uint
lib/ffi/platform/x86_64-netbsd/types.conf:rbx.platform.typedef.__uint32_t = uint
lib/ffi/platform/x86_64-netbsd/types.conf:rbx.platform.typedef.uint32_t = uint
lib/ffi/platform/x86_64-openbsd/types.conf:rbx.platform.typedef.__uint32_t = uint
lib/ffi/platform/x86_64-openbsd/types.conf:rbx.platform.typedef.uint32_t = uint
lib/ffi/platform/x86_64-solaris/types.conf:rbx.platform.typedef.uint32_t = uint

Given that uint32_t is a standard C type, I think it should be defined on all platforms.

Copy link

headius commented Aug 12, 2016

Ahh I see...our config differs in JRuby proper. I'll copy over the FFI ones and see what's different.

headius added a commit to headius/jruby that referenced this issue Aug 12, 2016
Copy link

headius commented Aug 12, 2016

@djberg96 If you could, please test out the branch in #4065 on whatever platforms you like :-)

headius added a commit that referenced this issue Aug 20, 2016
Update platform config files from FFI gem. See #3981
Copy link

headius commented Aug 20, 2016

Optimistically calling this one fixed.

@djberg96 Care to add an FFI spec to spec/ffi for the use that failed for you?

@headius headius closed this as completed Aug 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants