Closed fetep closed 11 years ago
spec/fpm/package/deb_spec.rb
doesn't pass with jruby-1.6.8 or jruby-1.7.0.
Looks like a problem with errno thrown by File.link
as reported to jruby https://github.com/jruby/jruby/issues/409.
Methods in lib/fpm/package/dir.rb
depend on errno exceptions to be thrown correctly.
The File.link
problems are resolved in 1.7.3. fpm uses the open4 gem which uses fork()
,
fork()
isn't available on jruby. An enhancement to open4 to support jruby or make fpm use
a more portable gem/method.
Any chance something like spoon could be used to work around this on JRuby? I ran into the same issue when trying to build and package logstash from source with fpm-cookery.
This commit may fix the issue. Just committed, and currently only tested on JRuby 1.7.3, and even then, only briefly. Have yet to confirm result of specs, etc, and command output is currently not preserved or logged in any way. this seems to show how to attempt to preserve that, but it's a bit beyond my grasp just yet. Once this seems to be remotely sane and usable, I can gladly open a pull.
I'm also open to making this be a condition of the platform, if needed.
Yeah we can totally do this with spoon, I'm sure. I dont' want to lose the logging though, so If you don't, I'll take a look at doing dup2 in spawn with FileActions
@jordansissel spent some time on this last night, but I'm having a hard time using dup2() to duplicate a Ruby filehandle to anything inside of a Spoon::FileActions object, which I presume is related to the JVM virtual filehandles that helped start this whole mess. Any suggestions you could provide for wiring the posix_spawnp()'d process's STDIN and STDOUT into cabin is appreciated.
same fpm command works fine with regular 1.8 and 1.9 ruby.