passenger 3.9.2.beta → 4.0.0.rc4

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 (159) hide show
  1. data/.travis.yml +3 -0
  2. data/NEWS +77 -7
  3. data/README.md +3 -11
  4. data/bin/passenger-install-apache2-module +24 -20
  5. data/bin/passenger-install-nginx-module +25 -23
  6. data/build/agents.rb +11 -0
  7. data/build/apache2.rb +9 -5
  8. data/build/basics.rb +37 -30
  9. data/build/common_library.rb +4 -1
  10. data/build/cplusplus_support.rb +5 -5
  11. data/build/cxx_tests.rb +28 -8
  12. data/build/integration_tests.rb +6 -3
  13. data/build/nginx.rb +3 -3
  14. data/build/packaging.rb +95 -57
  15. data/build/ruby_extension.rb +34 -21
  16. data/build/ruby_tests.rb +4 -2
  17. data/build/test_basics.rb +1 -1
  18. data/dev/run_travis.sh +36 -1
  19. data/doc/Users guide Apache.html +425 -308
  20. data/doc/Users guide Apache.idmap.txt +78 -70
  21. data/doc/Users guide Apache.index.sqlite3 +0 -0
  22. data/doc/Users guide Apache.txt +33 -92
  23. data/doc/Users guide Nginx.html +519 -220
  24. data/doc/Users guide Nginx.idmap.txt +78 -60
  25. data/doc/Users guide Nginx.txt +115 -26
  26. data/doc/Users guide Standalone.html +8 -2
  27. data/doc/users_guide_snippets/analysis_and_system_maintenance.txt +1 -7
  28. data/doc/users_guide_snippets/installation.txt +167 -22
  29. data/doc/users_guide_snippets/rackup_specifications.txt +4 -0
  30. data/doc/users_guide_snippets/since_version.txt +1 -0
  31. data/doc/users_guide_snippets/support_information.txt +3 -7
  32. data/doc/users_guide_snippets/tips.txt +0 -24
  33. data/ext/apache2/Configuration.cpp +11 -33
  34. data/ext/apache2/Configuration.hpp +3 -18
  35. data/ext/apache2/DirectoryMapper.h +20 -70
  36. data/ext/apache2/Hooks.cpp +2 -2
  37. data/ext/common/AgentsStarter.cpp +0 -2
  38. data/ext/common/AgentsStarter.h +0 -1
  39. data/ext/common/AgentsStarter.hpp +1 -3
  40. data/ext/common/ApplicationPool2/AppTypes.cpp +74 -0
  41. data/ext/common/ApplicationPool2/AppTypes.h +202 -0
  42. data/ext/common/ApplicationPool2/Common.h +12 -10
  43. data/ext/common/ApplicationPool2/DirectSpawner.h +256 -0
  44. data/ext/common/ApplicationPool2/DummySpawner.h +90 -0
  45. data/ext/common/ApplicationPool2/Group.h +311 -94
  46. data/ext/common/ApplicationPool2/Implementation.cpp +405 -145
  47. data/ext/common/ApplicationPool2/Options.h +24 -26
  48. data/ext/common/ApplicationPool2/PipeWatcher.h +20 -13
  49. data/ext/common/ApplicationPool2/Pool.h +326 -183
  50. data/ext/common/ApplicationPool2/Process.h +205 -55
  51. data/ext/common/ApplicationPool2/README.md +1 -1
  52. data/ext/common/ApplicationPool2/Session.h +21 -10
  53. data/ext/common/ApplicationPool2/SmartSpawner.h +801 -0
  54. data/ext/common/ApplicationPool2/Spawner.h +141 -1149
  55. data/ext/common/ApplicationPool2/SpawnerFactory.h +132 -0
  56. data/ext/common/ApplicationPool2/SuperGroup.h +146 -223
  57. data/ext/common/Constants.h +4 -2
  58. data/ext/common/Exceptions.h +23 -1
  59. data/ext/common/Logging.cpp +17 -6
  60. data/ext/common/Logging.h +37 -7
  61. data/ext/common/ResourceLocator.h +1 -1
  62. data/ext/common/Utils.cpp +49 -1
  63. data/ext/common/Utils.h +13 -4
  64. data/ext/common/{AnsiColorConstants.h → Utils/AnsiColorConstants.h} +0 -0
  65. data/ext/common/{BCrypt.cpp → Utils/BCrypt.cpp} +0 -0
  66. data/ext/common/{BCrypt.h → Utils/BCrypt.h} +0 -0
  67. data/ext/common/{Blowfish.c → Utils/Blowfish.c} +0 -0
  68. data/ext/common/{Blowfish.h → Utils/Blowfish.h} +0 -0
  69. data/ext/common/Utils/CachedFileStat.hpp +27 -25
  70. data/ext/common/Utils/Curl.h +184 -0
  71. data/ext/common/{HttpConstants.h → Utils/HttpConstants.h} +3 -0
  72. data/ext/common/Utils/IOUtils.cpp +6 -2
  73. data/ext/common/{IniFile.h → Utils/IniFile.h} +0 -0
  74. data/ext/common/Utils/LargeFiles.cpp +30 -0
  75. data/ext/common/Utils/LargeFiles.h +40 -0
  76. data/ext/common/Utils/StrIntUtils.cpp +72 -8
  77. data/ext/common/Utils/StrIntUtils.h +24 -2
  78. data/ext/common/Utils/StringMap.h +12 -2
  79. data/ext/common/Utils/VariantMap.h +51 -2
  80. data/ext/common/Utils/jsoncpp.cpp +1 -1
  81. data/ext/common/agents/Base.cpp +147 -11
  82. data/ext/common/agents/HelperAgent/AgentOptions.h +14 -6
  83. data/ext/common/agents/HelperAgent/Main.cpp +79 -19
  84. data/ext/common/agents/HelperAgent/RequestHandler.h +36 -16
  85. data/ext/common/agents/LoggingAgent/LoggingServer.h +3 -5
  86. data/ext/common/agents/LoggingAgent/Main.cpp +2 -4
  87. data/ext/common/agents/LoggingAgent/RemoteSender.h +18 -24
  88. data/ext/common/agents/SpawnPreparer.cpp +7 -0
  89. data/ext/common/agents/Watchdog/Main.cpp +96 -38
  90. data/ext/nginx/Configuration.c +26 -22
  91. data/ext/nginx/Configuration.h +4 -2
  92. data/ext/nginx/ContentHandler.c +23 -52
  93. data/ext/nginx/ContentHandler.h +5 -11
  94. data/ext/nginx/config +10 -3
  95. data/ext/nginx/ngx_http_passenger_module.c +21 -6
  96. data/ext/nginx/ngx_http_passenger_module.h +4 -1
  97. data/ext/oxt/dynamic_thread_group.hpp +9 -1
  98. data/ext/oxt/system_calls.cpp +2 -2
  99. data/ext/ruby/extconf.rb +2 -1
  100. data/helper-scripts/backtrace-sanitizer.rb +2 -0
  101. data/helper-scripts/wsgi-loader.py +54 -21
  102. data/lib/phusion_passenger.rb +5 -3
  103. data/lib/phusion_passenger/abstract_installer.rb +18 -41
  104. data/lib/phusion_passenger/admin_tools/memory_stats.rb +2 -2
  105. data/lib/phusion_passenger/admin_tools/server_instance.rb +2 -2
  106. data/lib/phusion_passenger/common_library.rb +23 -3
  107. data/lib/phusion_passenger/debug_logging.rb +10 -3
  108. data/lib/phusion_passenger/packaging.rb +1 -0
  109. data/lib/phusion_passenger/platform_info.rb +113 -115
  110. data/lib/phusion_passenger/platform_info/compiler.rb +224 -134
  111. data/lib/phusion_passenger/platform_info/cxx_portability.rb +143 -0
  112. data/lib/phusion_passenger/platform_info/depcheck.rb +371 -0
  113. data/lib/phusion_passenger/platform_info/depcheck_specs/apache2.rb +124 -0
  114. data/lib/phusion_passenger/platform_info/depcheck_specs/compiler_toolchain.rb +97 -0
  115. data/lib/phusion_passenger/platform_info/depcheck_specs/gems.rb +39 -0
  116. data/lib/phusion_passenger/platform_info/depcheck_specs/libs.rb +118 -0
  117. data/lib/phusion_passenger/platform_info/depcheck_specs/ruby.rb +137 -0
  118. data/lib/phusion_passenger/platform_info/depcheck_specs/utilities.rb +15 -0
  119. data/lib/phusion_passenger/platform_info/operating_system.rb +6 -5
  120. data/lib/phusion_passenger/platform_info/ruby.rb +45 -34
  121. data/lib/phusion_passenger/request_handler.rb +35 -22
  122. data/lib/phusion_passenger/request_handler/thread_handler.rb +5 -6
  123. data/lib/phusion_passenger/ruby_core_enhancements.rb +7 -1
  124. data/lib/phusion_passenger/standalone/runtime_installer.rb +43 -34
  125. data/lib/phusion_passenger/utils/robust_interruption.rb +34 -18
  126. data/passenger.gemspec +25 -0
  127. data/resources/templates/standalone/config.erb +3 -1
  128. data/test/config.json.travis +2 -2
  129. data/test/cxx/ApplicationPool2/DirectSpawnerTest.cpp +37 -5
  130. data/test/cxx/ApplicationPool2/PoolTest.cpp +143 -50
  131. data/test/cxx/ApplicationPool2/ProcessTest.cpp +8 -0
  132. data/test/cxx/ApplicationPool2/SmartSpawnerTest.cpp +28 -17
  133. data/test/cxx/ApplicationPool2/SpawnerTestCases.cpp +31 -26
  134. data/test/cxx/RequestHandlerTest.cpp +17 -1
  135. data/test/cxx/UtilsTest.cpp +84 -10
  136. data/test/integration_tests/apache2_tests.rb +49 -163
  137. data/test/integration_tests/hello_world_wsgi_spec.rb +2 -2
  138. data/test/integration_tests/mycook_spec.rb +1 -1
  139. data/test/integration_tests/nginx_tests.rb +37 -19
  140. data/test/ruby/request_handler_spec.rb +1 -0
  141. data/test/ruby/spec_helper.rb +52 -1
  142. data/test/stub/nginx/nginx.conf.erb +2 -0
  143. data/test/stub/rack/start.rb +5 -0
  144. data/test/stub/rails3.0/Gemfile.lock +30 -30
  145. data/test/stub/rails3.1/Gemfile +1 -1
  146. data/test/stub/rails3.1/Gemfile.lock +3 -3
  147. data/test/stub/rails3.2/Gemfile +1 -1
  148. data/test/stub/rails3.2/Gemfile.lock +4 -4
  149. data/test/stub/rails_apps/2.3/mycook/app/controllers/welcome_controller.rb +1 -1
  150. data/test/stub/rails_apps/2.3/mycook/app/helpers/recipes_helper.rb +2 -0
  151. data/test/stub/rails_apps/2.3/mycook/app/helpers/test_helper.rb +2 -0
  152. data/test/stub/rails_apps/2.3/mycook/app/helpers/uploads_helper.rb +2 -0
  153. data/test/stub/rails_apps/2.3/mycook/app/helpers/welcome_helper.rb +2 -0
  154. data/test/support/nginx_controller.rb +2 -1
  155. metadata +160 -156
  156. data/build/gempackagetask.rb +0 -99
  157. data/build/packagetask.rb +0 -186
  158. data/ext/common/StringListCreator.h +0 -83
  159. data/lib/phusion_passenger/dependencies.rb +0 -657
@@ -3,8 +3,11 @@ language: ruby
3
3
  env:
4
4
  - TEST_FULL_COMPILE=1
5
5
  - TEST_CXX=1
6
+ - TEST_CXX=1 SUDO=1
6
7
  - TEST_RUBY=1 TEST_RUBY_VERSION=1.8.7
7
8
  - TEST_RUBY=1 TEST_RUBY_VERSION=1.9.3
9
+ - TEST_NGINX=1
10
+ - TEST_APACHE2=1
8
11
 
9
12
  before_install:
10
13
  - sudo apt-get install apache2-mpm-worker apache2-threaded-dev
data/NEWS CHANGED
@@ -1,19 +1,81 @@
1
- Release 3.9.2
2
- -------------
3
-
4
- * JRuby and Rubinius support.
1
+ Release 4.0.0 release candidate 4
2
+ ---------------------------------
3
+
4
+ * Fixed compilation on systems where /tmp is mounted noexec.
5
+ * Fixed some memory corruption bugs.
6
+ * Improved debugging messages.
7
+ * Phusion Passenger Standalone now sets underscores_in_headers.
8
+ Fixes issue #708.
9
+ * Fixed some process spawning compatibility problems, as
10
+ reported in issue #842.
11
+ * The Python WSGI loader now correctly shuts down client sockets
12
+ even when there are child processes that keep the socket open.
13
+ * A new configuration option PassengerPython (Apache) and
14
+ passenger_python (Nginx) has been added so that users can
15
+ customize the Python interpreter on a per-application basis.
16
+ Fixes issue #852.
17
+ * The Apache module now supports file uploads larger than 2 GB
18
+ when on 32-bit systems. Fixes issue #838.
19
+ * The Nginx version now supports the `passenger_temp_dir` option.
20
+ * Environment variables set in the Nginx configuration file
21
+ (through the `env` config option) are now correctly passed to
22
+ all application processes. Fixes issue #371.
23
+ * Fixed support for RVM mixed mode installations. Fixes issue #828.
24
+ * Phusion Passenger now outputs the Date HTTP header in case the
25
+ application didn't already do that (and was violating the HTTP spec).
26
+ Fixes issue #485.
27
+ * Phusion Passenger now checks whether /dev/urandom isn't broken.
28
+ Fixes issue #516.
29
+
30
+
31
+ Release 3.9.5 (4.0.0 release candidate 3)
32
+ -----------------------------------------
33
+
34
+ * Fixed Rake autodetection.
35
+
36
+
37
+ Release 3.9.4 (4.0.0 release candidate 2)
38
+ -----------------------------------------
39
+
40
+ * More bug fixes.
41
+ * More documentation updates.
42
+ * Better crash diagnostics.
43
+
44
+
45
+ Release 3.9.3 (4.0.0 release candidate 1)
46
+ -----------------------------------------
47
+
48
+ * The Nginx version now supports the `passenger_app_root` configuration option.
49
+ * The Enterprise memory limiting feature has been extended to work with non-Ruby applications as well.
50
+ * Application processes that have been killed are now automatically detected within 5 seconds. Previously Phusion Passenger needed to send a request to the process before detecting that it's gone. This change means that when you kill a process by sending it a signal, Phusion Passenger will automatically respawn it within 5 seconds (provided that the process limit settings allow respawning).
51
+ * Phusion Passenger Standalone's HTTP client body limit has been raised from 50 MB to 1 GB.
52
+ * Python 3 support has been added.
53
+ * The build system has been made compatible with JRuby and Ruby 2.0.
54
+ * The installers now print a lot more information about detected system settings so that the user can see whether something has been wrongly detected.
55
+ * Some performance optimizations. These involve further extending the zero-copy architecture, and the use of hash table maps instead of binary tree maps.
56
+ * Many potential crasher and freezer bugs have been fixed.
57
+ * Error diagnostics have been further improved.
58
+ * Many documentation improvements.
59
+
60
+
61
+ Release 3.9.2 (4.0.0 beta 2)
62
+ ----------------------------
63
+
64
+ * New feature: JRuby and Rubinius support.
65
+ * New feature: Out of Band Work.
5
66
  * Sending SIGBART to a Ruby process will now trigger the same behavior
6
67
  as SIGQUIT - that is, it will print a backtrace. This is necessary
7
68
  for proper JRuby support because JRuby cannot catch SIGQUIT.
8
69
  * Rolling restarts and depoyment error resistance are now also available
9
70
  in Phusion Passenger Standalone in the Enterprise version.
10
- * New feature: out of band work.
71
+ * System call failure simulation framework.
11
72
  * Improved crash reporting.
73
+ * Many documentation improvements.
12
74
  * Many bug fixes.
13
75
 
14
76
 
15
- Release 3.9.1
16
- -------------
77
+ Release 3.9.1 (4.0.0 beta 1)
78
+ ----------------------------
17
79
 
18
80
  This is the first beta of Phusion Passenger 4. The changes are numerous.
19
81
 
@@ -34,6 +96,14 @@ This is the first beta of Phusion Passenger 4. The changes are numerous.
34
96
  * Better relocatability without wasting space.
35
97
 
36
98
 
99
+ Release 3.0.20
100
+ --------------
101
+
102
+ * Rebootstrapped the libev configure to fix compilation problems on Solaris 11.
103
+ * Fixed support for RVM mixed mode installations. Fixes issue #828.
104
+ * Fixed encoding problems in Phusion Passenger Standalone.
105
+
106
+
37
107
  Release 3.0.19
38
108
  --------------
39
109
 
data/README.md CHANGED
@@ -22,18 +22,10 @@ For troubleshooting, configuration and tips, please read the corresponding Users
22
22
 
23
23
  These files are included in the source tarball, and may also be viewed online on [our website](https://www.phusionpassenger.com/support).
24
24
 
25
- ## Installing via a gem
25
+ ## Installing as a gem
26
26
 
27
- You may also generate a .gem file, and then install that. First, make sure that you have the following software installed:
28
-
29
- * All usual Phusion Passenger dependencies.
30
- * [Mizuho](https://github.com/FooBarWidget/mizuho).
31
-
32
- Next, run:
33
-
34
- rake package
35
-
36
- The gem will be available under the `pkg` folder.
27
+ gem build passenger.gemspec
28
+ gem install passenger-x.x.x.gem
37
29
 
38
30
  ## Further reading
39
31
 
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # Phusion Passenger - https://www.phusionpassenger.com/
3
- # Copyright (c) 2010, 2011, 2012 Phusion
3
+ # Copyright (c) 2010-2013 Phusion
4
4
  #
5
5
  # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
6
6
  #
@@ -36,29 +36,33 @@ ENV["PATH"] += ":/usr/sbin:/sbin:/usr/local/sbin"
36
36
  require 'optparse'
37
37
  require 'phusion_passenger/platform_info/ruby'
38
38
  require 'phusion_passenger/platform_info/apache'
39
- require 'phusion_passenger/dependencies'
40
39
  require 'phusion_passenger/abstract_installer'
41
40
 
42
41
  class Installer < PhusionPassenger::AbstractInstaller
43
42
  include PhusionPassenger
44
43
 
45
44
  def dependencies
46
- result = [
47
- Dependencies::GCC,
48
- Dependencies::Curl_Dev,
49
- Dependencies::OpenSSL_Dev,
50
- Dependencies::Zlib_Dev,
51
- Dependencies::Ruby_DevHeaders,
52
- Dependencies::Ruby_OpenSSL,
53
- Dependencies::RubyGems,
54
- Dependencies::Rake,
55
- Dependencies::Rack,
56
- Dependencies::Apache2,
57
- Dependencies::Apache2_DevHeaders
45
+ specs = [
46
+ 'depcheck_specs/compiler_toolchain',
47
+ 'depcheck_specs/ruby',
48
+ 'depcheck_specs/gems',
49
+ 'depcheck_specs/libs',
50
+ 'depcheck_specs/apache2'
51
+ ]
52
+ ids = [
53
+ 'gcc',
54
+ 'g++',
55
+ 'libcurl-dev',
56
+ 'openssl-dev',
57
+ 'zlib-dev',
58
+ 'ruby-dev',
59
+ 'ruby-openssl',
60
+ 'rubygems',
61
+ 'rake',
62
+ 'rack',
63
+ 'apache2',
64
+ 'apache2-dev'
58
65
  ]
59
- if Dependencies.fastthread_required?
60
- result << Dependencies::FastThread
61
- end
62
66
  # Some broken servers don't have apr-config or apu-config installed.
63
67
  # Nevertheless, it is possible to compile Apache modules if Apache
64
68
  # was configured with --included-apr. So here we check whether
@@ -67,10 +71,10 @@ class Installer < PhusionPassenger::AbstractInstaller
67
71
  # module can be compiled without their presence.
68
72
  if (PlatformInfo.apr_config && PlatformInfo.apu_config) ||
69
73
  PlatformInfo.apr_config_needed_for_building_apache_modules?
70
- result << Dependencies::APR_DevHeaders
71
- result << Dependencies::APU_DevHeaders
74
+ ids << 'apr-dev'
75
+ ids << 'apu-dev'
72
76
  end
73
- return result
77
+ return [specs, ids]
74
78
  end
75
79
 
76
80
  def users_guide
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  # Phusion Passenger - https://www.phusionpassenger.com/
3
- # Copyright (c) 2010, 2011, 2012 Phusion
3
+ # Copyright (c) 2010-2013 Phusion
4
4
  #
5
5
  # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
6
6
  #
@@ -30,30 +30,33 @@ PhusionPassenger.locate_directories
30
30
  require 'optparse'
31
31
  require 'fileutils'
32
32
  require 'phusion_passenger/platform_info/ruby'
33
- require 'phusion_passenger/dependencies'
34
33
  require 'phusion_passenger/abstract_installer'
35
34
 
36
35
  class Installer < PhusionPassenger::AbstractInstaller
37
36
  include PhusionPassenger
38
37
 
39
38
  def dependencies
40
- result = [
41
- Dependencies::GCC,
42
- Dependencies::Make,
43
- Dependencies::DownloadTool,
44
- Dependencies::Ruby_DevHeaders,
45
- Dependencies::Ruby_OpenSSL,
46
- Dependencies::RubyGems,
47
- Dependencies::Rake,
48
- Dependencies::Rack,
49
- Dependencies::Curl_Dev,
50
- Dependencies::OpenSSL_Dev,
51
- Dependencies::Zlib_Dev
39
+ specs = [
40
+ 'depcheck_specs/compiler_toolchain',
41
+ 'depcheck_specs/ruby',
42
+ 'depcheck_specs/gems',
43
+ 'depcheck_specs/libs',
44
+ 'depcheck_specs/utilities'
52
45
  ]
53
- if Dependencies.fastthread_required?
54
- result << Dependencies::FastThread
55
- end
56
- return result
46
+ ids = [
47
+ 'gcc',
48
+ 'g++',
49
+ 'download-tool',
50
+ 'ruby-dev',
51
+ 'ruby-openssl',
52
+ 'rubygems',
53
+ 'rake',
54
+ 'rack',
55
+ 'libcurl-dev',
56
+ 'openssl-dev',
57
+ 'zlib-dev'
58
+ ]
59
+ return [specs, ids]
57
60
  end
58
61
 
59
62
  def users_guide
@@ -470,11 +473,10 @@ parser = OptionParser.new do |opts|
470
473
  end
471
474
  opts.on("--extra-configure-flags=STRING", String, "Pass these extra flags to Nginx's\n" <<
472
475
  "#{' ' * 37}'configure' script, instead of asking for\n" <<
473
- "#{' ' * 37}it interactively. Only applicable if\n" <<
474
- "#{' ' * 37}--nginx-source-dir is given. Specify\n" <<
475
- "#{' ' * 37}'none' if you do not want to pass\n" <<
476
- "#{' ' * 37}additional flags but do not want this\n" <<
477
- "#{' ' * 37}installer to ask interactively either.") do |flags|
476
+ "#{' ' * 37}it interactively. Specify 'none' if you\n" <<
477
+ "#{' ' * 37}do not want to pass additional flags but do\n" <<
478
+ "#{' ' * 37}not want this installer to ask\n" <<
479
+ "#{' ' * 37}interactively either.") do |flags|
478
480
  options[:extra_configure_flags] = flags
479
481
  end
480
482
  end
@@ -34,12 +34,14 @@ file AGENT_OUTPUT_DIR + 'PassengerWatchdog' => dependencies do
34
34
  sh "mkdir -p #{AGENT_OUTPUT_DIR}" if !File.directory?(AGENT_OUTPUT_DIR)
35
35
  compile_cxx("ext/common/agents/Watchdog/Main.cpp",
36
36
  "-o #{AGENT_OUTPUT_DIR}PassengerWatchdog.o " <<
37
+ "#{EXTRA_PRE_CXXFLAGS} " <<
37
38
  "-Iext -Iext/common " <<
38
39
  "#{PlatformInfo.portability_cflags} #{AGENT_CFLAGS} #{EXTRA_CXXFLAGS}")
39
40
  create_executable(AGENT_OUTPUT_DIR + 'PassengerWatchdog',
40
41
  "#{AGENT_OUTPUT_DIR}PassengerWatchdog.o " <<
41
42
  "#{watchdog_libs.link_objects_as_string} " <<
42
43
  "#{LIBBOOST_OXT} " <<
44
+ "#{EXTRA_PRE_LDFLAGS} " <<
43
45
  "#{PlatformInfo.portability_ldflags} " <<
44
46
  "#{AGENT_LDFLAGS} " <<
45
47
  "#{EXTRA_LDFLAGS}")
@@ -71,6 +73,10 @@ dependencies = [
71
73
  'ext/common/ApplicationPool2/Session.h',
72
74
  'ext/common/ApplicationPool2/Options.h',
73
75
  'ext/common/ApplicationPool2/PipeWatcher.h',
76
+ 'ext/common/ApplicationPool2/Spawner.h',
77
+ 'ext/common/ApplicationPool2/SpawnerFactory.h',
78
+ 'ext/common/ApplicationPool2/SmartSpawner.h',
79
+ 'ext/common/ApplicationPool2/DirectSpawner.h',
74
80
  LIBBOOST_OXT,
75
81
  helper_agent_libs.link_objects,
76
82
  LIBEV_TARGET,
@@ -80,6 +86,7 @@ file AGENT_OUTPUT_DIR + 'PassengerHelperAgent' => dependencies do
80
86
  sh "mkdir -p #{AGENT_OUTPUT_DIR}" if !File.directory?(AGENT_OUTPUT_DIR)
81
87
  compile_cxx("ext/common/agents/HelperAgent/Main.cpp",
82
88
  "-o #{AGENT_OUTPUT_DIR}PassengerHelperAgent.o " <<
89
+ "#{EXTRA_PRE_CXXFLAGS} " <<
83
90
  "-Iext -Iext/common " <<
84
91
  "#{AGENT_CFLAGS} #{LIBEV_CFLAGS} #{LIBEIO_CFLAGS} " <<
85
92
  "#{PlatformInfo.portability_cflags} " <<
@@ -88,6 +95,7 @@ file AGENT_OUTPUT_DIR + 'PassengerHelperAgent' => dependencies do
88
95
  "#{AGENT_OUTPUT_DIR}PassengerHelperAgent.o",
89
96
  "#{helper_agent_libs.link_objects_as_string} " <<
90
97
  "#{LIBBOOST_OXT} " <<
98
+ "#{EXTRA_PRE_LDFLAGS} " <<
91
99
  "#{LIBEV_LIBS} " <<
92
100
  "#{LIBEIO_LIBS} " <<
93
101
  "#{PlatformInfo.portability_ldflags} " <<
@@ -117,6 +125,7 @@ file AGENT_OUTPUT_DIR + 'PassengerLoggingAgent' => dependencies do
117
125
  sh "mkdir -p #{AGENT_OUTPUT_DIR}" if !File.directory?(AGENT_OUTPUT_DIR)
118
126
  compile_cxx("ext/common/agents/LoggingAgent/Main.cpp",
119
127
  "-o #{AGENT_OUTPUT_DIR}PassengerLoggingAgent.o " <<
128
+ "#{EXTRA_PRE_CXXFLAGS} " <<
120
129
  "-Iext -Iext/common " <<
121
130
  "#{AGENT_CFLAGS} #{LIBEV_CFLAGS} " <<
122
131
  "#{PlatformInfo.curl_flags} " <<
@@ -126,6 +135,7 @@ file AGENT_OUTPUT_DIR + 'PassengerLoggingAgent' => dependencies do
126
135
  "#{AGENT_OUTPUT_DIR}PassengerLoggingAgent.o",
127
136
  "#{logging_agent_libs.link_objects_as_string} " <<
128
137
  "#{LIBBOOST_OXT} " <<
138
+ "#{EXTRA_PRE_LDFLAGS} " <<
129
139
  "#{LIBEV_LIBS} " <<
130
140
  "#{PlatformInfo.curl_libs} " <<
131
141
  "#{PlatformInfo.zlib_libs} " <<
@@ -144,6 +154,7 @@ file AGENT_OUTPUT_DIR + 'SpawnPreparer' => dependencies do
144
154
  sh "mkdir -p #{AGENT_OUTPUT_DIR}" if !File.directory?(AGENT_OUTPUT_DIR)
145
155
  create_executable(AGENT_OUTPUT_DIR + 'SpawnPreparer',
146
156
  'ext/common/agents/SpawnPreparer.cpp',
157
+ "#{EXTRA_PRE_CXXFLAGS} #{EXTRA_PRE_LDFLAGS} " <<
147
158
  "-Iext -Iext/common " <<
148
159
  "#{AGENT_CFLAGS} #{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS} " <<
149
160
  "#{spawn_preparer_libs.link_objects_as_string} " <<
@@ -1,5 +1,5 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2010 Phusion
2
+ # Copyright (c) 2010-2013 Phusion
3
3
  #
4
4
  # "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
5
5
  #
@@ -59,14 +59,17 @@ APACHE2_MODULE_INPUT_FILES = {
59
59
  APACHE2_MODULE_OBJECTS = APACHE2_MODULE_INPUT_FILES.keys
60
60
  APACHE2_MOD_PASSENGER_O = APACHE2_OUTPUT_DIR + "mod_passenger.o"
61
61
 
62
- APACHE2_MODULE_CXXFLAGS = "-Iext -Iext/common #{PlatformInfo.apache2_module_cflags} " <<
62
+ APACHE2_MODULE_CXXFLAGS =
63
+ "#{EXTRA_PRE_CXXFLAGS} " <<
64
+ "-Iext -Iext/common #{PlatformInfo.apache2_module_cflags} " <<
63
65
  "#{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS}"
64
66
 
65
67
  APACHE2_MODULE_BOOST_OXT_LIBRARY = define_libboost_oxt_task("apache2",
66
68
  APACHE2_OUTPUT_DIR + "module_libboost_oxt",
67
69
  PlatformInfo.apache2_module_cflags)
68
70
  APACHE2_MODULE_COMMON_LIBRARIES = COMMON_LIBRARY.
69
- only(:base, 'Utils/Base64.o', 'Utils/MD5.o').
71
+ only(:base, 'ApplicationPool2/AppTypes.o', 'Utils/Base64.o',
72
+ 'Utils/MD5.o', 'Utils/LargeFiles.o').
70
73
  set_namespace("apache2").
71
74
  set_output_dir(APACHE2_OUTPUT_DIR + "module_libpassenger_common").
72
75
  define_tasks(PlatformInfo.apache2_module_cflags).
@@ -80,8 +83,8 @@ task :apache2 => [
80
83
  AGENT_OUTPUT_DIR + 'PassengerWatchdog',
81
84
  AGENT_OUTPUT_DIR + 'PassengerLoggingAgent',
82
85
  AGENT_OUTPUT_DIR + 'SpawnPreparer',
83
- :native_support
84
- ]
86
+ NATIVE_SUPPORT_TARGET
87
+ ].compact
85
88
 
86
89
 
87
90
  # Define rules for the individual Apache 2 module source files.
@@ -107,6 +110,7 @@ file APACHE2_MODULE => dependencies do
107
110
 
108
111
  sources = (APACHE2_MODULE_OBJECTS + [APACHE2_MOD_PASSENGER_O]).join(' ')
109
112
  linkflags =
113
+ "#{EXTRA_PRE_CXXFLAGS} #{EXTRA_PRE_LDFLAGS} " <<
110
114
  "#{PlatformInfo.apache2_module_cflags} " <<
111
115
  "#{PlatformInfo.portability_cflags} " <<
112
116
  "#{EXTRA_CXXFLAGS} " <<
@@ -34,12 +34,11 @@ require 'phusion_passenger/platform_info/apache'
34
34
  require 'phusion_passenger/platform_info/curl'
35
35
  require 'phusion_passenger/platform_info/zlib'
36
36
  require 'phusion_passenger/platform_info/compiler'
37
+ require 'phusion_passenger/platform_info/cxx_portability'
37
38
 
38
39
  include PhusionPassenger
39
40
  include PhusionPassenger::PlatformInfo
40
41
 
41
- require 'build/packagetask'
42
- require 'build/gempackagetask'
43
42
  require 'build/rake_extensions'
44
43
  require 'build/cplusplus_support'
45
44
 
@@ -65,6 +64,33 @@ end
65
64
 
66
65
  #################################################
67
66
 
67
+ if string_option('OUTPUT_DIR')
68
+ OUTPUT_DIR = string_option('OUTPUT_DIR') + "/"
69
+ else
70
+ OUTPUT_DIR = ""
71
+ end
72
+
73
+ verbose true if !boolean_option('REALLY_QUIET')
74
+ if boolean_option('STDERR_TO_STDOUT')
75
+ # Just redirecting the file descriptor isn't enough because
76
+ # data written to STDERR might arrive in an unexpected order
77
+ # compared to STDOUT.
78
+ STDERR.reopen(STDOUT)
79
+ Object.send(:remove_const, :STDERR)
80
+ STDERR = STDOUT
81
+ $stderr = $stdout
82
+ end
83
+
84
+ if boolean_option('CACHING', true) && !boolean_option('RELEASE')
85
+ if OUTPUT_DIR.empty?
86
+ PlatformInfo.cache_dir = File.expand_path("cache", File.dirname(__FILE__))
87
+ else
88
+ PlatformInfo.cache_dir = OUTPUT_DIR + "cache"
89
+ end
90
+ end
91
+
92
+ #################################################
93
+
68
94
  OPTIMIZE = boolean_option("OPTIMIZE")
69
95
  CC = string_option("CC", "gcc")
70
96
  CXX = string_option("CXX", "g++")
@@ -97,24 +123,25 @@ AGENT_LDFLAGS << " -Wl,-dead_strip" if RUBY_PLATFORM =~ /darwin/
97
123
  AGENT_LDFLAGS.strip!
98
124
 
99
125
  # Extra compiler flags that should always be passed to the C/C++ compiler.
100
- # Should be included last in the command string, even after PlatformInfo.portability_cflags.
126
+ # These should be included first in the command string, before anything else.
127
+ EXTRA_PRE_CFLAGS = string_option('EXTRA_PRE_CFLAGS', '').gsub("\n", " ")
128
+ EXTRA_PRE_CXXFLAGS = string_option('EXTRA_PRE_CXXFLAGS', '').gsub("\n", " ")
129
+ # These should be included last in the command string, even after PlatformInfo.portability_cflags.
101
130
  EXTRA_CXXFLAGS = "-Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-long-long"
102
131
  EXTRA_CXXFLAGS << " -Wno-missing-field-initializers" if PlatformInfo.compiler_supports_wno_missing_field_initializers_flag?
103
132
  EXTRA_CXXFLAGS << " -mno-tls-direct-seg-refs" if PlatformInfo.requires_no_tls_direct_seg_refs? && PlatformInfo.compiler_supports_no_tls_direct_seg_refs_option?
104
133
  # Work around Clang warnings in ev++.h.
105
134
  EXTRA_CXXFLAGS << " -Wno-ambiguous-member-template" if PlatformInfo.cxx_is_clang?
106
135
  EXTRA_CXXFLAGS << " #{OPTIMIZATION_FLAGS}" if !OPTIMIZATION_FLAGS.empty?
136
+ EXTRA_CXXFLAGS << " " << string_option('EXTRA_CXXFLAGS').gsub("\n", " ") if string_option('EXTRA_CXXFLAGS')
107
137
 
108
138
  # Extra linker flags that should always be passed to the linker.
109
- # Should be included last in the command string, even after PlatformInfo.portability_ldflags.
110
- EXTRA_LDFLAGS = ""
139
+ # These should be included first in the command string, before anything else.
140
+ EXTRA_PRE_LDFLAGS = string_option('EXTRA_PRE_LDFLAGS', '').gsub("\n", " ")
141
+ # These should be included last in the command string, even after PlatformInfo.portability_ldflags.
142
+ EXTRA_LDFLAGS = string_option('EXTRA_LDFLAGS', '').gsub("\n", " ")
111
143
 
112
144
 
113
- if string_option('OUTPUT_DIR')
114
- OUTPUT_DIR = string_option('OUTPUT_DIR') + "/"
115
- else
116
- OUTPUT_DIR = ""
117
- end
118
145
  AGENT_OUTPUT_DIR = string_option('AGENT_OUTPUT_DIR', OUTPUT_DIR + "agents") + "/"
119
146
  COMMON_OUTPUT_DIR = string_option('COMMON_OUTPUT_DIR', OUTPUT_DIR + "libout/common") + "/"
120
147
  APACHE2_OUTPUT_DIR = string_option('APACHE2_OUTPUT_DIR', OUTPUT_DIR + "libout/apache2") + "/"
@@ -129,23 +156,3 @@ RUBY_EXTENSION_OUTPUT_DIR = string_option('RUBY_EXTENSION_OUTPUT_DIR',
129
156
  USE_VENDORED_LIBEV = boolean_option("USE_VENDORED_LIBEV", true)
130
157
  # Whether to use the vendored libeio or the system one.
131
158
  USE_VENDORED_LIBEIO = boolean_option("USE_VENDORED_LIBEIO", true)
132
-
133
-
134
- verbose true if !boolean_option('REALLY_QUIET')
135
- if boolean_option('STDERR_TO_STDOUT')
136
- # Just redirecting the file descriptor isn't enough because
137
- # data written to STDERR might arrive in an unexpected order
138
- # compared to STDOUT.
139
- STDERR.reopen(STDOUT)
140
- Object.send(:remove_const, :STDERR)
141
- STDERR = STDOUT
142
- $stderr = $stdout
143
- end
144
-
145
- if boolean_option('CACHING', true) && !boolean_option('RELEASE')
146
- if OUTPUT_DIR.empty?
147
- PlatformInfo.cache_dir = File.expand_path("cache", File.dirname(__FILE__))
148
- else
149
- PlatformInfo.cache_dir = OUTPUT_DIR + "cache"
150
- end
151
- end