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
@@ -53,190 +53,190 @@
53
53
  # non-nil, must be the name of the setter function.
54
54
 
55
55
  APACHE2_DIRECTORY_CONFIGURATION_OPTIONS = [
56
- {
57
- :name => "PassengerRuby",
58
- :type => :string,
59
- :desc => "The Ruby interpreter to use.",
60
- :header_expression => "config->ruby ? config->ruby : serverConfig.defaultRuby"
61
- },
62
- {
63
- :name => "PassengerPython",
64
- :type => :string,
65
- :desc => "The Python interpreter to use."
66
- },
67
- {
68
- :name => "PassengerNodejs",
69
- :type => :string,
70
- :desc => "The Node.js command to use."
71
- },
72
- {
73
- :name => "PassengerAppEnv",
74
- :type => :string,
75
- :desc => "The environment under which applications are run."
76
- },
77
- {
78
- :name => "PassengerMinInstances",
79
- :type => :integer,
80
- :context => ["OR_LIMIT", "ACCESS_CONF", "RSRC_CONF"],
81
- :min_value => 0,
82
- :header => "PASSENGER_MIN_PROCESSES",
83
- :desc => "The minimum number of application instances to keep when cleaning idle instances."
84
- },
85
- {
86
- :name => "PassengerMaxInstancesPerApp",
87
- :type => :integer,
88
- :context => ["RSRC_CONF"],
89
- :header => "PASSENGER_MAX_PROCESSES",
90
- :desc => "The maximum number of simultaneously alive application instances a single application may occupy."
91
- },
92
- {
93
- :name => "PassengerUser",
94
- :type => :string,
95
- :context => ["ACCESS_CONF", "RSRC_CONF"],
96
- :desc => "The user that Ruby applications must run as."
97
- },
98
- {
99
- :name => "PassengerGroup",
100
- :type => :string,
101
- :context => ["ACCESS_CONF", "RSRC_CONF"],
102
- :desc => "The group that Ruby applications must run as."
103
- },
104
- {
105
- :name => "PassengerErrorOverride",
106
- :type => :flag,
107
- :context => ["OR_ALL"],
108
- :desc => "Allow Apache to handle error response.",
109
- :header => nil
110
- },
111
- {
112
- :name => "PassengerMaxRequests",
113
- :type => :integer,
114
- :context => ["OR_LIMIT", "ACCESS_CONF", "RSRC_CONF"],
115
- :min_value => 0,
116
- :desc => "The maximum number of requests that an application instance may process."
117
- },
118
- {
119
- :name => "PassengerStartTimeout",
120
- :type => :integer,
121
- :context => ["OR_LIMIT", "ACCESS_CONF", "RSRC_CONF"],
122
- :min_value => 1,
123
- :desc => "A timeout for application startup."
124
- },
125
- {
126
- :name => "PassengerHighPerformance",
127
- :type => :flag,
128
- :context => ["OR_ALL"],
129
- :desc => "Enable or disable Passenger's high performance mode.",
130
- :header => nil
131
- },
132
- {
133
- :name => "PassengerEnabled",
134
- :type => :flag,
135
- :context => ["OR_ALL"],
136
- :desc => "Enable or disable Phusion Passenger.",
137
- :header => nil
138
- },
139
- {
140
- :name => "PassengerMaxRequestQueueSize",
141
- :type => :integer,
142
- :min_value => 0,
143
- :context => ["OR_ALL"],
144
- :desc => "The maximum number of queued requests."
145
- },
146
- {
147
- :name => "PassengerMaxPreloaderIdleTime",
148
- :type => :integer,
149
- :min_value => 0,
150
- :context => ["RSRC_CONF"],
151
- :desc => "The maximum number of seconds that a preloader process may be idle before it is shutdown."
152
- },
153
- {
154
- :name => "PassengerLoadShellEnvvars",
155
- :type => :flag,
156
- :desc => "Whether to load environment variables from the shell before running the application."
157
- },
158
- {
159
- :name => "PassengerBufferUpload",
160
- :type => :flag,
161
- :context => ["OR_ALL"],
162
- :desc => "Whether to buffer file uploads.",
163
- :header => nil
164
- },
165
- {
166
- :name => 'PassengerAppType',
167
- :type => :string,
168
- :context => ["OR_ALL"],
169
- :desc => "Force specific application type.",
170
- :header => nil
171
- },
172
- {
173
- :name => 'PassengerStartupFile',
174
- :type => :string,
175
- :context => ["OR_ALL"],
176
- :desc => "Force specific startup file."
177
- },
178
- {
179
- :name => 'PassengerStickySessions',
180
- :type => :flag,
181
- :context => ["OR_ALL"],
182
- :desc => "Whether to enable sticky sessions."
183
- },
184
- {
185
- :name => 'PassengerStickySessionsCookieName',
186
- :type => :flag,
187
- :context => ["OR_ALL"],
188
- :desc => "The cookie name to use for sticky sessions."
189
- },
190
- {
191
- :name => "PassengerSpawnMethod",
192
- :type => :string,
193
- :context => ["RSRC_CONF"],
194
- :desc => "The spawn method to use.",
195
- :function => "cmd_passenger_spawn_method"
196
- },
197
- {
198
- :name => "PassengerShowVersionInHeader",
199
- :type => :flag,
200
- :desc => "Whether to show the Phusion Passenger version number in the X-Powered-By header."
201
- },
202
- {
203
- :name => "PassengerFriendlyErrorPages",
204
- :type => :flag,
205
- :desc => "Whether to display friendly error pages when something goes wrong."
206
- },
207
- {
208
- :name => "PassengerRestartDir",
209
- :type => :string,
210
- :desc => "The directory in which Passenger should look for restart.txt."
211
- },
212
- {
213
- :name => "PassengerAppGroupName",
214
- :type => :string,
215
- :desc => "Application process group name."
216
- },
56
+ {
57
+ :name => "PassengerRuby",
58
+ :type => :string,
59
+ :desc => "The Ruby interpreter to use.",
60
+ :header_expression => "config->ruby ? config->ruby : serverConfig.defaultRuby"
61
+ },
62
+ {
63
+ :name => "PassengerPython",
64
+ :type => :string,
65
+ :desc => "The Python interpreter to use."
66
+ },
67
+ {
68
+ :name => "PassengerNodejs",
69
+ :type => :string,
70
+ :desc => "The Node.js command to use."
71
+ },
72
+ {
73
+ :name => "PassengerAppEnv",
74
+ :type => :string,
75
+ :desc => "The environment under which applications are run."
76
+ },
77
+ {
78
+ :name => "PassengerMinInstances",
79
+ :type => :integer,
80
+ :context => ["OR_LIMIT", "ACCESS_CONF", "RSRC_CONF"],
81
+ :min_value => 0,
82
+ :header => "PASSENGER_MIN_PROCESSES",
83
+ :desc => "The minimum number of application instances to keep when cleaning idle instances."
84
+ },
85
+ {
86
+ :name => "PassengerMaxInstancesPerApp",
87
+ :type => :integer,
88
+ :context => ["RSRC_CONF"],
89
+ :header => "PASSENGER_MAX_PROCESSES",
90
+ :desc => "The maximum number of simultaneously alive application instances a single application may occupy."
91
+ },
92
+ {
93
+ :name => "PassengerUser",
94
+ :type => :string,
95
+ :context => ["ACCESS_CONF", "RSRC_CONF"],
96
+ :desc => "The user that Ruby applications must run as."
97
+ },
98
+ {
99
+ :name => "PassengerGroup",
100
+ :type => :string,
101
+ :context => ["ACCESS_CONF", "RSRC_CONF"],
102
+ :desc => "The group that Ruby applications must run as."
103
+ },
104
+ {
105
+ :name => "PassengerErrorOverride",
106
+ :type => :flag,
107
+ :context => ["OR_ALL"],
108
+ :desc => "Allow Apache to handle error response.",
109
+ :header => nil
110
+ },
111
+ {
112
+ :name => "PassengerMaxRequests",
113
+ :type => :integer,
114
+ :context => ["OR_LIMIT", "ACCESS_CONF", "RSRC_CONF"],
115
+ :min_value => 0,
116
+ :desc => "The maximum number of requests that an application instance may process."
117
+ },
118
+ {
119
+ :name => "PassengerStartTimeout",
120
+ :type => :integer,
121
+ :context => ["OR_LIMIT", "ACCESS_CONF", "RSRC_CONF"],
122
+ :min_value => 1,
123
+ :desc => "A timeout for application startup."
124
+ },
125
+ {
126
+ :name => "PassengerHighPerformance",
127
+ :type => :flag,
128
+ :context => ["OR_ALL"],
129
+ :desc => "Enable or disable Passenger's high performance mode.",
130
+ :header => nil
131
+ },
132
+ {
133
+ :name => "PassengerEnabled",
134
+ :type => :flag,
135
+ :context => ["OR_ALL"],
136
+ :desc => "Enable or disable Phusion Passenger.",
137
+ :header => nil
138
+ },
139
+ {
140
+ :name => "PassengerMaxRequestQueueSize",
141
+ :type => :integer,
142
+ :min_value => 0,
143
+ :context => ["OR_ALL"],
144
+ :desc => "The maximum number of queued requests."
145
+ },
146
+ {
147
+ :name => "PassengerMaxPreloaderIdleTime",
148
+ :type => :integer,
149
+ :min_value => 0,
150
+ :context => ["RSRC_CONF"],
151
+ :desc => "The maximum number of seconds that a preloader process may be idle before it is shutdown."
152
+ },
153
+ {
154
+ :name => "PassengerLoadShellEnvvars",
155
+ :type => :flag,
156
+ :desc => "Whether to load environment variables from the shell before running the application."
157
+ },
158
+ {
159
+ :name => "PassengerBufferUpload",
160
+ :type => :flag,
161
+ :context => ["OR_ALL"],
162
+ :desc => "Whether to buffer file uploads.",
163
+ :header => nil
164
+ },
165
+ {
166
+ :name => 'PassengerAppType',
167
+ :type => :string,
168
+ :context => ["OR_ALL"],
169
+ :desc => "Force specific application type.",
170
+ :header => nil
171
+ },
172
+ {
173
+ :name => 'PassengerStartupFile',
174
+ :type => :string,
175
+ :context => ["OR_ALL"],
176
+ :desc => "Force specific startup file."
177
+ },
178
+ {
179
+ :name => 'PassengerStickySessions',
180
+ :type => :flag,
181
+ :context => ["OR_ALL"],
182
+ :desc => "Whether to enable sticky sessions."
183
+ },
184
+ {
185
+ :name => 'PassengerStickySessionsCookieName',
186
+ :type => :flag,
187
+ :context => ["OR_ALL"],
188
+ :desc => "The cookie name to use for sticky sessions."
189
+ },
190
+ {
191
+ :name => "PassengerSpawnMethod",
192
+ :type => :string,
193
+ :context => ["RSRC_CONF"],
194
+ :desc => "The spawn method to use.",
195
+ :function => "cmd_passenger_spawn_method"
196
+ },
197
+ {
198
+ :name => "PassengerShowVersionInHeader",
199
+ :type => :flag,
200
+ :desc => "Whether to show the Phusion Passenger version number in the X-Powered-By header."
201
+ },
202
+ {
203
+ :name => "PassengerFriendlyErrorPages",
204
+ :type => :flag,
205
+ :desc => "Whether to display friendly error pages when something goes wrong."
206
+ },
207
+ {
208
+ :name => "PassengerRestartDir",
209
+ :type => :string,
210
+ :desc => "The directory in which Passenger should look for restart.txt."
211
+ },
212
+ {
213
+ :name => "PassengerAppGroupName",
214
+ :type => :string,
215
+ :desc => "Application process group name."
216
+ },
217
217
 
218
- ##### Aliases #####
218
+ ##### Aliases #####
219
219
 
220
- {
221
- :name => "RailsEnv",
222
- :type => :string,
223
- :desc => "The environment under which applications are run.",
224
- :alias_for => "PassengerAppEnv"
225
- },
226
- {
227
- :name => "RackEnv",
228
- :type => :string,
229
- :desc => "The environment under which applications are run.",
230
- :alias_for => "PassengerAppEnv"
231
- },
220
+ {
221
+ :name => "RailsEnv",
222
+ :type => :string,
223
+ :desc => "The environment under which applications are run.",
224
+ :alias_for => "PassengerAppEnv"
225
+ },
226
+ {
227
+ :name => "RackEnv",
228
+ :type => :string,
229
+ :desc => "The environment under which applications are run.",
230
+ :alias_for => "PassengerAppEnv"
231
+ },
232
232
 
233
- ##### Deprecated options #####
233
+ ##### Deprecated options #####
234
234
 
235
- {
236
- :name => "RailsSpawnMethod",
237
- :type => :string,
238
- :context => ["RSRC_CONF"],
239
- :desc => "Deprecated option.",
240
- :alias_for => "PassengerSpawnMethod"
241
- }
235
+ {
236
+ :name => "RailsSpawnMethod",
237
+ :type => :string,
238
+ :context => ["RSRC_CONF"],
239
+ :desc => "Deprecated option.",
240
+ :alias_for => "PassengerSpawnMethod"
241
+ }
242
242
  ]
@@ -27,498 +27,492 @@
27
27
  # lib/phusion_passenger/standalone/runtime_installer.rb.
28
28
 
29
29
  class CommonLibraryBuilder
30
- include Rake::DSL if defined?(Rake::DSL)
31
-
32
- attr_reader :all_components, :selected_components, :output_dir
33
-
34
- def initialize(&block)
35
- @all_components = {}
36
- @all_ordered_components = []
37
- @selected_components = {}
38
- @namespace = "common"
39
- if defined?(COMMON_OUTPUT_DIR)
40
- @output_dir = COMMON_OUTPUT_DIR + "libpassenger_common"
41
- else
42
- @output_dir = "."
43
- end
44
- instance_eval(&block) if block
45
- end
46
-
47
- def initialize_copy(other)
48
- [:all_components, :all_ordered_components, :selected_components, :namespace, :output_dir].each do |name|
49
- var_name = "@#{name}"
50
- instance_variable_set(var_name, other.instance_variable_get(var_name).dup)
51
- end
52
- end
53
-
54
- def define_component(object_name, options)
55
- options[:deps] ||= []
56
- @all_components[object_name] = options
57
- @all_ordered_components << object_name
58
- @selected_components[object_name] = options
59
- end
60
-
61
- def only(*selector)
62
- return dup.send(:only!, *selector)
63
- end
64
-
65
- def exclude(*selector)
66
- return dup.send(:exclude!, *selector)
67
- end
68
-
69
- def set_namespace(namespace)
70
- return dup.send(:set_namespace!, namespace)
71
- end
72
-
73
- def set_output_dir(dir)
74
- return dup.send(:set_output_dir!, dir)
75
- end
76
-
77
- def link_objects
78
- result = []
79
-
80
- selected_categories.each do |category|
81
- if category_complete?(category) && false
82
- # Feature disabled: we don't want to waste too much space when
83
- # packaging the runtime ('passenger package-runtime') so we
84
- # never generate static libraries.
85
- if aggregate_sources?
86
- result << "#{@output_dir}/#{category}.o"
87
- else
88
- result << "#{@output_dir}/#{category}.a"
89
- end
90
- else
91
- object_names = selected_objects_beloging_to_category(category)
92
- result.concat(object_filenames_for(object_names))
93
- end
94
- end
95
-
96
- return result
97
- end
98
-
99
- def link_objects_as_string
100
- return link_objects.join(' ')
101
- end
102
-
103
- def enable_optimizations!
104
- @default_optimization_level = "-O"
105
- end
106
-
107
- def define_tasks(extra_compiler_flags = nil)
108
- flags = "-Iext -Iext/common #{LIBEV_CFLAGS} #{extra_compiler_flags} "
109
- cflags = (flags + EXTRA_CFLAGS).strip
110
- cxxflags = (flags + EXTRA_CXXFLAGS).strip
111
-
112
- group_all_components_by_category.each_pair do |category, object_names|
113
- define_category_tasks(category, object_names, cflags, cxxflags)
114
- end
115
-
116
- task("#{@namespace}:clean") do
117
- sh "rm -rf #{@output_dir}"
118
- end
119
-
120
- return self
121
- end
30
+ include Rake::DSL if defined?(Rake::DSL)
31
+
32
+ attr_reader :all_components, :selected_components, :output_dir
33
+
34
+ def initialize(&block)
35
+ @all_components = {}
36
+ @all_ordered_components = []
37
+ @selected_components = {}
38
+ @namespace = "common"
39
+ if defined?(COMMON_OUTPUT_DIR)
40
+ @output_dir = COMMON_OUTPUT_DIR + "libpassenger_common"
41
+ else
42
+ @output_dir = "."
43
+ end
44
+ instance_eval(&block) if block
45
+ end
46
+
47
+ def initialize_copy(other)
48
+ [:all_components, :all_ordered_components, :selected_components, :namespace, :output_dir].each do |name|
49
+ var_name = "@#{name}"
50
+ instance_variable_set(var_name, other.instance_variable_get(var_name).dup)
51
+ end
52
+ end
53
+
54
+ def define_component(object_name, options)
55
+ options[:deps] ||= []
56
+ @all_components[object_name] = options
57
+ @all_ordered_components << object_name
58
+ @selected_components[object_name] = options
59
+ end
60
+
61
+ def only(*selector)
62
+ return dup.send(:only!, *selector)
63
+ end
64
+
65
+ def exclude(*selector)
66
+ return dup.send(:exclude!, *selector)
67
+ end
68
+
69
+ def set_namespace(namespace)
70
+ return dup.send(:set_namespace!, namespace)
71
+ end
72
+
73
+ def set_output_dir(dir)
74
+ return dup.send(:set_output_dir!, dir)
75
+ end
76
+
77
+ def link_objects
78
+ result = []
79
+
80
+ selected_categories.each do |category|
81
+ if category_complete?(category) && false
82
+ # Feature disabled: we don't want to waste too much space when
83
+ # packaging the runtime ('passenger package-runtime') so we
84
+ # never generate static libraries.
85
+ if aggregate_sources?
86
+ result << "#{@output_dir}/#{category}.o"
87
+ else
88
+ result << "#{@output_dir}/#{category}.a"
89
+ end
90
+ else
91
+ object_names = selected_objects_beloging_to_category(category)
92
+ result.concat(object_filenames_for(object_names))
93
+ end
94
+ end
95
+
96
+ return result
97
+ end
98
+
99
+ def link_objects_as_string
100
+ return link_objects.join(' ')
101
+ end
102
+
103
+ def enable_optimizations!
104
+ @default_optimization_level = "-O"
105
+ end
106
+
107
+ def define_tasks(extra_compiler_flags = nil)
108
+ flags = "-Iext -Iext/common #{LIBEV_CFLAGS} #{extra_compiler_flags} "
109
+ cflags = (flags + EXTRA_CFLAGS).strip
110
+ cxxflags = (flags + EXTRA_CXXFLAGS).strip
111
+
112
+ group_all_components_by_category.each_pair do |category, object_names|
113
+ define_category_tasks(category, object_names, cflags, cxxflags)
114
+ end
115
+
116
+ task("#{@namespace}:clean") do
117
+ sh "rm -rf #{@output_dir}"
118
+ end
119
+
120
+ return self
121
+ end
122
122
 
123
123
  private
124
- def define_category_tasks(category, object_names, cflags, cxxflags)
125
- object_filenames = object_filenames_for(object_names)
126
-
127
- object_names.each do |object_name|
128
- options = @all_components[object_name]
129
- source_file = "ext/common/#{options[:source]}"
130
- object_file = "#{@output_dir}/#{object_name}"
131
-
132
- file(object_file => dependencies_for(options)) do
133
- case options[:optimize]
134
- when :light
135
- optimize = "-O1"
136
- when true, :heavy
137
- optimize = "-O2"
138
- when :very_heavy
139
- optimize = "-O3"
140
- when nil
141
- optimize = @default_optimization_level
142
- else
143
- raise "Unknown optimization level #{options[:optimize]}"
144
- end
145
- if options[:strict_aliasing] == false
146
- optimize = "#{optimize} -fno-strict-aliasing"
147
- end
148
- ensure_directory_exists(File.dirname(object_file))
149
- if source_file =~ /\.c$/
150
- compile_c(source_file, "#{optimize} #{cflags} -o #{object_file}".strip)
151
- else
152
- compile_cxx(source_file, "#{optimize} #{cxxflags} -o #{object_file}".strip)
153
- end
154
- end
155
- end
156
-
157
- task "#{@namespace}:clean" do
158
- sh "rm -f #{object_filenames.join(' ')}"
159
- end
160
-
161
- if aggregate_sources?
162
- aggregate_source = "#{@output_dir}/#{category}.cpp"
163
- aggregate_object = "#{@output_dir}/#{category}.o"
164
-
165
- file(aggregate_object => dependencies_for(object_names)) do
166
- ensure_directory_exists(File.dirname(aggregate_source))
167
- ensure_directory_exists(File.dirname(aggregate_object))
168
-
169
- File.open(aggregate_source, "w") do |f|
170
- f.puts %q{
171
- #ifndef _GNU_SOURCE
172
- #define _GNU_SOURCE
173
- #endif
174
- }
175
- object_names.each do |object_name|
176
- options = @all_components[object_name]
177
- source_file = options[:source].sub(%r(^ext/common), '')
178
- f.puts "#include \"#{source_file}\""
179
- end
180
- end
181
-
182
- compile_cxx(aggregate_source, "#{flags} -o #{aggregate_object}")
183
- end
184
-
185
- task "#{@namespace}:clean" do
186
- sh "rm -f #{aggregate_source} #{aggregate_object}"
187
- end
188
- elsif false
189
- # Feature disabled: we don't want to waste too much space when
190
- # packaging the runtime ('passenger package-runtime') so we
191
- # never generate static libraries.
192
- library = "#{@output_dir}/#{category}.a"
193
-
194
- file(library => object_filenames) do
195
- create_static_library(library, object_filenames.join(' '))
196
- end
197
-
198
- task "#{@namespace}:clean" do
199
- sh "rm -f #{library}"
200
- end
201
- end
202
- end
203
-
204
- def set_namespace!(namespace)
205
- @namespace = namespace
206
- return self
207
- end
208
-
209
- def set_output_dir!(dir)
210
- @output_dir = dir
211
- return self
212
- end
213
-
214
- def only!(*selector)
215
- new_components = apply_selector(*selector)
216
- @selected_components = new_components
217
- return self
218
- end
219
-
220
- def exclude!(*selector)
221
- apply_selector(*selector).each_key do |object_name|
222
- @selected_components.delete(object_name)
223
- end
224
- return self
225
- end
226
-
227
- def apply_selector(*selector)
228
- result = {}
229
- selector = [selector].flatten
230
- selector.each do |condition|
231
- @selected_components.each do |object_name, options|
232
- if component_satisfies_condition?(object_name, options, condition)
233
- result[object_name] = options
234
- end
235
- end
236
- end
237
- return result
238
- end
239
-
240
- def component_satisfies_condition?(object_name, options, condition)
241
- case condition
242
- when Symbol
243
- return condition == :all || options[:category] == condition
244
- when String
245
- return object_name == condition
246
- else
247
- raise ArgumentError, "Invalid condition #{condition.inspect}"
248
- end
249
- end
250
-
251
- def ensure_directory_exists(dir)
252
- sh("mkdir -p #{dir}") if !File.directory?(dir)
253
- end
254
-
255
- def selected_categories
256
- categories = {}
257
- @selected_components.each_value do |options|
258
- categories[options[:category]] = true
259
- end
260
- return categories.keys
261
- end
262
-
263
- def category_complete?(category)
264
- expected = 0
265
- actual = 0
266
- @all_components.each_value do |options|
267
- if options[:category] == category
268
- expected += 1
269
- end
270
- end
271
- @selected_components.each_value do |options|
272
- if options[:category] == category
273
- actual += 1
274
- end
275
- end
276
- return expected == actual
277
- end
278
-
279
- def selected_objects_beloging_to_category(category)
280
- result = []
281
- @selected_components.each_pair do |object_name, options|
282
- if options[:category] == category
283
- result << object_name
284
- end
285
- end
286
- return result
287
- end
288
-
289
- def dependencies_for(component_options_or_object_names)
290
- result = nil
291
- case component_options_or_object_names
292
- when Hash
293
- component_options = component_options_or_object_names
294
- result = ["ext/common/#{component_options[:source]}"]
295
- component_options[:deps].each do |dependency|
296
- result << "ext/common/#{dependency}"
297
- end
298
- when Array
299
- result = []
300
- object_names = component_options_or_object_names
301
- object_names.each do |object_name|
302
- options = @all_components[object_name]
303
- result.concat(dependencies_for(options))
304
- end
305
- result.uniq!
306
- end
307
- return result
308
- end
309
-
310
- def object_filenames_for(object_names)
311
- return object_names.map { |name| "#{@output_dir}/#{name}" }
312
- end
313
-
314
- def group_all_components_by_category
315
- categories = {}
316
- @all_ordered_components.each do |object_name|
317
- options = @all_components[object_name]
318
- category = options[:category]
319
- categories[category] ||= []
320
- categories[category] << object_name
321
- end
322
- return categories
323
- end
324
-
325
- def aggregate_sources?
326
- # Feature disabled: it's too hard to make it work because
327
- # lots of executables have to be linked to individual objects
328
- # anyway.
329
- return false
330
- end
124
+ def define_category_tasks(category, object_names, cflags, cxxflags)
125
+ object_filenames = object_filenames_for(object_names)
126
+
127
+ object_names.each do |object_name|
128
+ options = @all_components[object_name]
129
+ source_file = "ext/common/#{options[:source]}"
130
+ object_file = "#{@output_dir}/#{object_name}"
131
+
132
+ file(object_file => dependencies_for(options)) do
133
+ case options[:optimize]
134
+ when :light
135
+ optimize = "-O1"
136
+ when true, :heavy
137
+ optimize = "-O2"
138
+ when :very_heavy
139
+ optimize = "-O3"
140
+ when nil
141
+ optimize = @default_optimization_level
142
+ else
143
+ raise "Unknown optimization level #{options[:optimize]}"
144
+ end
145
+ if options[:strict_aliasing] == false
146
+ optimize = "#{optimize} -fno-strict-aliasing"
147
+ end
148
+ ensure_directory_exists(File.dirname(object_file))
149
+ if source_file =~ /\.c$/
150
+ compile_c(source_file, "#{optimize} #{cflags} -o #{object_file}".strip)
151
+ else
152
+ compile_cxx(source_file, "#{optimize} #{cxxflags} -o #{object_file}".strip)
153
+ end
154
+ end
155
+ end
156
+
157
+ task "#{@namespace}:clean" do
158
+ sh "rm -f #{object_filenames.join(' ')}"
159
+ end
160
+
161
+ if aggregate_sources?
162
+ aggregate_source = "#{@output_dir}/#{category}.cpp"
163
+ aggregate_object = "#{@output_dir}/#{category}.o"
164
+
165
+ file(aggregate_object => dependencies_for(object_names)) do
166
+ ensure_directory_exists(File.dirname(aggregate_source))
167
+ ensure_directory_exists(File.dirname(aggregate_object))
168
+
169
+ File.open(aggregate_source, "w") do |f|
170
+ f.puts %q{
171
+ #ifndef _GNU_SOURCE
172
+ #define _GNU_SOURCE
173
+ #endif
174
+ }
175
+ object_names.each do |object_name|
176
+ options = @all_components[object_name]
177
+ source_file = options[:source].sub(%r(^ext/common), '')
178
+ f.puts "#include \"#{source_file}\""
179
+ end
180
+ end
181
+
182
+ compile_cxx(aggregate_source, "#{flags} -o #{aggregate_object}")
183
+ end
184
+
185
+ task "#{@namespace}:clean" do
186
+ sh "rm -f #{aggregate_source} #{aggregate_object}"
187
+ end
188
+ elsif false
189
+ # Feature disabled: we don't want to waste too much space when
190
+ # packaging the runtime ('passenger package-runtime') so we
191
+ # never generate static libraries.
192
+ library = "#{@output_dir}/#{category}.a"
193
+
194
+ file(library => object_filenames) do
195
+ create_static_library(library, object_filenames.join(' '))
196
+ end
197
+
198
+ task "#{@namespace}:clean" do
199
+ sh "rm -f #{library}"
200
+ end
201
+ end
202
+ end
203
+
204
+ def set_namespace!(namespace)
205
+ @namespace = namespace
206
+ return self
207
+ end
208
+
209
+ def set_output_dir!(dir)
210
+ @output_dir = dir
211
+ return self
212
+ end
213
+
214
+ def only!(*selector)
215
+ new_components = apply_selector(*selector)
216
+ @selected_components = new_components
217
+ return self
218
+ end
219
+
220
+ def exclude!(*selector)
221
+ apply_selector(*selector).each_key do |object_name|
222
+ @selected_components.delete(object_name)
223
+ end
224
+ return self
225
+ end
226
+
227
+ def apply_selector(*selector)
228
+ result = {}
229
+ selector = [selector].flatten
230
+ selector.each do |condition|
231
+ @selected_components.each do |object_name, options|
232
+ if component_satisfies_condition?(object_name, options, condition)
233
+ result[object_name] = options
234
+ end
235
+ end
236
+ end
237
+ return result
238
+ end
239
+
240
+ def component_satisfies_condition?(object_name, options, condition)
241
+ case condition
242
+ when Symbol
243
+ return condition == :all || options[:category] == condition
244
+ when String
245
+ return object_name == condition
246
+ else
247
+ raise ArgumentError, "Invalid condition #{condition.inspect}"
248
+ end
249
+ end
250
+
251
+ def ensure_directory_exists(dir)
252
+ sh("mkdir -p #{dir}") if !File.directory?(dir)
253
+ end
254
+
255
+ def selected_categories
256
+ categories = {}
257
+ @selected_components.each_value do |options|
258
+ categories[options[:category]] = true
259
+ end
260
+ return categories.keys
261
+ end
262
+
263
+ def category_complete?(category)
264
+ expected = 0
265
+ actual = 0
266
+ @all_components.each_value do |options|
267
+ if options[:category] == category
268
+ expected += 1
269
+ end
270
+ end
271
+ @selected_components.each_value do |options|
272
+ if options[:category] == category
273
+ actual += 1
274
+ end
275
+ end
276
+ return expected == actual
277
+ end
278
+
279
+ def selected_objects_beloging_to_category(category)
280
+ result = []
281
+ @selected_components.each_pair do |object_name, options|
282
+ if options[:category] == category
283
+ result << object_name
284
+ end
285
+ end
286
+ return result
287
+ end
288
+
289
+ def dependencies_for(component_options_or_object_names)
290
+ result = nil
291
+ case component_options_or_object_names
292
+ when Hash
293
+ component_options = component_options_or_object_names
294
+ result = ["ext/common/#{component_options[:source]}"]
295
+ component_options[:deps].each do |dependency|
296
+ result << "ext/common/#{dependency}"
297
+ end
298
+ when Array
299
+ result = []
300
+ object_names = component_options_or_object_names
301
+ object_names.each do |object_name|
302
+ options = @all_components[object_name]
303
+ result.concat(dependencies_for(options))
304
+ end
305
+ result.uniq!
306
+ end
307
+ return result
308
+ end
309
+
310
+ def object_filenames_for(object_names)
311
+ return object_names.map { |name| "#{@output_dir}/#{name}" }
312
+ end
313
+
314
+ def group_all_components_by_category
315
+ categories = {}
316
+ @all_ordered_components.each do |object_name|
317
+ options = @all_components[object_name]
318
+ category = options[:category]
319
+ categories[category] ||= []
320
+ categories[category] << object_name
321
+ end
322
+ return categories
323
+ end
324
+
325
+ def aggregate_sources?
326
+ # Feature disabled: it's too hard to make it work because
327
+ # lots of executables have to be linked to individual objects
328
+ # anyway.
329
+ return false
330
+ end
331
331
  end
332
332
 
333
333
 
334
334
  COMMON_LIBRARY = CommonLibraryBuilder.new do
335
- define_component 'Logging.o',
336
- :source => 'Logging.cpp',
337
- :category => :base,
338
- :optimize => :light,
339
- :deps => %w(
340
- Logging.cpp
341
- Logging.h
342
- )
343
- define_component 'Exceptions.o',
344
- :source => 'Exceptions.cpp',
345
- :category => :base,
346
- :deps => %w(
347
- Exceptions.h
348
- )
349
- define_component 'Utils/SystemTime.o',
350
- :source => 'Utils/SystemTime.cpp',
351
- :category => :base,
352
- :deps => %w(
353
- Utils/SystemTime.h
354
- )
355
- define_component 'Utils/StrIntUtils.o',
356
- :source => 'Utils/StrIntUtils.cpp',
357
- :category => :base,
358
- :optimize => :very_heavy,
359
- :deps => %w(
360
- Utils/StrIntUtils.h
361
- )
362
- define_component 'Utils/StrIntUtilsNoStrictAliasing.o',
363
- :source => 'Utils/StrIntUtilsNoStrictAliasing.cpp',
364
- :category => :base,
365
- # Compiling with -O3 causes segfaults on RHEL 6
366
- :optimize => :heavy,
367
- :strict_aliasing => false,
368
- :deps => %w(
369
- Utils/StrIntUtils.h
370
- )
371
- define_component 'Utils/IOUtils.o',
372
- :source => 'Utils/IOUtils.cpp',
373
- :optimize => :light,
374
- :category => :base,
375
- :deps => %w(
376
- Utils/IOUtils.h
377
- )
378
- define_component 'Utils.o',
379
- :source => 'Utils.cpp',
380
- :category => :base,
381
- :deps => %w(
382
- Utils.h
383
- Utils/StrIntUtils.h
384
- ResourceLocator.h
385
- )
386
-
387
- define_component 'Utils/modp_b64.o',
388
- :source => 'Utils/modp_b64.cpp',
389
- :category => :other,
390
- :optimize => true,
391
- :deps => %w(
392
- Utils/modp_b64.h
393
- Utils/modp_b64_data.h
394
- )
395
- define_component 'Utils/CachedFileStat.o',
396
- :source => 'Utils/CachedFileStat.cpp',
397
- :category => :other,
398
- :deps => %w(
399
- Utils/CachedFileStat.h
400
- Utils/CachedFileStat.hpp
401
- )
402
- define_component 'Utils/LargeFiles.o',
403
- :source => 'Utils/LargeFiles.cpp',
404
- :category => :other,
405
- :deps => %w(
406
- Utils/LargeFiles.h
407
- )
408
- define_component 'ApplicationPool2/Implementation.o',
409
- :source => 'ApplicationPool2/Implementation.cpp',
410
- :category => :other,
411
- :deps => %w(
412
- ApplicationPool2/Spawner.h
413
- ApplicationPool2/Common.h
414
- ApplicationPool2/Pool.h
415
- ApplicationPool2/SuperGroup.h
416
- ApplicationPool2/Group.h
417
- ApplicationPool2/Process.h
418
- ApplicationPool2/Socket.h
419
- ApplicationPool2/Session.h
420
- ApplicationPool2/Options.h
421
- ApplicationPool2/PipeWatcher.h
422
- ApplicationPool2/AppTypes.h
423
- ApplicationPool2/Spawner.h
424
- ApplicationPool2/SpawnerFactory.h
425
- ApplicationPool2/SmartSpawner.h
426
- ApplicationPool2/DirectSpawner.h
427
- ApplicationPool2/DummySpawner.h
428
- )
429
- define_component 'ApplicationPool2/AppTypes.o',
430
- :source => 'ApplicationPool2/AppTypes.cpp',
431
- :category => :other,
432
- :deps => %w(
433
- ApplicationPool2/AppTypes.h
434
- Utils/StrIntUtils.h
435
- Utils/CachedFileStat.h
436
- )
437
- define_component 'AgentsStarter.o',
438
- :source => 'AgentsStarter.cpp',
439
- :category => :other,
440
- :deps => %w(
441
- AgentsStarter.h
442
- ResourceLocator.h
443
- MessageClient.h
444
- Utils/IniFile.h
445
- Utils/VariantMap.h
446
- )
447
- define_component 'AgentsBase.o',
448
- :source => 'agents/Base.cpp',
449
- :category => :other,
450
- :deps => %w(
451
- agents/Base.h
452
- Utils/VariantMap.h
453
- )
454
- define_component 'agents/LoggingAgent/FilterSupport.o',
455
- :source => 'agents/LoggingAgent/FilterSupport.cpp',
456
- :category => :logging_agent,
457
- :deps => %w(
458
- agents/LoggingAgent/FilterSupport.h
459
- )
460
- define_component 'MemoryKit/mbuf.o',
461
- :source => 'MemoryKit/mbuf.cpp',
462
- :category => :other,
463
- :optimize => true,
464
- :deps => %w(
465
- MemoryKit/palloc.h
466
- )
467
- define_component 'MemoryKit/palloc.o',
468
- :source => 'MemoryKit/palloc.cpp',
469
- :category => :other,
470
- :optimize => true,
471
- :deps => %w(
472
- MemoryKit/palloc.h
473
- )
474
- define_component 'MemoryKit/palloc.o',
475
- :source => 'MemoryKit/palloc.cpp',
476
- :category => :other,
477
- :optimize => true,
478
- :deps => %w(
479
- MemoryKit/palloc.h
480
- )
481
- define_component 'ServerKit/http_parser.o',
482
- :source => 'ServerKit/http_parser.cpp',
483
- :category => :other,
484
- :optimize => :very_heavy,
485
- :deps => %w(
486
- ServerKit/http_parser.h
487
- )
488
- define_component 'ServerKit/Implementation.o',
489
- :source => 'ServerKit/Implementation.cpp',
490
- :category => :other,
491
- :optimize => true
492
- define_component 'Utils/MD5.o',
493
- :source => 'Utils/MD5.cpp',
494
- :category => :other,
495
- :optimize => true,
496
- :deps => %w(
497
- Utils/MD5.h
498
- )
499
- define_component 'Utils/Hasher.o',
500
- :source => 'Utils/Hasher.cpp',
501
- :category => :other,
502
- :optimize => :very_heavy,
503
- :deps => %w(
504
- Utils/Hasher.h
505
- )
506
- define_component 'Utils/jsoncpp.o',
507
- :source => 'Utils/jsoncpp.cpp',
508
- :category => :other,
509
- :optimize => true,
510
- :deps => %w(
511
- Utils/json.h
512
- Utils/json-forwards.h
513
- )
514
-
515
- #'BCrypt.o' => %w(
516
- # BCrypt.cpp
517
- # BCrypt.h
518
- # Blowfish.h
519
- # Blowfish.c)
335
+ define_component 'Logging.o',
336
+ :source => 'Logging.cpp',
337
+ :category => :base,
338
+ :optimize => :light,
339
+ :deps => %w(
340
+ Logging.cpp
341
+ Logging.h
342
+ )
343
+ define_component 'Exceptions.o',
344
+ :source => 'Exceptions.cpp',
345
+ :category => :base,
346
+ :deps => %w(
347
+ Exceptions.h
348
+ )
349
+ define_component 'Utils/SystemTime.o',
350
+ :source => 'Utils/SystemTime.cpp',
351
+ :category => :base,
352
+ :deps => %w(
353
+ Utils/SystemTime.h
354
+ )
355
+ define_component 'Utils/StrIntUtils.o',
356
+ :source => 'Utils/StrIntUtils.cpp',
357
+ :category => :base,
358
+ :optimize => :very_heavy,
359
+ :deps => %w(
360
+ Utils/StrIntUtils.h
361
+ )
362
+ define_component 'Utils/StrIntUtilsNoStrictAliasing.o',
363
+ :source => 'Utils/StrIntUtilsNoStrictAliasing.cpp',
364
+ :category => :base,
365
+ # Compiling with -O3 causes segfaults on RHEL 6
366
+ :optimize => :heavy,
367
+ :strict_aliasing => false,
368
+ :deps => %w(
369
+ Utils/StrIntUtils.h
370
+ )
371
+ define_component 'Utils/IOUtils.o',
372
+ :source => 'Utils/IOUtils.cpp',
373
+ :optimize => :light,
374
+ :category => :base,
375
+ :deps => %w(
376
+ Utils/IOUtils.h
377
+ )
378
+ define_component 'Utils.o',
379
+ :source => 'Utils.cpp',
380
+ :category => :base,
381
+ :deps => %w(
382
+ Utils.h
383
+ Utils/StrIntUtils.h
384
+ ResourceLocator.h
385
+ )
386
+
387
+ define_component 'Utils/modp_b64.o',
388
+ :source => 'Utils/modp_b64.cpp',
389
+ :category => :other,
390
+ :optimize => true,
391
+ :deps => %w(
392
+ Utils/modp_b64.h
393
+ Utils/modp_b64_data.h
394
+ )
395
+ define_component 'Utils/CachedFileStat.o',
396
+ :source => 'Utils/CachedFileStat.cpp',
397
+ :category => :other,
398
+ :deps => %w(
399
+ Utils/CachedFileStat.h
400
+ Utils/CachedFileStat.hpp
401
+ )
402
+ define_component 'Utils/LargeFiles.o',
403
+ :source => 'Utils/LargeFiles.cpp',
404
+ :category => :other,
405
+ :deps => %w(
406
+ Utils/LargeFiles.h
407
+ )
408
+ define_component 'ApplicationPool2/Implementation.o',
409
+ :source => 'ApplicationPool2/Implementation.cpp',
410
+ :category => :other,
411
+ :deps => %w(
412
+ ApplicationPool2/Spawner.h
413
+ ApplicationPool2/Common.h
414
+ ApplicationPool2/Pool.h
415
+ ApplicationPool2/SuperGroup.h
416
+ ApplicationPool2/Group.h
417
+ ApplicationPool2/Process.h
418
+ ApplicationPool2/Socket.h
419
+ ApplicationPool2/Session.h
420
+ ApplicationPool2/Options.h
421
+ ApplicationPool2/PipeWatcher.h
422
+ ApplicationPool2/AppTypes.h
423
+ ApplicationPool2/Spawner.h
424
+ ApplicationPool2/SpawnerFactory.h
425
+ ApplicationPool2/SmartSpawner.h
426
+ ApplicationPool2/DirectSpawner.h
427
+ ApplicationPool2/DummySpawner.h
428
+ )
429
+ define_component 'ApplicationPool2/AppTypes.o',
430
+ :source => 'ApplicationPool2/AppTypes.cpp',
431
+ :category => :other,
432
+ :deps => %w(
433
+ ApplicationPool2/AppTypes.h
434
+ Utils/StrIntUtils.h
435
+ Utils/CachedFileStat.h
436
+ )
437
+ define_component 'AgentsStarter.o',
438
+ :source => 'AgentsStarter.cpp',
439
+ :category => :other,
440
+ :deps => %w(
441
+ AgentsStarter.h
442
+ ResourceLocator.h
443
+ MessageClient.h
444
+ Utils/IniFile.h
445
+ Utils/VariantMap.h
446
+ )
447
+ define_component 'AgentsBase.o',
448
+ :source => 'agents/Base.cpp',
449
+ :category => :other,
450
+ :deps => %w(
451
+ agents/Base.h
452
+ Utils/VariantMap.h
453
+ )
454
+ define_component 'agents/LoggingAgent/FilterSupport.o',
455
+ :source => 'agents/LoggingAgent/FilterSupport.cpp',
456
+ :category => :logging_agent,
457
+ :deps => %w(
458
+ agents/LoggingAgent/FilterSupport.h
459
+ )
460
+ define_component 'MemoryKit/mbuf.o',
461
+ :source => 'MemoryKit/mbuf.cpp',
462
+ :category => :other,
463
+ :optimize => true,
464
+ :deps => %w(
465
+ MemoryKit/palloc.h
466
+ )
467
+ define_component 'MemoryKit/palloc.o',
468
+ :source => 'MemoryKit/palloc.cpp',
469
+ :category => :other,
470
+ :optimize => true,
471
+ :deps => %w(
472
+ MemoryKit/palloc.h
473
+ )
474
+ define_component 'ServerKit/http_parser.o',
475
+ :source => 'ServerKit/http_parser.cpp',
476
+ :category => :other,
477
+ :optimize => :very_heavy,
478
+ :deps => %w(
479
+ ServerKit/http_parser.h
480
+ )
481
+ define_component 'ServerKit/Implementation.o',
482
+ :source => 'ServerKit/Implementation.cpp',
483
+ :category => :other,
484
+ :optimize => true
485
+
486
+ define_component 'Utils/MD5.o',
487
+ :source => 'Utils/MD5.cpp',
488
+ :category => :other,
489
+ :optimize => true,
490
+ :deps => %w(
491
+ Utils/MD5.h
492
+ )
493
+ define_component 'Utils/Hasher.o',
494
+ :source => 'Utils/Hasher.cpp',
495
+ :category => :other,
496
+ :optimize => :very_heavy,
497
+ :deps => %w(
498
+ Utils/Hasher.h
499
+ )
500
+ define_component 'Utils/jsoncpp.o',
501
+ :source => 'Utils/jsoncpp.cpp',
502
+ :category => :other,
503
+ :optimize => true,
504
+ :deps => %w(
505
+ Utils/json.h
506
+ Utils/json-forwards.h
507
+ )
508
+
509
+ #'BCrypt.o' => %w(
510
+ # BCrypt.cpp
511
+ # BCrypt.h
512
+ # Blowfish.h
513
+ # Blowfish.c)
520
514
  end
521
515
 
522
516
  # Objects that must be linked into the Nginx binary.
523
517
  NGINX_LIBS_SELECTOR = [:base, 'AgentsStarter.o', 'ApplicationPool2/AppTypes.o',
524
- 'Utils/CachedFileStat.o', 'agents/LoggingAgent/FilterSupport.o']
518
+ 'Utils/CachedFileStat.o', 'agents/LoggingAgent/FilterSupport.o']