JRuby

Fcntl module not working

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: JRuby 1.1.6
  • Fix Version/s: JRuby 1.3
  • Component/s: Core Classes/Modules
  • Labels:
    None
  • Environment:
    Macosx 10.5, java version "1.5.0_16", Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284)
  • Number of attachments :
    1

Description

Using the following ruby file which is the shortest case I could find to reproduce the issue I originally had when running Puppet with JRuby:

r.rb:
require 'fcntl'
puts "F_SETFD: %s" % Fcntl::F_SETFD

On original ruby 1.8.7 or 1.8.6, the following is printed:
FD: 2

On JRuby 1.1.6:
fcntl:1:in `const_missing': uninitialized constant Fcntl::F_SETFD (NameError)
from /tmp/r.rb:3

The fcntl file exists in the installation directory as FFI. It seems to be available to the architecture on which I run JRuby, but for some unknown reason the file doesn't seem to be loaded.

Activity

Hide
Charles Oliver Nutter added a comment -

Ok, I modified fcntl to now load all constants correctly, using our FFI-based logic for getting those constants. Can you submit some specs to RubySpec that check for the presence of those constants, so we can keep them working in the future?

Show
Charles Oliver Nutter added a comment - Ok, I modified fcntl to now load all constants correctly, using our FFI-based logic for getting those constants. Can you submit some specs to RubySpec that check for the presence of those constants, so we can keep them working in the future?
Hide
Charles Oliver Nutter added a comment -

Marking for 1.3 to hook up tests/specs, though the fcntl rewiring is in already 1.3RC1.

Show
Charles Oliver Nutter added a comment - Marking for 1.3 to hook up tests/specs, though the fcntl rewiring is in already 1.3RC1.
Hide
Charles Oliver Nutter added a comment -

Wayne had to back this out, but will be wiring up a better version using Constantine constants. Still should be in 1.3, and I think there will be specs coming from another source.

Show
Charles Oliver Nutter added a comment - Wayne had to back this out, but will be wiring up a better version using Constantine constants. Still should be in 1.3, and I think there will be specs coming from another source.
Hide
Charles Oliver Nutter added a comment -

I added the new Fcntl support (using Wayne's nicely-wired Constantine stuff) in b15402d92. All the constants appear to be there now...looking good. Since Constantine release is already out, this should be ready to go (please confirm Constantine release is out.

Show
Charles Oliver Nutter added a comment - I added the new Fcntl support (using Wayne's nicely-wired Constantine stuff) in b15402d92. All the constants appear to be there now...looking good. Since Constantine release is already out, this should be ready to go (please confirm Constantine release is out.
Hide
Charles Oliver Nutter added a comment -

Constantine is released (0.6).

Show
Charles Oliver Nutter added a comment - Constantine is released (0.6).

People

Vote (1)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: