passenger 5.1.10 → 5.1.11

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 (200) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +18 -0
  3. data/Rakefile +20 -17
  4. data/bin/passenger-install-apache2-module +14 -11
  5. data/build/agent.rb +45 -18
  6. data/build/apache2.rb +32 -16
  7. data/build/basics.rb +29 -40
  8. data/build/common_library.rb +70 -54
  9. data/build/cxx_tests.rb +34 -43
  10. data/build/integration_tests.rb +10 -10
  11. data/build/misc.rb +6 -6
  12. data/build/node_tests.rb +1 -2
  13. data/build/oxt_tests.rb +7 -5
  14. data/build/packaging.rb +11 -441
  15. data/build/ruby_extension.rb +1 -1
  16. data/build/ruby_tests.rb +1 -2
  17. data/build/support/cplusplus.rb +6 -5
  18. data/build/support/cxx_dependency_map.rb +357 -833
  19. data/build/support/general.rb +23 -1
  20. data/build/test_basics.rb +3 -28
  21. data/dev/ci/tests/rpm/Jenkinsfile +68 -0
  22. data/dev/ci/tests/rpm/run +63 -0
  23. data/dev/ci/tests/source-packaging/run +1 -1
  24. data/dev/ci/tests/source-packaging/setup +1 -1
  25. data/doc/{Packaging.txt.md → Packaging.md} +0 -0
  26. data/resources/templates/apache2/deployment_example.txt.erb +2 -2
  27. data/resources/templates/apache2/multiple_apache_installations_detected.txt.erb +2 -2
  28. data/resources/templates/nginx/deployment_example.txt.erb +1 -1
  29. data/resources/templates/standalone/mass_deployment_default_server.erb +2 -2
  30. data/resources/templates/standalone/server.erb +2 -2
  31. data/src/agent/AgentMain.cpp +0 -4
  32. data/src/agent/Core/CoreMain.cpp +88 -5
  33. data/src/agent/Core/SpawningKit/Spawner.h +2 -1
  34. data/src/agent/Shared/Fundamentals/AbortHandler.cpp +1109 -0
  35. data/src/agent/Shared/Fundamentals/AbortHandler.h +63 -0
  36. data/src/agent/Shared/Fundamentals/Implementation.cpp +7 -0
  37. data/src/agent/Shared/Fundamentals/Initialization.cpp +614 -0
  38. data/src/agent/Shared/{Base.h → Fundamentals/Initialization.h} +23 -14
  39. data/src/agent/Shared/Fundamentals/Utils.cpp +127 -0
  40. data/src/agent/Shared/Fundamentals/Utils.h +46 -0
  41. data/src/agent/TempDirToucher/TempDirToucherMain.cpp +1 -1
  42. data/src/agent/Watchdog/CoreWatcher.cpp +3 -1
  43. data/src/agent/Watchdog/InstanceDirToucher.cpp +90 -53
  44. data/src/agent/Watchdog/WatchdogMain.cpp +13 -29
  45. data/src/apache2_module/Hooks.cpp +4 -1
  46. data/src/cxx_supportlib/ConfigKit/Store.h +32 -5
  47. data/src/cxx_supportlib/Constants.h +1 -2
  48. data/src/cxx_supportlib/Crypto.cpp +2 -1
  49. data/src/cxx_supportlib/Hooks.h +16 -37
  50. data/src/cxx_supportlib/LoggingKit/Context.h +22 -0
  51. data/src/cxx_supportlib/LoggingKit/Forward.h +1 -0
  52. data/src/cxx_supportlib/LoggingKit/Implementation.cpp +106 -22
  53. data/src/cxx_supportlib/ProcessManagement/Ruby.cpp +106 -0
  54. data/src/{agent/UstRouter/FileSink.h → cxx_supportlib/ProcessManagement/Ruby.h} +23 -47
  55. data/src/cxx_supportlib/ProcessManagement/Spawn.cpp +199 -0
  56. data/src/cxx_supportlib/ProcessManagement/Spawn.h +150 -0
  57. data/src/cxx_supportlib/ProcessManagement/Utils.cpp +459 -0
  58. data/src/cxx_supportlib/ProcessManagement/Utils.h +107 -0
  59. data/src/cxx_supportlib/Utils.cpp +41 -561
  60. data/src/cxx_supportlib/Utils.h +0 -68
  61. data/src/cxx_supportlib/Utils/AsyncSignalSafeUtils.h +187 -0
  62. data/src/cxx_supportlib/Utils/ProcessMetricsCollector.h +14 -2
  63. data/src/cxx_supportlib/WatchdogLauncher.h +2 -12
  64. data/src/cxx_supportlib/oxt/dynamic_thread_group.hpp +2 -2
  65. data/src/cxx_supportlib/vendor-modified/jsoncpp/json-forwards.h +4 -0
  66. data/src/cxx_supportlib/vendor-modified/jsoncpp/json.h +16 -1
  67. data/src/cxx_supportlib/vendor-modified/jsoncpp/jsoncpp.cpp +12 -9
  68. data/src/cxx_supportlib/vendor-modified/libev/ev++.h +4 -4
  69. data/src/cxx_supportlib/vendor-modified/libev/ev.h +3 -3
  70. data/src/nginx_module/CacheLocationConfig.c +0 -75
  71. data/src/nginx_module/CacheLocationConfig.c.cxxcodebuilder +1 -0
  72. data/src/nginx_module/Configuration.c +0 -1
  73. data/src/nginx_module/Configuration.h +0 -1
  74. data/src/nginx_module/ConfigurationCommands.c +1 -1
  75. data/src/nginx_module/ContentHandler.c +0 -1
  76. data/src/nginx_module/ContentHandler.h +0 -1
  77. data/src/nginx_module/CreateLocationConfig.c +0 -5
  78. data/src/nginx_module/CreateLocationConfig.c.cxxcodebuilder +1 -0
  79. data/src/nginx_module/LocationConfig.h +0 -4
  80. data/src/nginx_module/LocationConfig.h.cxxcodebuilder +2 -1
  81. data/src/nginx_module/MergeLocationConfig.c +0 -12
  82. data/src/nginx_module/MergeLocationConfig.c.cxxcodebuilder +1 -0
  83. data/src/nginx_module/ngx_http_passenger_module.h +0 -1
  84. data/src/ruby_supportlib/phusion_passenger.rb +1 -1
  85. data/src/ruby_supportlib/phusion_passenger/common_library.rb +20 -11
  86. data/src/ruby_supportlib/phusion_passenger/config/api_call_command.rb +1 -1
  87. data/src/ruby_supportlib/phusion_passenger/config/reopen_logs_command.rb +0 -1
  88. data/src/ruby_supportlib/phusion_passenger/config/validate_install_command.rb +10 -3
  89. data/src/ruby_supportlib/phusion_passenger/console_text_template.rb +3 -1
  90. data/src/ruby_supportlib/phusion_passenger/constants.rb +0 -1
  91. data/src/ruby_supportlib/phusion_passenger/debug_logging.rb +1 -1
  92. data/src/ruby_supportlib/phusion_passenger/loader_shared_helpers.rb +32 -6
  93. data/src/ruby_supportlib/phusion_passenger/nginx/config_options.rb +0 -1
  94. data/src/ruby_supportlib/phusion_passenger/packaging.rb +2 -4
  95. data/src/ruby_supportlib/phusion_passenger/platform_info/apache.rb +101 -20
  96. data/src/ruby_supportlib/phusion_passenger/platform_info/apache_detector.rb +21 -9
  97. data/src/ruby_supportlib/phusion_passenger/platform_info/compiler.rb +34 -31
  98. data/src/ruby_supportlib/phusion_passenger/platform_info/cxx_portability.rb +3 -1
  99. data/src/ruby_supportlib/phusion_passenger/platform_info/depcheck_specs/apache2.rb +2 -14
  100. data/src/ruby_supportlib/phusion_passenger/platform_info/operating_system.rb +40 -3
  101. data/src/ruby_supportlib/phusion_passenger/standalone/app_finder.rb +15 -14
  102. data/src/ruby_supportlib/phusion_passenger/standalone/config_options_list.rb +1 -1
  103. data/src/ruby_supportlib/phusion_passenger/standalone/config_utils.rb +1 -1
  104. data/src/ruby_supportlib/phusion_passenger/standalone/start_command.rb +8 -3
  105. data/src/ruby_supportlib/phusion_passenger/standalone/start_command/nginx_engine.rb +19 -18
  106. data/src/ruby_supportlib/phusion_passenger/standalone/stop_command.rb +6 -1
  107. data/src/ruby_supportlib/phusion_passenger/vendor/daemon_controller.rb +17 -1
  108. metadata +19 -97
  109. data/build/documentation.rb +0 -70
  110. data/doc/CloudLicensingConfiguration.html +0 -172
  111. data/doc/CloudLicensingConfiguration.txt.md +0 -3
  112. data/doc/Packaging.html +0 -488
  113. data/doc/Security of user switching support.idmap.txt +0 -34
  114. data/doc/Security of user switching support.txt +0 -197
  115. data/doc/ServerOptimizationGuide.html +0 -172
  116. data/doc/ServerOptimizationGuide.txt.md +0 -3
  117. data/doc/images/by_sa.png +0 -0
  118. data/doc/images/cloud_licensing_batch_job.png +0 -0
  119. data/doc/images/code_walkthrough.jpg +0 -0
  120. data/doc/images/direct_spawning.png +0 -0
  121. data/doc/images/direct_spawning.svg +0 -251
  122. data/doc/images/glyphicons-halflings-white.png +0 -0
  123. data/doc/images/glyphicons-halflings.png +0 -0
  124. data/doc/images/icons/README +0 -5
  125. data/doc/images/icons/callouts/1.png +0 -0
  126. data/doc/images/icons/callouts/10.png +0 -0
  127. data/doc/images/icons/callouts/11.png +0 -0
  128. data/doc/images/icons/callouts/12.png +0 -0
  129. data/doc/images/icons/callouts/13.png +0 -0
  130. data/doc/images/icons/callouts/14.png +0 -0
  131. data/doc/images/icons/callouts/15.png +0 -0
  132. data/doc/images/icons/callouts/2.png +0 -0
  133. data/doc/images/icons/callouts/3.png +0 -0
  134. data/doc/images/icons/callouts/4.png +0 -0
  135. data/doc/images/icons/callouts/5.png +0 -0
  136. data/doc/images/icons/callouts/6.png +0 -0
  137. data/doc/images/icons/callouts/7.png +0 -0
  138. data/doc/images/icons/callouts/8.png +0 -0
  139. data/doc/images/icons/callouts/9.png +0 -0
  140. data/doc/images/icons/caution.png +0 -0
  141. data/doc/images/icons/example.png +0 -0
  142. data/doc/images/icons/home.png +0 -0
  143. data/doc/images/icons/important.png +0 -0
  144. data/doc/images/icons/next.png +0 -0
  145. data/doc/images/icons/note.png +0 -0
  146. data/doc/images/icons/prev.png +0 -0
  147. data/doc/images/icons/tip.png +0 -0
  148. data/doc/images/icons/up.png +0 -0
  149. data/doc/images/icons/warning.png +0 -0
  150. data/doc/images/many_web_framework_protocols.png +0 -0
  151. data/doc/images/passenger_architecture.png +0 -0
  152. data/doc/images/passenger_architecture.svg +0 -385
  153. data/doc/images/passenger_architecture_overview.png +0 -0
  154. data/doc/images/passenger_core_architecture.png +0 -0
  155. data/doc/images/passenger_nodejs_architecture.svg +0 -558
  156. data/doc/images/phusion_banner.png +0 -0
  157. data/doc/images/rack.png +0 -0
  158. data/doc/images/smart_spawning.png +0 -0
  159. data/doc/images/smart_spawning.svg +0 -323
  160. data/doc/images/spawn_server_architecture.png +0 -0
  161. data/doc/images/spawn_server_architecture.svg +0 -655
  162. data/doc/images/spawning_preparation_work.png +0 -0
  163. data/doc/images/startup_sequence.png +0 -0
  164. data/doc/images/typical_isolated_web_application.png +0 -0
  165. data/doc/images/typical_isolated_web_application.svg +0 -213
  166. data/doc/users_guide_snippets/alternative_for_flying_passenger.txt +0 -1
  167. data/doc/users_guide_snippets/analysis_and_system_maintenance.txt +0 -61
  168. data/doc/users_guide_snippets/appendix_a_about.txt +0 -13
  169. data/doc/users_guide_snippets/appendix_b_terminology.txt +0 -71
  170. data/doc/users_guide_snippets/appendix_c_spawning_methods.txt +0 -36
  171. data/doc/users_guide_snippets/deployment_basics.txt +0 -37
  172. data/doc/users_guide_snippets/enterprise_only.txt +0 -1
  173. data/doc/users_guide_snippets/environment_variables.txt +0 -44
  174. data/doc/users_guide_snippets/global_queueing_explained.txt +0 -74
  175. data/doc/users_guide_snippets/installation.txt +0 -228
  176. data/doc/users_guide_snippets/installation/run_installer.txt +0 -58
  177. data/doc/users_guide_snippets/installation/verify_running_epilogue.txt +0 -6
  178. data/doc/users_guide_snippets/passenger_spawn_method.txt +0 -37
  179. data/doc/users_guide_snippets/rackup_specifications.txt +0 -1
  180. data/doc/users_guide_snippets/rvm_helper_tool.txt +0 -44
  181. data/doc/users_guide_snippets/since_version.txt +0 -1
  182. data/doc/users_guide_snippets/support_information.txt +0 -8
  183. data/doc/users_guide_snippets/tips.txt +0 -302
  184. data/doc/users_guide_snippets/troubleshooting/default.txt +0 -48
  185. data/doc/users_guide_snippets/troubleshooting/rails.txt +0 -59
  186. data/doc/users_guide_snippets/under_the_hood/page_caching_support.txt +0 -24
  187. data/doc/users_guide_snippets/under_the_hood/relationship_with_ruby.txt +0 -10
  188. data/doc/users_guide_snippets/where_to_get_support.txt +0 -9
  189. data/src/agent/Shared/Base.cpp +0 -1678
  190. data/src/agent/UstRouter/ApiServer.h +0 -292
  191. data/src/agent/UstRouter/Client.h +0 -112
  192. data/src/agent/UstRouter/Controller.h +0 -1309
  193. data/src/agent/UstRouter/LogSink.h +0 -145
  194. data/src/agent/UstRouter/OptionParser.h +0 -180
  195. data/src/agent/UstRouter/RemoteSender.h +0 -853
  196. data/src/agent/UstRouter/RemoteSink.h +0 -145
  197. data/src/agent/UstRouter/Transaction.h +0 -278
  198. data/src/agent/UstRouter/UstRouterMain.cpp +0 -681
  199. data/src/agent/Watchdog/UstRouterWatcher.cpp +0 -80
  200. data/src/ruby_supportlib/phusion_passenger/platform_info/macos.rb +0 -45
@@ -36,8 +36,6 @@ PhusionPassenger.require_passenger_lib 'common_library'
36
36
  # Defines tasks for compiling a static library containing Boost and OXT.
37
37
  def define_libboost_oxt_task(namespace, output_dir, extra_compiler_flags = nil)
38
38
  output_file = "#{output_dir}.a"
39
- flags = "-Isrc/cxx_supportlib -Isrc/cxx_supportlib/vendor-copy -Isrc/cxx_supportlib/vendor-modified " +
40
- "#{extra_compiler_flags} #{EXTRA_CXXFLAGS}"
41
39
 
42
40
  if OPTIMIZE
43
41
  optimize = "-O2"
@@ -57,8 +55,10 @@ def define_libboost_oxt_task(namespace, output_dir, extra_compiler_flags = nil)
57
55
  define_cxx_object_compilation_task(
58
56
  object_file,
59
57
  source_file,
60
- :include_paths => CXX_SUPPORTLIB_INCLUDE_PATHS,
61
- :flags => [optimize, extra_compiler_flags]
58
+ lambda { {
59
+ :include_paths => CXX_SUPPORTLIB_INCLUDE_PATHS,
60
+ :flags => [optimize, maybe_eval_lambda(extra_compiler_flags)]
61
+ } }
62
62
  )
63
63
  end
64
64
 
@@ -73,8 +73,10 @@ def define_libboost_oxt_task(namespace, output_dir, extra_compiler_flags = nil)
73
73
  define_cxx_object_compilation_task(
74
74
  object_file,
75
75
  source_file,
76
- :include_paths => CXX_SUPPORTLIB_INCLUDE_PATHS,
77
- :flags => [optimize, extra_compiler_flags]
76
+ lambda { {
77
+ :include_paths => CXX_SUPPORTLIB_INCLUDE_PATHS,
78
+ :flags => [optimize, maybe_eval_lambda(extra_compiler_flags)]
79
+ } }
78
80
  )
79
81
  end
80
82
 
@@ -102,9 +104,23 @@ end
102
104
 
103
105
  if USE_VENDORED_LIBEV
104
106
  LIBEV_SOURCE_DIR = File.expand_path("../src/cxx_supportlib/vendor-modified/libev", File.dirname(__FILE__)) + "/"
105
- LIBEV_CFLAGS = "-Isrc/cxx_supportlib/vendor-modified/libev"
106
107
  LIBEV_TARGET = LIBEV_OUTPUT_DIR + ".libs/libev.a"
107
108
 
109
+ let(:libev_cflags) do
110
+ result = '-Isrc/cxx_supportlib/vendor-modified/libev'
111
+ # Apple Clang 4.2 complains about ambiguous member templates in ev++.h.
112
+ result << ' -Wno-ambiguous-member-template' if PlatformInfo.compiler_supports_wno_ambiguous_member_template?
113
+ result
114
+ end
115
+
116
+ let(:libev_libs) do
117
+ la_contents = File.open(LIBEV_OUTPUT_DIR + ".libs/libev.la", "r") do |f|
118
+ f.read
119
+ end
120
+ la_contents =~ /dependency_libs='(.+)'/
121
+ "#{LIBEV_OUTPUT_DIR}.libs/libev.a #{$1}".strip
122
+ end
123
+
108
124
  task :libev => LIBEV_TARGET
109
125
 
110
126
  dependencies = [
@@ -113,20 +129,20 @@ if USE_VENDORED_LIBEV
113
129
  "src/cxx_supportlib/vendor-modified/libev/Makefile.am"
114
130
  ]
115
131
  file LIBEV_OUTPUT_DIR + "Makefile" => dependencies do
116
- cc = CC
117
- cxx = CXX
132
+ cc_command = cc
133
+ cxx_command = cxx
118
134
  if OPTIMIZE && LTO
119
- cc = "#{cc} -flto"
120
- cxx = "#{cxx} -flto"
135
+ cc_command = "#{cc_command} -flto"
136
+ cxx_command = "#{cxx_command} -flto"
121
137
  end
122
138
  # Disable all warnings: http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#COMPILER_WARNINGS
123
- cflags = "#{EXTRA_CFLAGS} -w"
139
+ cflags = "#{extra_cflags} -w"
124
140
  sh "mkdir -p #{LIBEV_OUTPUT_DIR}" if !File.directory?(LIBEV_OUTPUT_DIR)
125
141
  sh "cd #{LIBEV_OUTPUT_DIR} && sh #{LIBEV_SOURCE_DIR}configure " +
126
142
  "--disable-shared --enable-static " +
127
143
  # libev's configure script may select a different default compiler than we
128
144
  # do, so we force our compiler choice.
129
- "CC='#{cc}' CXX='#{cxx}' CFLAGS='#{cflags}' orig_CFLAGS=1"
145
+ "CC='#{cc_command}' CXX='#{cxx_command}' CFLAGS='#{cflags}' orig_CFLAGS=1"
130
146
  end
131
147
 
132
148
  libev_sources = Dir["src/cxx_supportlib/vendor-modified/libev/{*.c,*.h}"]
@@ -144,35 +160,38 @@ if USE_VENDORED_LIBEV
144
160
  end
145
161
 
146
162
  task :clean => 'libev:clean'
147
-
148
- def libev_libs
149
- la_contents = File.open(LIBEV_OUTPUT_DIR + ".libs/libev.la", "r") do |f|
150
- f.read
151
- end
152
- la_contents =~ /dependency_libs='(.+)'/
153
- "#{LIBEV_OUTPUT_DIR}.libs/libev.a #{$1}".strip
154
- end
155
163
  else
156
- LIBEV_CFLAGS = string_option('LIBEV_CFLAGS', '-I/usr/include/libev')
157
164
  LIBEV_TARGET = nil
158
- task :libev # do nothing
159
165
 
160
- def libev_libs
161
- string_option('LIBEV_LIBS', '-lev')
166
+ let(:libev_cflags) do
167
+ result = string_option('LIBEV_CFLAGS', '-I/usr/include/libev')
168
+ # Apple Clang 4.2 complains about ambiguous member templates in ev++.h.
169
+ result << ' -Wno-ambiguous-member-template' if PlatformInfo.compiler_supports_wno_ambiguous_member_template?
170
+ result
162
171
  end
163
- end
164
172
 
165
- # Apple Clang 4.2 complains about ambiguous member templates in ev++.h.
166
- LIBEV_CFLAGS << " -Wno-ambiguous-member-template" if PlatformInfo.compiler_supports_wno_ambiguous_member_template?
173
+ let(:libev_libs) { string_option('LIBEV_LIBS', '-lev') }
174
+
175
+ task :libev # do nothing
176
+ end
167
177
 
168
178
 
169
179
  ########## libuv ##########
170
180
 
171
181
  if USE_VENDORED_LIBUV
172
182
  LIBUV_SOURCE_DIR = File.expand_path("../src/cxx_supportlib/vendor-copy/libuv", File.dirname(__FILE__)) + "/"
173
- LIBUV_CFLAGS = "-Isrc/cxx_supportlib/vendor-copy/libuv/include"
174
183
  LIBUV_TARGET = LIBUV_OUTPUT_DIR + ".libs/libuv.a"
175
184
 
185
+ let(:libuv_cflags) { '-Isrc/cxx_supportlib/vendor-copy/libuv/include' }
186
+
187
+ let(:libuv_libs) do
188
+ la_contents = File.open(LIBUV_OUTPUT_DIR + ".libs/libuv.la", "r") do |f|
189
+ f.read
190
+ end
191
+ la_contents =~ /dependency_libs='(.+)'/
192
+ "#{LIBUV_OUTPUT_DIR}.libs/libuv.a #{$1}".strip
193
+ end
194
+
176
195
  task :libuv => LIBUV_TARGET
177
196
 
178
197
  dependencies = [
@@ -180,15 +199,15 @@ if USE_VENDORED_LIBUV
180
199
  "src/cxx_supportlib/vendor-copy/libuv/Makefile.am"
181
200
  ]
182
201
  file LIBUV_OUTPUT_DIR + "Makefile" => dependencies do
183
- cc = CC
184
- cxx = CXX
202
+ cc_command = cc
203
+ cxx_command = cxx
185
204
  if OPTIMIZE && LTO
186
- cc = "#{cc} -flto"
187
- cxx = "#{cxx} -flto"
205
+ cc_command = "#{cc_command} -flto"
206
+ cxx_command = "#{cxx_command} -flto"
188
207
  end
189
208
  # Disable all warnings. The author has a clear standpoint on that:
190
209
  # http://pod.tst.eu/http://cvs.schmorp.de/libev/ev.pod#COMPILER_WARNINGS
191
- cflags = "#{EXTRA_CFLAGS} -w"
210
+ cflags = "#{extra_cflags} -w"
192
211
  sh "mkdir -p #{LIBUV_OUTPUT_DIR}" if !File.directory?(LIBUV_OUTPUT_DIR)
193
212
  # Prevent 'make' from regenerating autotools files
194
213
  sh "cd #{LIBUV_SOURCE_DIR} && (touch aclocal.m4 configure Makefile.in || true)"
@@ -196,7 +215,7 @@ if USE_VENDORED_LIBUV
196
215
  "--disable-shared --enable-static " +
197
216
  # libuv's configure script may select a different default compiler than we
198
217
  # do, so we force our compiler choice.
199
- "CC='#{cc}' CXX='#{cxx}' CFLAGS='#{cflags}'"
218
+ "CC='#{cc_command}' CXX='#{cxx_command}' CFLAGS='#{cflags}'"
200
219
  end
201
220
 
202
221
  libuv_sources = Dir["src/cxx_supportlib/vendor-copy/libuv/**/{*.c,*.h}"]
@@ -214,22 +233,13 @@ if USE_VENDORED_LIBUV
214
233
  end
215
234
 
216
235
  task :clean => 'libuv:clean'
217
-
218
- def libuv_libs
219
- la_contents = File.open(LIBUV_OUTPUT_DIR + ".libs/libuv.la", "r") do |f|
220
- f.read
221
- end
222
- la_contents =~ /dependency_libs='(.+)'/
223
- "#{LIBUV_OUTPUT_DIR}.libs/libuv.a #{$1}".strip
224
- end
225
236
  else
226
- LIBUV_CFLAGS = string_option('LIBUV_CFLAGS', '-I/usr/include/libuv')
227
237
  LIBUV_TARGET = nil
228
- task :libuv # do nothing
229
238
 
230
- def libuv_libs
231
- string_option('LIBUV_LIBS', '-luv')
232
- end
239
+ let(:libuv_cflags) { string_option('LIBUV_CFLAGS', '-I/usr/include/libuv') }
240
+ let(:libuv_libs) { string_option('LIBUV_LIBS', '-luv') }
241
+
242
+ task :libuv # do nothing
233
243
  end
234
244
 
235
245
 
@@ -254,10 +264,16 @@ end
254
264
  ##############################
255
265
 
256
266
 
257
- libboost_oxt_cflags = ""
258
- libboost_oxt_cflags << " #{PlatformInfo.adress_sanitizer_flag}" if USE_ASAN
259
- libboost_oxt_cflags.strip!
260
- LIBBOOST_OXT, LIBBOOST_OXT_LINKARG =
261
- define_libboost_oxt_task("common", COMMON_OUTPUT_DIR + "libboost_oxt", libboost_oxt_cflags)
267
+ let(:libboost_oxt_cflags) do
268
+ result = []
269
+ result << PlatformInfo.adress_sanitizer_flag if USE_ASAN
270
+ result.join(' ')
271
+ end
272
+
273
+ LIBBOOST_OXT, LIBBOOST_OXT_LINKARG = define_libboost_oxt_task(
274
+ 'common',
275
+ "#{COMMON_OUTPUT_DIR}libboost_oxt",
276
+ method(:libboost_oxt_cflags)
277
+ )
262
278
  COMMON_LIBRARY.enable_optimizations!(LTO) if OPTIMIZE
263
- COMMON_LIBRARY.define_tasks(libboost_oxt_cflags)
279
+ COMMON_LIBRARY.define_tasks(method(:libboost_oxt_cflags))
@@ -42,8 +42,6 @@ TEST_CXX_OBJECTS = {
42
42
  "#{TEST_OUTPUT_DIR}cxx/Core/SpawningKit/SmartSpawnerTest.o" =>
43
43
  "test/cxx/Core/SpawningKit/SmartSpawnerTest.cpp",
44
44
 
45
- "#{TEST_OUTPUT_DIR}cxx/Core/UnionStationTest.o" =>
46
- "test/cxx/Core/UnionStationTest.cpp",
47
45
  "#{TEST_OUTPUT_DIR}cxx/Core/ResponseCacheTest.o" =>
48
46
  "test/cxx/Core/ResponseCacheTest.cpp",
49
47
  "#{TEST_OUTPUT_DIR}cxx/Core/SecurityUpdateCheckerTest.o" =>
@@ -51,9 +49,6 @@ TEST_CXX_OBJECTS = {
51
49
  "#{TEST_OUTPUT_DIR}cxx/Core/ControllerTest.o" =>
52
50
  "test/cxx/Core/ControllerTest.cpp",
53
51
 
54
- "#{TEST_OUTPUT_DIR}cxx/UstRouter/TransactionTest.o" =>
55
- "test/cxx/UstRouter/TransactionTest.cpp",
56
-
57
52
  "#{TEST_OUTPUT_DIR}cxx/ServerKit/ChannelTest.o" =>
58
53
  "test/cxx/ServerKit/ChannelTest.cpp",
59
54
  "#{TEST_OUTPUT_DIR}cxx/ServerKit/FileBufferedChannelTest.o" =>
@@ -125,50 +120,44 @@ TEST_CXX_OBJECTS = {
125
120
  "test/cxx/Base64DecodingTest.cpp"
126
121
  }
127
122
 
128
- def basic_test_cxx_flags
129
- @basic_test_cxx_flags ||= begin
130
- flags = [
131
- LIBEV_CFLAGS,
132
- LIBUV_CFLAGS,
133
- PlatformInfo.curl_flags,
134
- TEST_COMMON_CFLAGS
135
- ]
136
- if USE_ASAN
137
- flags << PlatformInfo.adress_sanitizer_flag
138
- end
139
- flags
123
+ let(:basic_test_cxx_flags) do
124
+ flags = [
125
+ libev_cflags,
126
+ libuv_cflags,
127
+ PlatformInfo.curl_flags,
128
+ TEST_COMMON_CFLAGS
129
+ ]
130
+ if USE_ASAN
131
+ flags << PlatformInfo.adress_sanitizer_flag
140
132
  end
133
+ flags
141
134
  end
142
135
 
143
- def test_cxx_include_paths
144
- @test_cxx_include_paths ||= [
145
- "test/cxx",
146
- "test/support",
147
- "src/agent",
136
+ let(:test_cxx_include_paths) do
137
+ [
138
+ 'test/cxx',
139
+ 'test/support',
140
+ 'src/agent',
148
141
  *CXX_SUPPORTLIB_INCLUDE_PATHS
149
142
  ]
150
143
  end
151
144
 
152
- def test_cxx_flags
153
- @test_cxx_flags ||= ["-include test/cxx/TestSupport.h"] +
154
- basic_test_cxx_flags
145
+ let(:test_cxx_flags) do
146
+ ['-include test/cxx/TestSupport.h'] + basic_test_cxx_flags
155
147
  end
156
148
 
157
- def test_cxx_ldflags
158
- @test_cxx_ldflags ||= begin
159
- result = "#{EXTRA_PRE_CXX_LDFLAGS} " <<
160
- "#{TEST_COMMON_LIBRARY.link_objects_as_string} " <<
161
- "#{TEST_BOOST_OXT_LIBRARY} #{libev_libs} #{libuv_libs} " <<
162
- "#{PlatformInfo.curl_libs} " <<
163
- "#{PlatformInfo.zlib_libs} " <<
164
- "#{PlatformInfo.crypto_libs} " <<
165
- "#{PlatformInfo.portability_cxx_ldflags}"
166
- result << " #{PlatformInfo.dmalloc_ldflags}" if USE_DMALLOC
167
- result << " #{PlatformInfo.adress_sanitizer_flag}" if USE_ASAN
168
- result << " #{EXTRA_CXX_LDFLAGS}"
169
- result.strip!
170
- result
171
- end
149
+ let(:test_cxx_ldflags) do
150
+ result = "#{EXTRA_PRE_CXX_LDFLAGS} " <<
151
+ "#{TEST_COMMON_LIBRARY.link_objects_as_string} " <<
152
+ "#{TEST_BOOST_OXT_LIBRARY} #{libev_libs} #{libuv_libs} " <<
153
+ "#{PlatformInfo.curl_libs} " <<
154
+ "#{PlatformInfo.zlib_libs} " <<
155
+ "#{PlatformInfo.crypto_libs} " <<
156
+ "#{PlatformInfo.portability_cxx_ldflags}"
157
+ result << " #{PlatformInfo.adress_sanitizer_flag}" if USE_ASAN
158
+ result << " #{EXTRA_CXX_LDFLAGS}"
159
+ result.strip!
160
+ result
172
161
  end
173
162
 
174
163
  # Define compilation tasks for object files.
@@ -176,9 +165,11 @@ TEST_CXX_OBJECTS.each_pair do |object, source|
176
165
  define_cxx_object_compilation_task(
177
166
  object,
178
167
  source,
179
- :include_paths => test_cxx_include_paths,
180
- :flags => test_cxx_flags,
181
- :deps => 'test/cxx/TestSupport.h.gch'
168
+ lambda { {
169
+ :include_paths => test_cxx_include_paths,
170
+ :flags => test_cxx_flags,
171
+ :deps => 'test/cxx/TestSupport.h.gch'
172
+ } }
182
173
  )
183
174
  end
184
175
 
@@ -44,8 +44,7 @@ task 'test:integration:apache2' => dependencies do
44
44
  command = "#{PlatformInfo.ruby_sudo_command} -E #{command}"
45
45
  end
46
46
  if grep = string_option('E')
47
- require 'shellwords'
48
- command << " -e #{Shellwords.escape(grep)}"
47
+ command << " -e #{shesc grep}"
49
48
  end
50
49
  sh "cd test && exec #{command}"
51
50
  end
@@ -58,8 +57,7 @@ task 'test:integration:nginx' => dependencies do
58
57
  command = "#{PlatformInfo.ruby_sudo_command} -E #{command}"
59
58
  end
60
59
  if grep = string_option('E')
61
- require 'shellwords'
62
- command << " -e #{Shellwords.escape(grep)}"
60
+ command << " -e #{shesc grep}"
63
61
  end
64
62
  repeat = true
65
63
  while repeat
@@ -73,8 +71,7 @@ desc "Run Passenger Standalone integration tests"
73
71
  task 'test:integration:standalone' => dependencies do
74
72
  command = "bundle exec rspec -c -f s --tty integration_tests/standalone_tests.rb"
75
73
  if grep = string_option('E')
76
- require 'shellwords'
77
- command << " -e #{Shellwords.escape(grep)}"
74
+ command << " -e #{shesc grep}"
78
75
  end
79
76
  sh "cd test && exec #{command}"
80
77
  end
@@ -86,8 +83,7 @@ task 'test:integration:native_packaging' do
86
83
  command = "#{PlatformInfo.ruby_sudo_command} -E #{command}"
87
84
  end
88
85
  if grep = string_option('E')
89
- require 'shellwords'
90
- command << " -e #{Shellwords.escape(grep)}"
86
+ command << " -e #{shesc grep}"
91
87
  end
92
88
  case PlatformInfo.os_name_simple
93
89
  when "linux"
@@ -124,7 +120,6 @@ end
124
120
  dependencies = integration_test_dependencies(:_apache2)
125
121
  desc "Run the 'apache2' integration test infinitely, and abort if/when it fails"
126
122
  task 'test:restart' => dependencies do
127
- require 'shellwords'
128
123
  color_code_start = "\e[33m\e[44m\e[1m"
129
124
  color_code_end = "\e[0m"
130
125
  i = 1
@@ -132,9 +127,14 @@ task 'test:restart' => dependencies do
132
127
  puts "#{color_code_start}Test run #{i} (press Ctrl-C multiple times to abort)#{color_code_end}"
133
128
  command = "bundle exec rspec -c -f s --tty integration_tests/apache2_tests.rb"
134
129
  if grep = string_option('E')
135
- command << " -e #{Shellwords.escape(grep)}"
130
+ command << " -e #{shesc grep}"
136
131
  end
137
132
  sh "cd test && exec #{command}"
138
133
  i += 1
139
134
  end
140
135
  end
136
+
137
+ desc "Run source packaging tests"
138
+ task 'test:source_packaging' do
139
+ sh 'bundle exec rspec -f s -c test/integration_tests/source_packaging_test.rb'
140
+ end
@@ -77,7 +77,7 @@ end
77
77
  desc "Convert the Changelog items for the latest release to HTML"
78
78
  task :changelog_as_html do
79
79
  require 'cgi'
80
- contents, items = extract_latest_news_contents_and_items
80
+ _, items = extract_latest_news_contents_and_items
81
81
 
82
82
  puts "<ul>"
83
83
  items.each do |item|
@@ -109,7 +109,7 @@ end
109
109
 
110
110
  desc "Convert the Changelog items for the latest release to Markdown"
111
111
  task :changelog_as_markdown do
112
- contents, items = extract_latest_news_contents_and_items
112
+ contents, _ = extract_latest_news_contents_and_items
113
113
 
114
114
  # Auto-link to issue tracker.
115
115
  contents.gsub!(/(bug #|issue #|GH-)(\d+)/i) do
@@ -176,16 +176,16 @@ task :compile_app => dependencies do
176
176
  :include_paths => CXX_SUPPORTLIB_INCLUDE_PATHS,
177
177
  :flags => [
178
178
  "-DSTANDALONE",
179
- LIBEV_CFLAGS,
180
- LIBUV_CFLAGS
179
+ libev_cflags,
180
+ libuv_cflags
181
181
  ]
182
182
  )
183
183
  create_cxx_executable(exe,
184
184
  object,
185
185
  :flags => [
186
186
  "-DSTANDALONE",
187
- LIBEV_CFLAGS,
188
- LIBUV_CFLAGS,
187
+ libev_cflags,
188
+ libuv_cflags,
189
189
  COMMON_LIBRARY.link_objects_as_string,
190
190
  LIBBOOST_OXT_LINKARG,
191
191
  libev_libs,
@@ -26,11 +26,10 @@
26
26
 
27
27
  desc "Run unit tests for the Node.js libraries"
28
28
  task 'test:node' do
29
- require 'shellwords'
30
29
  command = "cd test && env NODE_PATH=#{PhusionPassenger.node_libdir} NODE_ENV=test " +
31
30
  "../node_modules/.bin/mocha -R spec node/*_spec.js"
32
31
  if grep = string_option('G')
33
- command << " -g #{Shellwords.escape(grep)}"
32
+ command << " -g #{shesc grep}"
34
33
  end
35
34
  sh(command)
36
35
  end
@@ -38,11 +38,13 @@ TEST_OXT_OBJECTS.each_pair do |object, source|
38
38
  define_cxx_object_compilation_task(
39
39
  object,
40
40
  source,
41
- :include_paths => [
42
- "test/support",
43
- *CXX_SUPPORTLIB_INCLUDE_PATHS
44
- ],
45
- :flags => TEST_COMMON_CFLAGS
41
+ lambda { {
42
+ :include_paths => [
43
+ "test/support",
44
+ *CXX_SUPPORTLIB_INCLUDE_PATHS
45
+ ],
46
+ :flags => TEST_COMMON_CFLAGS
47
+ } }
46
48
  )
47
49
  end
48
50