passenger 5.0.0.beta3 → 5.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (218) hide show
  1. checksums.yaml +8 -8
  2. checksums.yaml.gz.asc +7 -7
  3. data.tar.gz.asc +7 -7
  4. data/.editorconfig +11 -5
  5. data/CHANGELOG +38 -0
  6. data/CONTRIBUTING.md +1 -4
  7. data/Gemfile +0 -1
  8. data/Gemfile.lock +0 -2
  9. data/Rakefile +33 -33
  10. data/bin/passenger +1 -1
  11. data/bin/passenger-config +1 -1
  12. data/bin/passenger-install-apache2-module +800 -800
  13. data/bin/passenger-install-nginx-module +592 -592
  14. data/bin/passenger-memory-stats +127 -127
  15. data/bin/passenger-status +216 -216
  16. data/build/agents.rb +127 -127
  17. data/build/apache2.rb +87 -87
  18. data/build/basics.rb +60 -60
  19. data/build/common_library.rb +165 -165
  20. data/build/cplusplus_support.rb +51 -51
  21. data/build/cxx_tests.rb +268 -268
  22. data/build/debian.rb +143 -143
  23. data/build/documentation.rb +58 -58
  24. data/build/integration_tests.rb +81 -81
  25. data/build/misc.rb +132 -132
  26. data/build/nginx.rb +20 -20
  27. data/build/node_tests.rb +7 -7
  28. data/build/oxt_tests.rb +14 -14
  29. data/build/packaging.rb +570 -570
  30. data/build/preprocessor.rb +260 -260
  31. data/build/rake_extensions.rb +71 -71
  32. data/build/ruby_extension.rb +29 -29
  33. data/build/ruby_tests.rb +6 -6
  34. data/build/test_basics.rb +37 -37
  35. data/debian.template/control.template +3 -5
  36. data/dev/copy_boost_headers +134 -134
  37. data/dev/install_scripts_bootstrap_code.rb +25 -25
  38. data/dev/list_tests +20 -20
  39. data/dev/ruby_server.rb +223 -223
  40. data/dev/runner +18 -18
  41. data/doc/ServerOptimizationGuide.txt.md +55 -2
  42. data/doc/Users guide Nginx.txt +0 -26
  43. data/doc/Users guide Standalone.txt +5 -1
  44. data/doc/users_guide_snippets/tips.txt +9 -0
  45. data/ext/common/ApplicationPool2/Group.h +23 -11
  46. data/ext/common/ApplicationPool2/Implementation.cpp +32 -7
  47. data/ext/common/ApplicationPool2/Pool.h +22 -17
  48. data/ext/common/ApplicationPool2/SmartSpawner.h +4 -1
  49. data/ext/common/ApplicationPool2/Spawner.h +1 -1
  50. data/ext/common/Constants.h +1 -1
  51. data/ext/common/agents/Base.cpp +35 -20
  52. data/ext/common/agents/HelperAgent/Main.cpp +8 -1
  53. data/ext/common/agents/HelperAgent/OptionParser.h +18 -4
  54. data/ext/common/agents/HelperAgent/RequestHandler.h +2 -83
  55. data/ext/common/agents/HelperAgent/RequestHandler/ForwardResponse.cpp +54 -1
  56. data/ext/common/agents/HelperAgent/RequestHandler/InitRequest.cpp +7 -4
  57. data/ext/common/agents/Main.cpp +1 -1
  58. data/ext/common/agents/Watchdog/Main.cpp +54 -19
  59. data/ext/nginx/Configuration.c +7 -0
  60. data/ext/nginx/ContentHandler.c +9 -1
  61. data/helper-scripts/backtrace-sanitizer.rb +106 -87
  62. data/helper-scripts/crash-watch.rb +32 -0
  63. data/helper-scripts/download_binaries/extconf.rb +38 -38
  64. data/helper-scripts/meteor-loader.rb +107 -107
  65. data/helper-scripts/prespawn +101 -101
  66. data/helper-scripts/rack-loader.rb +96 -96
  67. data/helper-scripts/rack-preloader.rb +137 -137
  68. data/lib/phusion_passenger.rb +292 -292
  69. data/lib/phusion_passenger/abstract_installer.rb +438 -438
  70. data/lib/phusion_passenger/active_support3_extensions/init.rb +168 -170
  71. data/lib/phusion_passenger/admin_tools.rb +20 -20
  72. data/lib/phusion_passenger/admin_tools/instance.rb +178 -178
  73. data/lib/phusion_passenger/admin_tools/instance_registry.rb +61 -61
  74. data/lib/phusion_passenger/admin_tools/memory_stats.rb +267 -267
  75. data/lib/phusion_passenger/apache2/config_options.rb +182 -182
  76. data/lib/phusion_passenger/common_library.rb +479 -485
  77. data/lib/phusion_passenger/config/about_command.rb +161 -161
  78. data/lib/phusion_passenger/config/admin_command_command.rb +129 -129
  79. data/lib/phusion_passenger/config/agent_compiler.rb +121 -121
  80. data/lib/phusion_passenger/config/build_native_support_command.rb +43 -43
  81. data/lib/phusion_passenger/config/command.rb +25 -25
  82. data/lib/phusion_passenger/config/compile_agent_command.rb +62 -62
  83. data/lib/phusion_passenger/config/compile_nginx_engine_command.rb +88 -73
  84. data/lib/phusion_passenger/config/detach_process_command.rb +72 -72
  85. data/lib/phusion_passenger/config/download_agent_command.rb +246 -227
  86. data/lib/phusion_passenger/config/download_nginx_engine_command.rb +245 -224
  87. data/lib/phusion_passenger/config/install_agent_command.rb +144 -132
  88. data/lib/phusion_passenger/config/install_standalone_runtime_command.rb +205 -185
  89. data/lib/phusion_passenger/config/installation_utils.rb +204 -204
  90. data/lib/phusion_passenger/config/list_instances_command.rb +64 -64
  91. data/lib/phusion_passenger/config/main.rb +152 -152
  92. data/lib/phusion_passenger/config/nginx_engine_compiler.rb +319 -300
  93. data/lib/phusion_passenger/config/reopen_logs_command.rb +67 -67
  94. data/lib/phusion_passenger/config/restart_app_command.rb +155 -155
  95. data/lib/phusion_passenger/config/system_metrics_command.rb +13 -13
  96. data/lib/phusion_passenger/config/utils.rb +95 -95
  97. data/lib/phusion_passenger/config/validate_install_command.rb +198 -198
  98. data/lib/phusion_passenger/console_text_template.rb +25 -25
  99. data/lib/phusion_passenger/constants.rb +90 -90
  100. data/lib/phusion_passenger/debug_logging.rb +106 -106
  101. data/lib/phusion_passenger/loader_shared_helpers.rb +447 -432
  102. data/lib/phusion_passenger/message_channel.rb +312 -312
  103. data/lib/phusion_passenger/message_client.rb +176 -176
  104. data/lib/phusion_passenger/native_support.rb +369 -369
  105. data/lib/phusion_passenger/nginx/config_options.rb +297 -297
  106. data/lib/phusion_passenger/packaging.rb +131 -131
  107. data/lib/phusion_passenger/platform_info.rb +360 -360
  108. data/lib/phusion_passenger/platform_info/apache.rb +767 -767
  109. data/lib/phusion_passenger/platform_info/apache_detector.rb +199 -199
  110. data/lib/phusion_passenger/platform_info/binary_compatibility.rb +107 -107
  111. data/lib/phusion_passenger/platform_info/compiler.rb +570 -570
  112. data/lib/phusion_passenger/platform_info/curl.rb +32 -32
  113. data/lib/phusion_passenger/platform_info/cxx_portability.rb +188 -188
  114. data/lib/phusion_passenger/platform_info/depcheck.rb +372 -372
  115. data/lib/phusion_passenger/platform_info/depcheck_specs/apache2.rb +109 -109
  116. data/lib/phusion_passenger/platform_info/depcheck_specs/compiler_toolchain.rb +4 -4
  117. data/lib/phusion_passenger/platform_info/depcheck_specs/gems.rb +10 -34
  118. data/lib/phusion_passenger/platform_info/depcheck_specs/libs.rb +101 -101
  119. data/lib/phusion_passenger/platform_info/depcheck_specs/ruby.rb +5 -5
  120. data/lib/phusion_passenger/platform_info/depcheck_specs/utilities.rb +13 -13
  121. data/lib/phusion_passenger/platform_info/linux.rb +55 -55
  122. data/lib/phusion_passenger/platform_info/operating_system.rb +149 -149
  123. data/lib/phusion_passenger/platform_info/ruby.rb +468 -448
  124. data/lib/phusion_passenger/platform_info/zlib.rb +9 -9
  125. data/lib/phusion_passenger/plugin.rb +66 -66
  126. data/lib/phusion_passenger/preloader_shared_helpers.rb +126 -126
  127. data/lib/phusion_passenger/public_api.rb +191 -191
  128. data/lib/phusion_passenger/rack/out_of_band_gc.rb +93 -94
  129. data/lib/phusion_passenger/rack/thread_handler_extension.rb +231 -227
  130. data/lib/phusion_passenger/request_handler.rb +567 -577
  131. data/lib/phusion_passenger/request_handler/thread_handler.rb +379 -381
  132. data/lib/phusion_passenger/ruby_core_enhancements.rb +86 -86
  133. data/lib/phusion_passenger/ruby_core_io_enhancements.rb +74 -74
  134. data/lib/phusion_passenger/simple_benchmarking.rb +25 -25
  135. data/lib/phusion_passenger/standalone/app_finder.rb +153 -150
  136. data/lib/phusion_passenger/standalone/command.rb +44 -40
  137. data/lib/phusion_passenger/standalone/config_utils.rb +53 -53
  138. data/lib/phusion_passenger/standalone/control_utils.rb +38 -59
  139. data/lib/phusion_passenger/standalone/main.rb +73 -73
  140. data/lib/phusion_passenger/standalone/start_command.rb +697 -685
  141. data/lib/phusion_passenger/standalone/start_command/builtin_engine.rb +193 -155
  142. data/lib/phusion_passenger/standalone/start_command/nginx_engine.rb +162 -133
  143. data/lib/phusion_passenger/standalone/status_command.rb +64 -64
  144. data/lib/phusion_passenger/standalone/stop_command.rb +72 -72
  145. data/lib/phusion_passenger/standalone/version_command.rb +9 -9
  146. data/lib/phusion_passenger/union_station/connection.rb +32 -32
  147. data/lib/phusion_passenger/union_station/core.rb +251 -251
  148. data/lib/phusion_passenger/union_station/transaction.rb +126 -126
  149. data/lib/phusion_passenger/utils.rb +199 -167
  150. data/lib/phusion_passenger/utils/ansi_colors.rb +128 -128
  151. data/lib/phusion_passenger/utils/download.rb +196 -196
  152. data/lib/phusion_passenger/utils/file_system_watcher.rb +158 -158
  153. data/lib/phusion_passenger/utils/hosts_file_parser.rb +101 -101
  154. data/lib/phusion_passenger/utils/lock.rb +31 -31
  155. data/lib/phusion_passenger/utils/native_support_utils.rb +31 -31
  156. data/lib/phusion_passenger/utils/progress_bar.rb +26 -26
  157. data/lib/phusion_passenger/utils/shellwords.rb +20 -20
  158. data/lib/phusion_passenger/utils/terminal_choice_menu.rb +206 -206
  159. data/lib/phusion_passenger/utils/unseekable_socket.rb +272 -272
  160. data/lib/phusion_passenger/vendor/crash_watch/app.rb +129 -0
  161. data/lib/phusion_passenger/vendor/crash_watch/gdb_controller.rb +341 -0
  162. data/lib/phusion_passenger/vendor/crash_watch/version.rb +24 -0
  163. data/lib/phusion_passenger/vendor/daemon_controller.rb +877 -0
  164. data/lib/phusion_passenger/vendor/daemon_controller/lock_file.rb +127 -0
  165. data/lib/phusion_passenger/vendor/daemon_controller/spawn.rb +26 -0
  166. data/lib/phusion_passenger/vendor/daemon_controller/version.rb +29 -0
  167. data/packaging/rpm/passenger_spec/passenger.spec.template +0 -1
  168. data/passenger.gemspec +0 -1
  169. data/resources/templates/config/nginx_engine_compiler/possible_solutions_for_download_and_extraction_problems.txt.erb +27 -0
  170. data/resources/templates/standalone/config.erb +19 -15
  171. data/test/integration_tests/apache2_tests.rb +566 -566
  172. data/test/integration_tests/downloaded_binaries_tests.rb +126 -125
  173. data/test/integration_tests/native_packaging_spec.rb +296 -296
  174. data/test/integration_tests/nginx_tests.rb +393 -393
  175. data/test/integration_tests/shared/example_webapp_tests.rb +282 -280
  176. data/test/integration_tests/source_packaging_test.rb +138 -138
  177. data/test/integration_tests/spec_helper.rb +5 -5
  178. data/test/integration_tests/standalone_tests.rb +367 -367
  179. data/test/ruby/debug_logging_spec.rb +133 -133
  180. data/test/ruby/message_channel_spec.rb +186 -186
  181. data/test/ruby/rack/loader_spec.rb +28 -28
  182. data/test/ruby/rack/preloader_spec.rb +34 -34
  183. data/test/ruby/rails3.0/loader_spec.rb +12 -12
  184. data/test/ruby/rails3.0/preloader_spec.rb +18 -18
  185. data/test/ruby/rails3.1/loader_spec.rb +12 -12
  186. data/test/ruby/rails3.1/preloader_spec.rb +18 -18
  187. data/test/ruby/rails3.2/loader_spec.rb +12 -12
  188. data/test/ruby/rails3.2/preloader_spec.rb +18 -18
  189. data/test/ruby/rails4.0/loader_spec.rb +12 -12
  190. data/test/ruby/rails4.0/preloader_spec.rb +18 -18
  191. data/test/ruby/rails4.1/loader_spec.rb +12 -12
  192. data/test/ruby/rails4.1/preloader_spec.rb +18 -18
  193. data/test/ruby/request_handler_spec.rb +730 -730
  194. data/test/ruby/shared/loader_sharedspec.rb +224 -224
  195. data/test/ruby/shared/rails/union_station_extensions_sharedspec.rb +327 -327
  196. data/test/ruby/shared/ruby_loader_sharedspec.rb +47 -47
  197. data/test/ruby/spec_helper.rb +65 -65
  198. data/test/ruby/standalone/runtime_installer_spec.rb +384 -384
  199. data/test/ruby/union_station_spec.rb +276 -276
  200. data/test/ruby/utils/file_system_watcher_spec.rb +220 -220
  201. data/test/ruby/utils/hosts_file_parser.rb +248 -248
  202. data/test/ruby/utils/tee_input_spec.rb +215 -215
  203. data/test/ruby/utils/unseekable_socket_spec.rb +57 -57
  204. data/test/ruby/utils_spec.rb +21 -21
  205. data/test/stub/rack/config.ru +87 -87
  206. data/test/stub/rack/library.rb +8 -8
  207. data/test/stub/rack/start.rb +30 -30
  208. data/test/support/apache2_controller.rb +191 -191
  209. data/test/support/nginx_controller.rb +90 -99
  210. data/test/support/placebo-preloader.rb +57 -57
  211. data/test/support/test_helper.rb +435 -435
  212. metadata +11 -21
  213. metadata.gz.asc +7 -7
  214. data/lib/phusion_passenger/standalone/command2.rb +0 -292
  215. data/lib/phusion_passenger/standalone/start2_command.rb +0 -799
  216. data/resources/templates/standalone/download_tool_missing.txt.erb +0 -18
  217. data/resources/templates/standalone/possible_solutions_for_download_and_extraction_problems.txt.erb +0 -17
  218. data/resources/templates/standalone/run_installer_as_root.txt.erb +0 -8
@@ -97,91 +97,91 @@ module RakeExtensions
97
97
  #
98
98
  # Only the <tt>file</tt> and <tt>target</tt> Rake commands are supported.
99
99
  def subdir(dir, &block)
100
- subdir = Subdir.new(dir)
101
- Dir.chdir(dir) do
102
- subdir.instance_eval(&block)
103
- end
100
+ subdir = Subdir.new(dir)
101
+ Dir.chdir(dir) do
102
+ subdir.instance_eval(&block)
103
+ end
104
104
  end
105
105
 
106
106
  class Subdir # :nodoc:
107
- # Rake 0.9 compatibility since methods like <tt>task<tt> and <tt>desc</tt>
108
- # aren't available in Object anymore.
109
- # See: https://github.com/jimweirich/rake/issues/33#issuecomment-1213705
110
- include Rake::DSL if defined?(Rake::DSL)
107
+ # Rake 0.9 compatibility since methods like <tt>task<tt> and <tt>desc</tt>
108
+ # aren't available in Object anymore.
109
+ # See: https://github.com/jimweirich/rake/issues/33#issuecomment-1213705
110
+ include Rake::DSL if defined?(Rake::DSL)
111
111
 
112
- def initialize(dir)
113
- @dir = dir
114
- @toplevel_dir = Pathname.getwd
115
- end
112
+ def initialize(dir)
113
+ @dir = dir
114
+ @toplevel_dir = Pathname.getwd
115
+ end
116
116
 
117
- def file(args, &block)
118
- case args
119
- when String
120
- args = mangle_path(args)
121
- when Hash
122
- target = mangle_path(args.keys[0])
123
- sources = mangle_path_or_path_array(args.values[0])
124
- args = { target => sources }
125
- end
126
- Rake::FileTask.define_task(args) do
127
- puts "### In #{@dir}:"
128
- Dir.chdir(@dir) do
129
- Object.class_eval(&block)
130
- end
131
- puts ""
132
- end
133
- end
117
+ def file(args, &block)
118
+ case args
119
+ when String
120
+ args = mangle_path(args)
121
+ when Hash
122
+ target = mangle_path(args.keys[0])
123
+ sources = mangle_path_or_path_array(args.values[0])
124
+ args = { target => sources }
125
+ end
126
+ Rake::FileTask.define_task(args) do
127
+ puts "### In #{@dir}:"
128
+ Dir.chdir(@dir) do
129
+ Object.class_eval(&block)
130
+ end
131
+ puts ""
132
+ end
133
+ end
134
134
 
135
- def task(*args, &block)
136
- if !args.empty? && args[0].is_a?(Hash)
137
- target = args[0].keys[0]
138
- sources = mangle_path_or_path_array(args[0].values[0])
139
- args[0] = { target => sources }
140
- end
141
- if block_given?
142
- Rake::Task.define_task(*args) do
143
- puts "### In #{@dir}:"
144
- Dir.chdir(@dir) do
145
- Object.class_eval(&block)
146
- end
147
- puts ""
148
- end
149
- else
150
- Rake::Task.define_task(*args)
151
- end
152
- end
135
+ def task(*args, &block)
136
+ if !args.empty? && args[0].is_a?(Hash)
137
+ target = args[0].keys[0]
138
+ sources = mangle_path_or_path_array(args[0].values[0])
139
+ args[0] = { target => sources }
140
+ end
141
+ if block_given?
142
+ Rake::Task.define_task(*args) do
143
+ puts "### In #{@dir}:"
144
+ Dir.chdir(@dir) do
145
+ Object.class_eval(&block)
146
+ end
147
+ puts ""
148
+ end
149
+ else
150
+ Rake::Task.define_task(*args)
151
+ end
152
+ end
153
153
 
154
154
  private
155
- def mangle_path(path)
156
- path = File.expand_path(path)
157
- return Pathname.new(path).relative_path_from(@toplevel_dir).to_s
158
- end
155
+ def mangle_path(path)
156
+ path = File.expand_path(path)
157
+ return Pathname.new(path).relative_path_from(@toplevel_dir).to_s
158
+ end
159
159
 
160
- def mangle_path_array(array)
161
- array = array.dup
162
- array.each_with_index do |item, i|
163
- if item.is_a?(String)
164
- array[i] = mangle_path(item)
165
- end
166
- end
167
- return array
168
- end
160
+ def mangle_path_array(array)
161
+ array = array.dup
162
+ array.each_with_index do |item, i|
163
+ if item.is_a?(String)
164
+ array[i] = mangle_path(item)
165
+ end
166
+ end
167
+ return array
168
+ end
169
169
 
170
- def mangle_path_or_path_array(item)
171
- case item
172
- when String
173
- return mangle_path(item)
174
- when Array
175
- return mangle_path_array(item)
176
- else
177
- return item
178
- end
179
- end
170
+ def mangle_path_or_path_array(item)
171
+ case item
172
+ when String
173
+ return mangle_path(item)
174
+ when Array
175
+ return mangle_path_array(item)
176
+ else
177
+ return item
178
+ end
179
+ end
180
180
  end
181
181
 
182
182
  end # module RakeExtensions
183
183
 
184
184
  Object.class_eval do
185
- include RakeExtensions
185
+ include RakeExtensions
186
186
  end
187
187
 
@@ -22,40 +22,40 @@
22
22
  # THE SOFTWARE.
23
23
 
24
24
  if !PlatformInfo.passenger_needs_ruby_dev_header?
25
- NATIVE_SUPPORT_TARGET = nil
25
+ NATIVE_SUPPORT_TARGET = nil
26
26
 
27
- task :native_support do
28
- # Do nothing.
29
- end
27
+ task :native_support do
28
+ # Do nothing.
29
+ end
30
30
 
31
- task 'native_support:clean' do
32
- # Do nothing.
33
- end
31
+ task 'native_support:clean' do
32
+ # Do nothing.
33
+ end
34
34
  else
35
- output_dir = RUBY_EXTENSION_OUTPUT_DIR
36
- output_name = "passenger_native_support.#{LIBEXT}"
37
- source_dir = "ext/ruby"
38
- NATIVE_SUPPORT_TARGET = File.join(output_dir, output_name)
35
+ output_dir = RUBY_EXTENSION_OUTPUT_DIR
36
+ output_name = "passenger_native_support.#{LIBEXT}"
37
+ source_dir = "ext/ruby"
38
+ NATIVE_SUPPORT_TARGET = File.join(output_dir, output_name)
39
39
 
40
- task :native_support => NATIVE_SUPPORT_TARGET
41
- task :clean => 'native_support:clean'
40
+ task :native_support => NATIVE_SUPPORT_TARGET
41
+ task :clean => 'native_support:clean'
42
42
 
43
- dependencies = [
44
- File.join(output_dir, "Makefile"),
45
- "#{source_dir}/passenger_native_support.c"
46
- ]
47
- file(NATIVE_SUPPORT_TARGET => dependencies) do
48
- sh "mkdir -p '#{output_dir}'" if !File.exist?(output_dir)
49
- sh "cd '#{output_dir}' && make"
50
- end
43
+ dependencies = [
44
+ File.join(output_dir, "Makefile"),
45
+ "#{source_dir}/passenger_native_support.c"
46
+ ]
47
+ file(NATIVE_SUPPORT_TARGET => dependencies) do
48
+ sh "mkdir -p '#{output_dir}'" if !File.exist?(output_dir)
49
+ sh "cd '#{output_dir}' && make"
50
+ end
51
51
 
52
- file(File.join(output_dir, "Makefile") => "#{source_dir}/extconf.rb") do
53
- sh "mkdir -p '#{output_dir}'" if !File.exist?(output_dir)
54
- extconf_rb = File.expand_path("#{source_dir}/extconf.rb")
55
- sh "cd '#{output_dir}' && #{PlatformInfo.ruby_command} '#{extconf_rb}'"
56
- end
52
+ file(File.join(output_dir, "Makefile") => "#{source_dir}/extconf.rb") do
53
+ sh "mkdir -p '#{output_dir}'" if !File.exist?(output_dir)
54
+ extconf_rb = File.expand_path("#{source_dir}/extconf.rb")
55
+ sh "cd '#{output_dir}' && #{PlatformInfo.ruby_command} '#{extconf_rb}'"
56
+ end
57
57
 
58
- task 'native_support:clean' do
59
- sh "rm -rf #{output_dir}"
60
- end
58
+ task 'native_support:clean' do
59
+ sh "rm -rf #{output_dir}"
60
+ end
61
61
  end
data/build/ruby_tests.rb CHANGED
@@ -26,10 +26,10 @@
26
26
  dependencies = [NATIVE_SUPPORT_TARGET, AGENT_OUTPUT_DIR + AGENT_EXE].compact
27
27
  desc "Run unit tests for the Ruby libraries"
28
28
  task 'test:ruby' => dependencies do
29
- if maybe_grep = string_option('E')
30
- require 'shellwords'
31
- maybe_grep = "-e #{Shellwords.escape(maybe_grep)}"
32
- end
33
- command = "rspec -c -f s --tty -P 'dont-autoload-anything' #{maybe_grep} ruby/*_spec.rb ruby/*/*_spec.rb"
34
- sh "cd test && exec bundle exec #{command}"
29
+ if maybe_grep = string_option('E')
30
+ require 'shellwords'
31
+ maybe_grep = "-e #{Shellwords.escape(maybe_grep)}"
32
+ end
33
+ command = "rspec -c -f s --tty -P 'dont-autoload-anything' #{maybe_grep} ruby/*_spec.rb ruby/*/*_spec.rb"
34
+ sh "cd test && exec bundle exec #{command}"
35
35
  end
data/build/test_basics.rb CHANGED
@@ -31,53 +31,53 @@ task :test => ['test:oxt', 'test:cxx', 'test:ruby', 'test:node', 'test:integrati
31
31
 
32
32
  desc "Clean all compiled test files"
33
33
  task 'test:clean' do
34
- sh("rm -rf test/oxt/oxt_test_main test/oxt/*.o test/cxx/*.dSYM test/cxx/CxxTestMain")
35
- sh("rm -f test/cxx/*.o test/cxx/*/*.o test/cxx/*.gch")
36
- sh("rm -f test/support/allocate_memory")
34
+ sh("rm -rf test/oxt/oxt_test_main test/oxt/*.o test/cxx/*.dSYM test/cxx/CxxTestMain")
35
+ sh("rm -f test/cxx/*.o test/cxx/*/*.o test/cxx/*.gch")
36
+ sh("rm -f test/support/allocate_memory")
37
37
  end
38
38
 
39
39
  task :clean => 'test:clean'
40
40
 
41
41
  file 'test/support/allocate_memory' => 'test/support/allocate_memory.c' do
42
- create_c_executable('test/support/allocate_memory', 'test/support/allocate_memory.c')
42
+ create_c_executable('test/support/allocate_memory', 'test/support/allocate_memory.c')
43
43
  end
44
44
 
45
45
  desc "Install developer dependencies"
46
46
  task 'test:install_deps' do
47
- gem_install = PlatformInfo.gem_command + " install --no-rdoc --no-ri"
48
- gem_install = "#{PlatformInfo.ruby_sudo_command} #{gem_install}" if boolean_option('SUDO')
49
- default = boolean_option('DEVDEPS_DEFAULT', true)
50
- install_base_deps = boolean_option('BASE_DEPS', default)
51
- install_doctools = boolean_option('DOCTOOLS', default)
47
+ gem_install = PlatformInfo.gem_command + " install --no-rdoc --no-ri"
48
+ gem_install = "#{PlatformInfo.ruby_sudo_command} #{gem_install}" if boolean_option('SUDO')
49
+ default = boolean_option('DEVDEPS_DEFAULT', true)
50
+ install_base_deps = boolean_option('BASE_DEPS', default)
51
+ install_doctools = boolean_option('DOCTOOLS', default)
52
52
 
53
- if deps_target = string_option('DEPS_TARGET')
54
- bundle_args = " --path #{deps_target}"
55
- end
53
+ if deps_target = string_option('DEPS_TARGET')
54
+ bundle_args = " --path #{deps_target}"
55
+ end
56
56
 
57
- if !PlatformInfo.locate_ruby_tool('bundle')
58
- sh "#{gem_install} bundler"
59
- end
57
+ if !PlatformInfo.locate_ruby_tool('bundle')
58
+ sh "#{gem_install} bundler"
59
+ end
60
60
 
61
- if install_base_deps && install_doctools
62
- sh "bundle install #{bundle_args} --without="
63
- else
64
- if install_base_deps
65
- sh "bundle install #{bundle_args} --without doc"
66
- end
67
- if install_doctools
68
- sh "bundle install #{bundle_args} --without base"
69
- end
70
- end
71
- if boolean_option('RAILS_BUNDLES', default)
72
- sh "cd test/stub/rails3.0 && bundle install #{bundle_args}"
73
- sh "cd test/stub/rails3.1 && bundle install #{bundle_args}"
74
- sh "cd test/stub/rails3.2 && bundle install #{bundle_args}"
75
- if RUBY_VERSION >= '1.9'
76
- sh "cd test/stub/rails4.0 && bundle install #{bundle_args}"
77
- sh "cd test/stub/rails4.1 && bundle install #{bundle_args}"
78
- end
79
- end
80
- if boolean_option('NODE_MODULES', default)
81
- sh "npm install"
82
- end
61
+ if install_base_deps && install_doctools
62
+ sh "bundle install #{bundle_args} --without="
63
+ else
64
+ if install_base_deps
65
+ sh "bundle install #{bundle_args} --without doc"
66
+ end
67
+ if install_doctools
68
+ sh "bundle install #{bundle_args} --without base"
69
+ end
70
+ end
71
+ if boolean_option('RAILS_BUNDLES', default)
72
+ sh "cd test/stub/rails3.0 && bundle install #{bundle_args}"
73
+ sh "cd test/stub/rails3.1 && bundle install #{bundle_args}"
74
+ sh "cd test/stub/rails3.2 && bundle install #{bundle_args}"
75
+ if RUBY_VERSION >= '1.9'
76
+ sh "cd test/stub/rails4.0 && bundle install #{bundle_args}"
77
+ sh "cd test/stub/rails4.1 && bundle install #{bundle_args}"
78
+ end
79
+ end
80
+ if boolean_option('NODE_MODULES', default)
81
+ sh "npm install"
82
+ end
83
83
  end
@@ -31,13 +31,11 @@ Depends: ${shlibs:Depends}, ${misc:Depends},
31
31
  ruby2.4 | ruby2.3 | ruby2.2 | ruby2.1 | ruby2.0 | ruby1.9.1 | ruby1.8 | ruby-interpreter,
32
32
  rubygems-integration (>= 1.8) | rubygems1.9.1 | rubygems1.9 | rubygems (>= 1.2),
33
33
  #if is_distribution?('<= lucid') || is_distribution?('<= squeeze')
34
- librack-ruby,
34
+ librack-ruby
35
35
  #else
36
- ruby-rack,
36
+ ruby-rack
37
37
  #endif
38
- ruby-daemon-controller (>= 1.2.0)
39
- Recommends: passenger-doc (= ${binary:Version}), passenger-dev (= ${binary:Version}),
40
- crash-watch
38
+ Recommends: passenger-doc (= ${binary:Version}), passenger-dev (= ${binary:Version})
41
39
  Breaks: libapache2-mod-passenger (<< <%= DEBIAN_EPOCH %>:<%= PACKAGE_VERSION %>), passenger-common,
42
40
  passenger-common1.8, passenger-common1.9.1, ruby-passenger
43
41
  Replaces: libapache2-mod-passenger (<< <%= DEBIAN_EPOCH %>:<%= PACKAGE_VERSION %>), passenger-common,
@@ -23,62 +23,62 @@
23
23
  # THE SOFTWARE.
24
24
 
25
25
  ESSENTIALS = [
26
- "boost/detail/{limits,endian}.hpp",
27
- "boost/config",
28
- "boost/mpl",
29
- "boost/preprocessor/stringize.hpp",
30
- "boost/smart_ptr/detail/sp_counted_*",
31
- "boost/smart_ptr/detail/atomic_count*",
32
- "boost/smart_ptr/detail/spinlock*",
33
- "boost/atomic",
34
- "boost/pool",
35
- "boost/unordered*",
36
- "boost/thread",
37
- "boost/intrusive",
38
- "boost/heap",
39
- "boost/container",
40
- "libs/thread/src",
41
- "libs/system/src",
42
- "libs/regex/src",
43
- "boost/preprocessor",
44
- "boost/parameter",
45
- "boost/date_time/gregorian/formatters_limited.hpp",
46
- "boost/date_time/date_formatting_limited.hpp",
47
- "boost/type_traits/make_signed.hpp",
48
- "boost/type_traits/detail/*",
49
- "boost/non_type.hpp",
50
- "boost/detail/fenv.hpp",
51
- "boost/foreach.hpp",
52
- "boost/*regex*"
26
+ "boost/detail/{limits,endian}.hpp",
27
+ "boost/config",
28
+ "boost/mpl",
29
+ "boost/preprocessor/stringize.hpp",
30
+ "boost/smart_ptr/detail/sp_counted_*",
31
+ "boost/smart_ptr/detail/atomic_count*",
32
+ "boost/smart_ptr/detail/spinlock*",
33
+ "boost/atomic",
34
+ "boost/pool",
35
+ "boost/unordered*",
36
+ "boost/thread",
37
+ "boost/intrusive",
38
+ "boost/heap",
39
+ "boost/container",
40
+ "libs/thread/src",
41
+ "libs/system/src",
42
+ "libs/regex/src",
43
+ "boost/preprocessor",
44
+ "boost/parameter",
45
+ "boost/date_time/gregorian/formatters_limited.hpp",
46
+ "boost/date_time/date_formatting_limited.hpp",
47
+ "boost/type_traits/make_signed.hpp",
48
+ "boost/type_traits/detail/*",
49
+ "boost/non_type.hpp",
50
+ "boost/detail/fenv.hpp",
51
+ "boost/foreach.hpp",
52
+ "boost/*regex*"
53
53
  ]
54
54
  EXCLUDE = [
55
- "libs/thread/src/win32/*",
56
- "libs/regex/src/w32_regex_traits.cpp",
57
- "libs/regex/src/fileiter.cpp",
58
- "libs/regex/src/icu.cpp",
59
- "libs/regex/src/usinstances.cpp",
60
- "boost/atomic/detail/windows.hpp",
61
- "boost/regex/icu.hpp"
55
+ "libs/thread/src/win32/*",
56
+ "libs/regex/src/w32_regex_traits.cpp",
57
+ "libs/regex/src/fileiter.cpp",
58
+ "libs/regex/src/icu.cpp",
59
+ "libs/regex/src/usinstances.cpp",
60
+ "boost/atomic/detail/windows.hpp",
61
+ "boost/regex/icu.hpp"
62
62
  ]
63
63
  PROGRAM_SOURCE = %q{
64
- #include <boost/shared_ptr.hpp>
65
- #include <boost/shared_array.hpp>
66
- #include <boost/weak_ptr.hpp>
67
- #include <boost/make_shared.hpp>
68
- #include <boost/enable_shared_from_this.hpp>
69
- #include <boost/intrusive_ptr.hpp>
70
- #include <boost/thread.hpp>
71
- #include <boost/noncopyable.hpp>
72
- #include <boost/function.hpp>
73
- #include <boost/bind.hpp>
74
- #include <boost/container/vector.hpp>
75
- #include <boost/heap/d_ary_heap.hpp>
76
- #include <boost/date_time/posix_time/posix_time.hpp>
77
- #include <boost/foreach.hpp>
78
- #include <boost/unordered_map.hpp>
79
- #include <boost/cregex.hpp>
80
- #include <boost/regex.hpp>
81
- #include <boost/pool/object_pool.hpp>
64
+ #include <boost/shared_ptr.hpp>
65
+ #include <boost/shared_array.hpp>
66
+ #include <boost/weak_ptr.hpp>
67
+ #include <boost/make_shared.hpp>
68
+ #include <boost/enable_shared_from_this.hpp>
69
+ #include <boost/intrusive_ptr.hpp>
70
+ #include <boost/thread.hpp>
71
+ #include <boost/noncopyable.hpp>
72
+ #include <boost/function.hpp>
73
+ #include <boost/bind.hpp>
74
+ #include <boost/container/vector.hpp>
75
+ #include <boost/heap/d_ary_heap.hpp>
76
+ #include <boost/date_time/posix_time/posix_time.hpp>
77
+ #include <boost/foreach.hpp>
78
+ #include <boost/unordered_map.hpp>
79
+ #include <boost/cregex.hpp>
80
+ #include <boost/regex.hpp>
81
+ #include <boost/pool/object_pool.hpp>
82
82
  }
83
83
 
84
84
  require 'fileutils'
@@ -87,110 +87,110 @@ Dir.chdir(File.dirname(__FILE__) + "/../ext")
87
87
 
88
88
  # Run the given command, and abort on error.
89
89
  def sh(*command)
90
- puts command.join(" ")
91
- if !system(*command)
92
- puts "*** ERROR"
93
- exit 1
94
- end
90
+ puts command.join(" ")
91
+ if !system(*command)
92
+ puts "*** ERROR"
93
+ exit 1
94
+ end
95
95
  end
96
96
 
97
97
  def install(source_filename, target_filename)
98
- dir = File.dirname(target_filename)
99
- if !File.exist?(dir)
100
- sh "mkdir", "-p", dir
101
- end
102
- command = ["install", "-m", "u+rw,g+r,o+r", source_filename, target_filename]
103
- sh(*command)
98
+ dir = File.dirname(target_filename)
99
+ if !File.exist?(dir)
100
+ sh "mkdir", "-p", dir
101
+ end
102
+ command = ["install", "-m", "u+rw,g+r,o+r", source_filename, target_filename]
103
+ sh(*command)
104
104
  end
105
105
 
106
106
  def copy_boost_files(patterns, exclude = nil)
107
- patterns.each do |pattern|
108
- files = Dir["#{BOOST_DIR}/#{pattern}"]
109
- files -= exclude if exclude
110
- files.each do |source|
111
- if File.directory?(source)
112
- source.slice!(0 .. BOOST_DIR.size)
113
- copy_boost_files(["#{source}/*"], exclude)
114
- else
115
- target = source.slice(BOOST_DIR.size + 1 .. source.size - 1)
116
- if target =~ /^libs\//
117
- target = "boost/#{target}"
118
- end
119
- if !File.exist?(target)
120
- install(source, target)
121
- end
122
- end
123
- end
124
- end
107
+ patterns.each do |pattern|
108
+ files = Dir["#{BOOST_DIR}/#{pattern}"]
109
+ files -= exclude if exclude
110
+ files.each do |source|
111
+ if File.directory?(source)
112
+ source.slice!(0 .. BOOST_DIR.size)
113
+ copy_boost_files(["#{source}/*"], exclude)
114
+ else
115
+ target = source.slice(BOOST_DIR.size + 1 .. source.size - 1)
116
+ if target =~ /^libs\//
117
+ target = "boost/#{target}"
118
+ end
119
+ if !File.exist?(target)
120
+ install(source, target)
121
+ end
122
+ end
123
+ end
124
+ end
125
125
  end
126
126
 
127
127
  def copy_essential_files
128
- exclude = []
129
- EXCLUDE.each do |pattern|
130
- exclude.concat(Dir["#{BOOST_DIR}/#{pattern}"])
131
- end
132
- copy_boost_files(ESSENTIALS, exclude)
128
+ exclude = []
129
+ EXCLUDE.each do |pattern|
130
+ exclude.concat(Dir["#{BOOST_DIR}/#{pattern}"])
131
+ end
132
+ copy_boost_files(ESSENTIALS, exclude)
133
133
  end
134
134
 
135
135
  def prepare
136
- File.open("test.cpp", "w") do |f|
137
- f.write(PROGRAM_SOURCE)
138
- end
136
+ File.open("test.cpp", "w") do |f|
137
+ f.write(PROGRAM_SOURCE)
138
+ end
139
139
  end
140
140
 
141
141
  def cleanup
142
- FileUtils.rm_rf("boost/thread/win32")
143
- FileUtils.rm_rf("boost/src/win32")
144
- FileUtils.rm_rf("boost/asio/win32")
145
- FileUtils.rm_rf("boost/smart_ptr/detail/spinlock_w32.hpp")
146
- FileUtils.rm_rf("boost/smart_ptr/detail/sp_counted_base_w32.hpp")
147
- FileUtils.rm_rf("boost/smart_ptr/detail/atomic_count_win32.hpp")
148
- FileUtils.rm_rf("boost/config/platform/win32.hpp")
149
- File.unlink("test.cpp") rescue nil
142
+ FileUtils.rm_rf("boost/thread/win32")
143
+ FileUtils.rm_rf("boost/src/win32")
144
+ FileUtils.rm_rf("boost/asio/win32")
145
+ FileUtils.rm_rf("boost/smart_ptr/detail/spinlock_w32.hpp")
146
+ FileUtils.rm_rf("boost/smart_ptr/detail/sp_counted_base_w32.hpp")
147
+ FileUtils.rm_rf("boost/smart_ptr/detail/atomic_count_win32.hpp")
148
+ FileUtils.rm_rf("boost/config/platform/win32.hpp")
149
+ File.unlink("test.cpp") rescue nil
150
150
  end
151
151
 
152
152
  # Compile PROGRAM_SOURCE and copy whatever missing header files the compiler needs.
153
153
  def copy_dependencies
154
- done = false
155
- while !done
156
- missing_headers = `c++ test.cpp -c -I. 2>&1`.
157
- split("\n").
158
- grep(/(error: .*: No such file|fatal error: '.*' file not found)/).
159
- map do |line|
160
- if line =~ /error: (.*): No such file/
161
- file = $1
162
- elsif line =~ /fatal error: '(.*)' file not found/
163
- file = $1
164
- else
165
- abort "Bug"
166
- end
167
- if file =~ /^boost\//
168
- file
169
- else
170
- line =~ /(.*?):/
171
- source = $1
172
- File.dirname(source) + "/" + file
173
- end
174
- end
175
- missing_headers.each do |header|
176
- install("#{BOOST_DIR}/#{header}", header)
177
- end
178
- done = missing_headers.empty?
179
- end
154
+ done = false
155
+ while !done
156
+ missing_headers = `c++ test.cpp -c -I. 2>&1`.
157
+ split("\n").
158
+ grep(/(error: .*: No such file|fatal error: '.*' file not found)/).
159
+ map do |line|
160
+ if line =~ /error: (.*): No such file/
161
+ file = $1
162
+ elsif line =~ /fatal error: '(.*)' file not found/
163
+ file = $1
164
+ else
165
+ abort "Bug"
166
+ end
167
+ if file =~ /^boost\//
168
+ file
169
+ else
170
+ line =~ /(.*?):/
171
+ source = $1
172
+ File.dirname(source) + "/" + file
173
+ end
174
+ end
175
+ missing_headers.each do |header|
176
+ install("#{BOOST_DIR}/#{header}", header)
177
+ end
178
+ done = missing_headers.empty?
179
+ end
180
180
  end
181
181
 
182
182
  def start
183
- if BOOST_DIR.nil? || BOOST_DIR.empty?
184
- puts "Usage: copy_boost_headers.rb <boost source directory>"
185
- exit 1
186
- end
187
- begin
188
- prepare
189
- copy_essential_files
190
- copy_dependencies
191
- ensure
192
- cleanup
193
- end
183
+ if BOOST_DIR.nil? || BOOST_DIR.empty?
184
+ puts "Usage: copy_boost_headers.rb <boost source directory>"
185
+ exit 1
186
+ end
187
+ begin
188
+ prepare
189
+ copy_essential_files
190
+ copy_dependencies
191
+ ensure
192
+ cleanup
193
+ end
194
194
  end
195
195
 
196
196
  start