File tree Expand file tree Collapse file tree 1 file changed +19
-12
lines changed
Expand file tree Collapse file tree 1 file changed +19
-12
lines changed Original file line number Diff line number Diff line change 1111 WARNING: See https://github.com/rbenv/ruby-build/pull/2517 for more details.
1212 MSG
1313
14+ # write a dummy makefile so no executable is built
15+ File . write ( "Makefile" , dummy_makefile ( $srcdir) . join ( "" ) )
16+
1417 # extconf.rb runs in a captured subprocess, so the only way to output is via /dev/tty
15- if File . exist? ( "/dev/tty" ) && File . writable? ( "/dev/tty" )
16- error << <<~MSG
17- WARNING:
18- WARNING: The native jruby executable has not been installed.
19- MSG
20- File . write ( "/dev/tty" , error )
21- else
22- # /dev/tty is not available, so write to stderr and raise
23- $stderr. write ( error )
24- raise
18+ begin
19+ if File . exist? ( "/dev/tty" ) && File . writable? ( "/dev/tty" )
20+ long_error = error + <<~MSG
21+ WARNING:
22+ WARNING: The native jruby executable has not been installed.
23+ MSG
24+ File . write ( "/dev/tty" , long_error )
25+ return
26+ end
27+ rescue Errno ::ENXIO
28+ # JRuby versions prior to 10 can't always open /dev/tty
29+ # Ignore and fail the install below
2530 end
26- File . write ( "Makefile" , dummy_makefile ( $srcdir) . join ( "" ) )
27- return
31+
32+ # /dev/tty is not available, so write to stderr and raise
33+ $stderr. write ( error )
34+ raise Errno ::ENOENT , "jruby.sh"
2835end
2936
3037# jruby.sh exists, proceed to build
You can’t perform that action at this time.
0 commit comments