Unable to resolve type uint32_t with FFI #3981

Closed
djberg96 opened this Issue Jun 27, 2016 · 6 comments

Comments

Projects
None yet
2 participants
@djberg96
Contributor

djberg96 commented Jun 27, 2016

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

Environment

jruby 9.1.2.0 (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'
@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Jul 11, 2016

Member

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...

Member

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...

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Jul 11, 2016

Member

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).

Member

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 9.1.3.0 milestone Jul 11, 2016

@headius headius added the ffi label Jul 11, 2016

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Aug 12, 2016

Member

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.

Member

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.

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Aug 12, 2016

Member

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

Member

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

@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Aug 12, 2016

Member

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

Member

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

Merge pull request #4065 from headius/update_ffi_confs
Update platform config files from FFI gem. See jruby/jruby#3981
@headius

This comment has been minimized.

Show comment
Hide comment
@headius

headius Aug 20, 2016

Member

Optimistically calling this one fixed.

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

Member

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 Aug 20, 2016

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