jruby-launcher 1.1.10-java → 1.1.11-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 3b24c5f7f39dc16c443b3023c06d46d7c2aca8fad7b8a00df2edda6247d00873
4
- data.tar.gz: a5f8980eac3ecf0a8aa90f9bbae75263ffbe2fd789105c29a01abf4e9e62ad18
2
+ SHA1:
3
+ metadata.gz: 0df0a6555d52db18638a42846c682ec11d845ec4
4
+ data.tar.gz: e94a1ad4c0c9f5f4bb80cc33d3d063f9d3495ba8
5
5
  SHA512:
6
- metadata.gz: 48a8a233f7bdcf6ad4f9ed1356a5583222408913710715e6b270b9d65c005e55a89b48b6a7c94d255bdf895db592109ff5d72adbfe504ea84ad7f90b82729b20
7
- data.tar.gz: 0cbf35cfaed6b9ff60e4bd9cbfdde9dae18434ca4004ab983a13c0a29ff94f4f1cf5aad32f7b4f476efc8405b154cd58145065a50c2ebfd3ea79b0471cc4390c
6
+ metadata.gz: 64ef44c1a08fd07bf5d07d1c23f78d2d8af65cfa3dfed5d694f4bb7f545ddc5b4aff32b34ab458f4ac5ada50a6f6be938f8f9794cde9e2a35c6b34e4258752b1
7
+ data.tar.gz: 99cae0daa07fb6456fc70510ac10bcaeb1b892be5702a0399cc20236ceb4692d8d687310e9d558b110ba7bcfbd7b1671722b136be90556dcb9d609ecb0626e41
data/Makefile CHANGED
@@ -1,6 +1,8 @@
1
1
  # These line gets substituted with the actual Config::CONFIG items location by extconf.rb
2
2
  PREFIX = notspecified
3
3
  BINDIR = $(PREFIX)/bin
4
+ JRUBY_VERSION = notspecified
5
+ JRUBY_MODULE =
4
6
  INSTALLDIR = $(PREFIX)/lib/ruby/shared/rubygems/defaults
5
7
  INSTALLDIR9000 = $(PREFIX)/lib/ruby/stdlib/rubygems/defaults
6
8
  OLDINSTALLDIR = $(PREFIX)/lib/ruby/site_ruby/1.8/rubygems/defaults
@@ -498,12 +498,25 @@ void ArgParser::prepareOptions() {
498
498
  }
499
499
 
500
500
  if (useModulePath) {
501
- javaOptions.push_back("--add-opens");
502
- javaOptions.push_back("java.base/java.io=org.jruby.dist");
503
- javaOptions.push_back("--add-opens");
504
- javaOptions.push_back("java.base/java.nio.channels=org.jruby.dist");
505
- javaOptions.push_back("--add-opens");
506
- javaOptions.push_back("java.base/sun.nio.ch=org.jruby.dist");
501
+ string moduleOptsFile = platformDir + "/bin/.jruby.module_opts";
502
+ if (access(moduleOptsFile.c_str(), R_OK) == 0) {
503
+ logMsg("using @arguments file for Java module options");
504
+ javaOptions.push_back(string("@") + platformDir + "/bin/.jruby.module_opts");
505
+ } else {
506
+ // If .module_opts file is not detected, only add options if JRUBY_MODULE is defined.
507
+ // See extconf.rb for rules on which JRuby versions get JRUBY_MODULE.
508
+ #ifdef JRUBY_MODULE
509
+ logMsg("using hardcoded module options");
510
+ javaOptions.push_back("--add-opens");
511
+ javaOptions.push_back("java.base/java.io=org.jruby.dist");
512
+ javaOptions.push_back("--add-opens");
513
+ javaOptions.push_back("java.base/java.nio.channels=org.jruby.dist");
514
+ javaOptions.push_back("--add-opens");
515
+ javaOptions.push_back("java.base/sun.nio.ch=org.jruby.dist");
516
+ #else
517
+ logMsg("no JRuby module support detected, skipping module flags");
518
+ #endif
519
+ }
507
520
  }
508
521
 
509
522
  if (separateProcess) {
data/extconf.rb CHANGED
@@ -1,5 +1,13 @@
1
1
  mf = File.read('Makefile')
2
2
  mf = mf.gsub(/^BINDIR\s*=.*$/, "BINDIR = #{RbConfig::CONFIG['bindir']}")
3
3
  mf = mf.gsub(/^PREFIX\s*=.*$/, "PREFIX = #{File.dirname(RbConfig::CONFIG['libdir'])}")
4
+ mf = mf.gsub(/^JRUBY_VERSION\s*=.*$/, "JRUBY_VERSION = #{JRUBY_VERSION}")
5
+
6
+ # Launcher will use .module_opts file if present, otherwise hardcoded add-opens for this module.
7
+ # Pre-9.2.1: ALL-UNNAMED because no name was exported
8
+ # 9.2.1 and higher: org.jruby.dist
9
+ if JRUBY_VERSION !~ /(^1)|(9\.[01])|(9.2.0.0)/
10
+ mf = mf.gsub(/^JRUBY_MODULE\s*=.*$/, "JRUBY_MODULE = 1")
11
+ end
4
12
  puts mf
5
13
  File.open('Makefile', 'wb') {|f| f << mf}
@@ -71,3 +71,8 @@ ifneq (,$(findstring SunOS,$(CND_PLATFORM)))
71
71
  CFLAGS += -D__SUNOS__
72
72
  LDLIBSOPTIONS += -lsocket -lnsl
73
73
  endif
74
+
75
+ # define JRUBY_MODULE appropriately for target JRuby
76
+ ifeq (1,$(JRUBY_MODULE))
77
+ CFLAGS += -DJRUBY_MODULE=${JRUBY_MODULE}
78
+ endif
@@ -1,3 +1,3 @@
1
1
  module JRubyLauncher
2
- VERSION = "1.1.10"
2
+ VERSION = "1.1.11"
3
3
  end
data/version.h CHANGED
@@ -6,6 +6,6 @@
6
6
  #ifndef _VERSION_H_
7
7
  #define _VERSION_H_
8
8
 
9
- #define JRUBY_LAUNCHER_VERSION "1.1.10"
9
+ #define JRUBY_LAUNCHER_VERSION "1.1.11"
10
10
 
11
11
  #endif // ! _VERSION_H_
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jruby-launcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.10
4
+ version: 1.1.11
5
5
  platform: java
6
6
  authors:
7
7
  - Nick Sieger
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-09-11 00:00:00.000000000 Z
12
+ date: 2020-03-09 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Builds and installs a native launcher for JRuby on your system
15
15
  email:
@@ -39,11 +39,6 @@ files:
39
39
  - lib/rubygems/defaults/jruby_native.rb
40
40
  - nbexecloader.h
41
41
  - ng.c
42
- - pkg/jruby-launcher-1.1.9-java/extconf.rb
43
- - pkg/jruby-launcher-1.1.9-java/lib/jruby-launcher.rb
44
- - pkg/jruby-launcher-1.1.9-java/lib/rubygems/defaults/jruby_native.rb
45
- - pkg/jruby-launcher-1.1.9-java/spec/launcher_spec.rb
46
- - pkg/jruby-launcher-1.1.9-java/spec/spec_helper.rb
47
42
  - platformlauncher.cpp
48
43
  - platformlauncher.h
49
44
  - rb_w32_cmdvector.h
@@ -77,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
77
72
  version: '0'
78
73
  requirements: []
79
74
  rubyforge_project:
80
- rubygems_version: 2.7.9
75
+ rubygems_version: 2.6.14.1
81
76
  signing_key:
82
77
  specification_version: 4
83
78
  summary: Native launcher for JRuby
@@ -1,5 +0,0 @@
1
- mf = File.read('Makefile')
2
- mf = mf.gsub(/^BINDIR\s*=.*$/, "BINDIR = #{RbConfig::CONFIG['bindir']}")
3
- mf = mf.gsub(/^PREFIX\s*=.*$/, "PREFIX = #{File.dirname(RbConfig::CONFIG['libdir'])}")
4
- puts mf
5
- File.open('Makefile', 'wb') {|f| f << mf}
@@ -1,3 +0,0 @@
1
- module JRubyLauncher
2
- VERSION = "1.1.10"
3
- end
@@ -1,4 +0,0 @@
1
- class Gem::ConfigFile
2
- PLATFORM_DEFAULTS['install'] = '--no-rdoc --no-ri'
3
- PLATFORM_DEFAULTS['update'] = '--no-rdoc --no-ri'
4
- end
@@ -1,278 +0,0 @@
1
- require 'tmpdir'
2
- require File.expand_path('../spec_helper.rb', __FILE__)
3
- load File.expand_path('../../lib/jruby-launcher.rb', __FILE__)
4
-
5
- describe "JRuby native launcher" do
6
- it "should run org.jruby.Main" do
7
- jruby_launcher_args("").last.should == "org/jruby/Main"
8
- end
9
-
10
- it "should pass unrecognized arguments to JRuby" do
11
- jruby_launcher_args("-J-Dsome.option -v --help")[-3..-1].should == ["org/jruby/Main", "-v", "--help"]
12
- end
13
-
14
- it "should print help message" do
15
- args = jruby_launcher_args("-Xhelp 2>&1")
16
- args.select {|l| l =~ /JRuby Launcher usage/}.should_not be_empty
17
- args.should include("-X")
18
- args = jruby_launcher_args("-X 2>&1")
19
- args.detect {|l| l =~ /JRuby Launcher usage/}.should_not be_empty
20
- args.should include("-X")
21
- end
22
-
23
- it "should use $JAVACMD when JAVACMD is specified" do
24
- with_environment "JAVACMD" => File.join("jato") do
25
- if windows?
26
- jruby_launcher_args("-v 2>&1").join.should =~ %r{jato}
27
- else
28
- jruby_launcher_args("-v").first.should == File.join("jato")
29
- end
30
- end
31
- end
32
-
33
- it "should use $JAVA_HOME/bin/java when JAVA_HOME is specified" do
34
- with_environment "JAVA_HOME" => File.join("some", "java", "home") do
35
- if windows?
36
- jruby_launcher_args("-v 2>&1").join.should =~ %r{some/java/home}
37
- else
38
- jruby_launcher_args("-v").first.should == File.join("some", "java", "home", "bin", "java")
39
- end
40
- end
41
- end
42
-
43
- it "should use -Xjdkhome argument above JAVA_HOME" do
44
- with_environment "JAVA_HOME" => File.join("env", "java", "home") do
45
- if windows?
46
- jruby_launcher_args("-Xjdkhome some/java/home 2>&1").join.should =~ %r{some/java/home}
47
- else
48
- jruby_launcher_args("-Xjdkhome some/java/home").first.should == File.join("some", "java", "home", "bin", "java")
49
- end
50
- end
51
- end
52
-
53
- it "should drop the backslashes at the end of JAVA_HOME" do
54
- with_environment "JAVA_HOME" => File.join("some", "java", "home\\\\") do
55
- if windows?
56
- jruby_launcher_args("").join.should =~ %r{some/java/home}
57
- else
58
- jruby_launcher_args("").first.should == File.join("some", "java", "home", "bin", "java")
59
- end
60
- end
61
- end
62
-
63
- it "should complain about a missing log argument" do
64
- jruby_launcher("-Xtrace 2>&1").should =~ /Argument is missing for "-Xtrace"/
65
- jruby_launcher("-Xtrace -- 2>&1").should =~ /Argument is missing for "-Xtrace"/
66
- end
67
-
68
- it "should complain about a missing jdkhome argument" do
69
- jruby_launcher("-Xjdkhome 2>&1").should =~ /Argument is missing/
70
- jruby_launcher("-Xjdkhome -- 2>&1").should =~ /Argument is missing/
71
- end
72
-
73
- it "should complain about a missing classpath append argument" do
74
- jruby_launcher("-Xcp:a 2>&1").should =~ /Argument is missing/
75
- jruby_launcher("-Xcp:a -- 2>&1").should =~ /Argument is missing/
76
- end
77
-
78
- it "should run nailgun server with --ng-server option" do
79
- jruby_launcher_args("--ng-server").last.should == "com/martiansoftware/nailgun/NGServer"
80
- end
81
-
82
- it "should run nailgun client with --ng option" do
83
- jruby_launcher_args('--ng -e "puts 1"').should == ["org.jruby.util.NailMain", "-e", "puts 1"]
84
- end
85
-
86
- it "should handle -J JVM options" do
87
- jruby_launcher_args("-J-Darg1=value1 -J-Darg2=value2").should include("-Darg1=value1", "-Darg2=value2")
88
- end
89
-
90
- it "should pass -Xprop.erty=value as -J-Djruby.prop.erty=value" do
91
- jruby_launcher_args("-Xprop.erty=value").should include("-Djruby.prop.erty=value")
92
- end
93
-
94
- it "should pass -Xproperties as --properties" do
95
- jruby_launcher_args("-Xproperties").should include("--properties")
96
- end
97
-
98
- it "should allow max heap to be overridden" do
99
- jruby_launcher_args("-J-Xmx256m").should include("-Xmx256m")
100
- end
101
-
102
- it "should default to 2048k max stack" do
103
- jruby_launcher_args("").should include("-Xss2048k")
104
- end
105
-
106
- it "should allow max stack to be overridden" do
107
- jruby_launcher_args("-J-Xss512k").should include("-Xss512k")
108
- end
109
-
110
- it "should add the contents of the CLASSPATH environment variable" do
111
- with_environment "CLASSPATH" => "some.jar" do
112
- classpath_arg(jruby_launcher_args("")).should =~ /some.jar/
113
- end
114
- end
115
-
116
- it "should add the classpath elements in proper order" do
117
- s = File::PATH_SEPARATOR
118
- with_environment "CLASSPATH" => "some-env.jar" do
119
- args = jruby_launcher_args("-Xcp:a some-other.jar -Xcp:p some.jar")
120
- classpath_arg(args).should =~ /some.jar.*#{s}some-env.jar#{s}some-other.jar/
121
- end
122
- end
123
-
124
- it "should use the --server compiler" do
125
- jruby_launcher_args("--server").should include("-server")
126
- end
127
-
128
- it "should use the --client compiler" do
129
- jruby_launcher_args("--client").should include("-client")
130
- end
131
-
132
- it "should set the JMX settings when --manage is present" do
133
- jruby_launcher_args("--manage").should include("-Dcom.sun.management.jmxremote", "-Djruby.management.enabled=true")
134
- end
135
-
136
- it "should set the headless flag when --headless is present" do
137
- jruby_launcher_args("--headless").should include("-Djava.awt.headless=true")
138
- end
139
-
140
- it "should pass -Xprof when --sample is present" do
141
- jruby_launcher_args("--sample").should include("-Xprof")
142
- end
143
-
144
- it "should stop argument processing when a -- is seen" do
145
- jruby_launcher_args("-- -Xhelp -Xtrace --headless").should include("-Xhelp", "-Xtrace", "--headless")
146
- end
147
-
148
- # JRUBY-4151
149
- it "should properly handle single quotes" do
150
- jruby_launcher_args("-e 'ABC DEF'").should include("ABC DEF")
151
- end
152
-
153
- # JRUBY-4581
154
- it "should prepend JRUBY_OPTS to the start of the argument list to process" do
155
- with_environment "JRUBY_OPTS" => "--server -J-Dsome.key=val -rubygems" do
156
- jruby_launcher_args("-e 'ABC DEF'").should include("-server", "-Dsome.key=val", "-rubygems", "-e", "ABC DEF")
157
- end
158
- end
159
-
160
- # JRUBY-4611
161
- it "stops argument processing on first non-option argument" do
162
- jruby_launcher_args("foo.rb --sample")[-2..-1].should == ["foo.rb", "--sample"]
163
- end
164
-
165
- # JRUBY-4608
166
- if RbConfig::CONFIG['target_os'] =~ /darwin/i
167
- it "includes file.encoding=UTF-8 on Mac if JAVA_ENCODING is not set" do
168
- jruby_launcher_args("-e true").should include("-Dfile.encoding=UTF-8")
169
- with_environment "JAVA_ENCODING" => "MacRoman" do
170
- jruby_launcher_args("-e true").should_not include("-Dfile.encoding=UTF-8")
171
- end
172
- end
173
- end
174
-
175
- it "does not crash on empty args" do
176
- jruby_launcher_args("-e ''").should include("-e")
177
- jruby_launcher("-Xtrace '' 2>&1").should =~ /-Xtrace/
178
- jruby_launcher("-Xjdkhome '' 2>&1").should =~ /-Xjdkhome/
179
- end
180
-
181
- # JRUBY-4706
182
- it "should put JRuby on regular classpath when -Xnobootclasspath is used" do
183
- args = jruby_launcher_args("-e true")
184
- args.grep(/Xbootclasspath/).should_not be_empty
185
- args = jruby_launcher_args("-Xnobootclasspath -e true")
186
- args.grep(/Xbootclasspath/).should be_empty
187
- end
188
-
189
- it "should put JRuby on regular classpath when VERIFY_JRUBY is set" do
190
- with_environment "VERIFY_JRUBY" => "true" do
191
- args = jruby_launcher_args("-e true")
192
- args.grep(/Xbootclasspath/).should be_empty
193
- end
194
- end
195
-
196
- # JRUBY-4709
197
- it "should include a bare : or ; at the end of the classpath, to include PWD in the path" do
198
- classpath_arg(jruby_launcher_args("-Xnobootclasspath -e true")).should =~
199
- if windows?
200
- /;$/
201
- else
202
- /:$/
203
- end
204
- end
205
-
206
- # JRUBY-6016
207
- it "should honor JAVA_MEM" do
208
- with_environment "JAVA_MEM" => "-Xmx768m" do
209
- jruby_launcher_args("").should include("-Xmx768m")
210
- end
211
- end
212
-
213
- it "should honor JAVA_STACK" do
214
- with_environment "JAVA_STACK" => "-Xss3072k" do
215
- jruby_launcher_args("").should include("-Xss3072k")
216
- end
217
- end
218
-
219
- it "should honor JRUBY_HOME" do
220
- with_environment "JRUBY_HOME" => "/tmp" do
221
- jruby_launcher_args("").should include("-Djruby.home=/tmp")
222
- end
223
- end
224
-
225
- context "JRUBY_HOME set and JRUBY_HOME/lib/jruby.jar exists" do
226
- let(:jruby_home) do
227
- require 'tempfile'
228
- t = Tempfile.new("jruby_home")
229
- t.path.tap { t.close! }
230
- end
231
-
232
- before do
233
- FileUtils.mkdir_p(File.join(jruby_home, "lib"))
234
- FileUtils.touch(File.join(jruby_home, "lib", "jruby.jar"))
235
- end
236
- after { FileUtils.rm_rf jruby_home }
237
-
238
- it "should add jruby.jar to the bootclasspath" do
239
- with_environment "JRUBY_HOME" => jruby_home do
240
- jruby_launcher_args("").should include("-Xbootclasspath/a:#{jruby_home}/lib/jruby.jar")
241
- end
242
- end
243
- end
244
-
245
- it "should place user-supplied options after default options" do
246
- args = jruby_launcher_args("-J-Djruby.home=/tmp")
247
- home_args = args.select {|x| x =~ /^-Djruby\.home/ }
248
- home_args.length.should == 2
249
- home_args.last.should == "-Djruby.home=/tmp"
250
- end
251
-
252
- it "should print the version" do
253
- jruby_launcher("-Xversion 2>&1").should =~ /Launcher Version #{JRubyLauncher::VERSION}/
254
- end
255
-
256
- it "should not crash on format-strings" do
257
- jruby_launcher_args("-e %s%s%s%s%s 2>&1").should include('-e', '%s%s%s%s%s')
258
- end
259
-
260
- it "should use --module-path on java9+" do
261
- Dir.mktmpdir do |java_home|
262
- Dir.mkdir(File.join(java_home, 'jmods'))
263
- with_environment 'JAVA_HOME' => java_home do
264
- jruby_launcher_args('').grep(/^--module-path=.*jruby.jar/).should_not be_empty
265
- end
266
- end
267
- end
268
-
269
- it "should not treat CLASSPATH entries as modules on java9+" do
270
- Dir.mktmpdir do |java_home|
271
- Dir.mkdir(File.join(java_home, 'jmods'))
272
- with_environment 'JAVA_HOME' => java_home, 'CLASSPATH' => '/some/lib.jar' do
273
- jruby_launcher_args('').grep(/^--module-path=.*\/some\/lib.jar/).should be_empty
274
- classpath_arg(jruby_launcher_args('')).should =~ /\/some\/lib.jar/
275
- end
276
- end
277
- end
278
- end
@@ -1,81 +0,0 @@
1
- require 'rspec'
2
- require 'rbconfig'
3
- require 'fileutils'
4
-
5
- if defined?(JRUBY_VERSION)
6
- require 'jruby'
7
- JRuby.runtime.instance_config.run_ruby_in_process = false
8
- end
9
-
10
- module JRubyLauncherHelper
11
- JRUBY_EXE = ''
12
- WINDOWS = RbConfig::CONFIG['target_os'] =~ /mswin/
13
-
14
- def self.check_executable_built
15
- exe = File.expand_path("../../jruby", __FILE__) + RbConfig::CONFIG['EXEEXT']
16
- unless File.executable?(exe)
17
- raise "Error: launcher executable not built; type `make' before continuing."
18
- end
19
- top = File.dirname(exe)
20
- name = File.basename(exe)
21
- home = File.join(top, "build/home")
22
- FileUtils.mkdir_p(File.join(home, "bin"))
23
- FileUtils.cp(exe, File.join(home, "bin"))
24
- if JRubyLauncherHelper::WINDOWS
25
- FileUtils.cp(exe.sub(/exe/, 'dll'), File.join(home, "bin"))
26
- end
27
- FileUtils.mkdir_p(File.join(home, "lib"))
28
- FileUtils.touch(File.join(home, "lib/jruby.jar"))
29
- JRUBY_EXE.concat File.join(home, "bin", name)
30
- end
31
-
32
- def jruby_launcher(args)
33
- `#{JRUBY_EXE} #{args}`
34
- end
35
-
36
- def jruby_launcher_args(args)
37
- jruby_launcher("-Xcommand #{args}").split("\n")
38
- end
39
-
40
- def last_exit_code
41
- $?.exitstatus
42
- end
43
-
44
- def windows?
45
- WINDOWS
46
- end
47
-
48
- def classpath_arg(args)
49
- index = args.index("-cp")
50
- index.should > 0
51
- args[index + 1]
52
- end
53
-
54
- def with_environment(pairs = {})
55
- prev_env = {}
56
- pairs.each_pair do |k,v|
57
- prev_env[k] = ENV[k] if ENV.has_key?(k)
58
- ENV[k] = v
59
- end
60
- begin
61
- yield
62
- ensure
63
- pairs.keys.each {|k| ENV.delete(k)}
64
- ENV.update(prev_env)
65
- end
66
- end
67
- end
68
-
69
- RSpec.configure do |config|
70
- config.before(:all) do
71
- JRubyLauncherHelper.check_executable_built
72
- # clear environment for better control
73
- ENV.delete("JAVA_HOME")
74
- ENV.delete("JRUBY_HOME")
75
- ENV.delete("JAVA_OPTS")
76
- ENV.delete("JRUBY_OPTS")
77
- ENV.delete("CLASSPATH")
78
- ENV.delete("JAVA_ENCODING")
79
- end
80
- config.include(JRubyLauncherHelper)
81
- end