passenger 5.3.5 → 5.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (211) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG +13 -0
  3. data/README.md +2 -1
  4. data/Rakefile +0 -5
  5. data/build/agent.rb +2 -1
  6. data/build/cxx_tests.rb +18 -20
  7. data/build/integration_tests.rb +6 -2
  8. data/build/support/cxx_dependency_map.rb +2019 -1966
  9. data/dev/colorize-logs +272 -0
  10. data/src/agent/Core/AdminPanelConnector.h +3 -3
  11. data/src/agent/Core/ApiServer.h +4 -4
  12. data/src/agent/Core/ApplicationPool/BasicProcessInfo.h +2 -2
  13. data/src/agent/Core/ApplicationPool/Group/OutOfBandWork.cpp +2 -2
  14. data/src/agent/Core/ApplicationPool/Implementation.cpp +5 -5
  15. data/src/agent/Core/ApplicationPool/Pool.h +4 -4
  16. data/src/agent/Core/ApplicationPool/Process.h +10 -15
  17. data/src/agent/Core/ApplicationPool/Socket.h +2 -2
  18. data/src/agent/Core/ApplicationPool/TestSession.h +3 -3
  19. data/src/agent/Core/Config.h +4 -2
  20. data/src/agent/Core/Controller.h +4 -4
  21. data/src/agent/Core/Controller/Config.h +1 -1
  22. data/src/agent/Core/Controller/SendRequest.cpp +2 -2
  23. data/src/agent/Core/Controller/TurboCaching.h +2 -2
  24. data/src/agent/Core/CoreMain.cpp +2 -2
  25. data/src/agent/Core/OptionParser.h +2 -2
  26. data/src/agent/Core/ResponseCache.h +3 -3
  27. data/src/agent/Core/SecurityUpdateChecker.h +2 -2
  28. data/src/agent/Core/SpawningKit/Config.h +2 -1
  29. data/src/agent/Core/SpawningKit/Config/AutoGeneratedCode.h +1 -1
  30. data/src/agent/Core/SpawningKit/Context.h +1 -1
  31. data/src/agent/Core/SpawningKit/DirectSpawner.h +3 -3
  32. data/src/agent/Core/SpawningKit/DummySpawner.h +3 -3
  33. data/src/agent/Core/SpawningKit/ErrorRenderer.h +1 -1
  34. data/src/agent/Core/SpawningKit/Exceptions.h +2 -2
  35. data/src/agent/Core/SpawningKit/Factory.h +1 -1
  36. data/src/agent/Core/SpawningKit/Handshake/BackgroundIOCapturer.h +1 -1
  37. data/src/agent/Core/SpawningKit/Handshake/Perform.h +13 -2
  38. data/src/agent/Core/SpawningKit/Handshake/Prepare.h +3 -3
  39. data/src/agent/Core/SpawningKit/Handshake/WorkDir.h +1 -1
  40. data/src/agent/Core/SpawningKit/Journey.h +4 -5
  41. data/src/agent/Core/SpawningKit/PipeWatcher.h +1 -1
  42. data/src/agent/Core/SpawningKit/Result.h +20 -8
  43. data/src/agent/Core/SpawningKit/Result/AutoGeneratedCode.h +1 -1
  44. data/src/agent/Core/SpawningKit/SmartSpawner.h +6 -6
  45. data/src/agent/Core/SpawningKit/Spawner.h +2 -2
  46. data/src/agent/Core/TelemetryCollector.h +13 -7
  47. data/src/agent/ExecHelper/ExecHelperMain.cpp +1 -1
  48. data/src/agent/README.md +1 -1
  49. data/src/agent/Shared/ApiAccountUtils.h +1 -1
  50. data/src/agent/Shared/ApiServerUtils.h +3 -3
  51. data/src/agent/Shared/ApplicationPoolApiKey.h +2 -2
  52. data/src/agent/Shared/Fundamentals/Initialization.cpp +4 -4
  53. data/src/agent/SpawnEnvSetupper/SpawnEnvSetupperMain.cpp +1 -1
  54. data/src/agent/SystemMetrics/SystemMetricsMain.cpp +4 -3
  55. data/src/agent/Watchdog/ApiServer.h +3 -3
  56. data/src/agent/Watchdog/Config.h +3 -2
  57. data/src/agent/Watchdog/CoreWatcher.cpp +2 -2
  58. data/src/agent/Watchdog/WatchdogMain.cpp +93 -27
  59. data/src/apache2_module/Config.cpp +14 -14
  60. data/src/apache2_module/Config.h +8 -16
  61. data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp +505 -491
  62. data/src/apache2_module/ConfigGeneral/AutoGeneratedDefinitions.cpp.cxxcodebuilder +39 -17
  63. data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp +24 -1
  64. data/src/apache2_module/ConfigGeneral/AutoGeneratedSetterFuncs.cpp.cxxcodebuilder +31 -1
  65. data/src/{cxx_supportlib/Utils/MemoryBarrier.h → apache2_module/ConfigGeneral/Common.h} +17 -25
  66. data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp +12 -1
  67. data/src/apache2_module/DirConfig/AutoGeneratedCreateFunction.cpp.cxxcodebuilder +16 -1
  68. data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp +19 -5
  69. data/src/apache2_module/DirConfig/AutoGeneratedHeaderSerialization.cpp.cxxcodebuilder +26 -9
  70. data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp +6 -1
  71. data/src/apache2_module/DirConfig/AutoGeneratedManifestGeneration.cpp.cxxcodebuilder +10 -1
  72. data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp +7 -1
  73. data/src/apache2_module/DirConfig/AutoGeneratedMergeFunction.cpp.cxxcodebuilder +11 -1
  74. data/src/apache2_module/DirConfig/AutoGeneratedStruct.h +23 -1
  75. data/src/apache2_module/DirConfig/AutoGeneratedStruct.h.cxxcodebuilder +34 -1
  76. data/src/apache2_module/Hooks.cpp +3 -3
  77. data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h +24 -1
  78. data/src/apache2_module/ServerConfig/AutoGeneratedStruct.h.cxxcodebuilder +36 -1
  79. data/src/cxx_supportlib/{Utils → Algorithms}/Hasher.cpp +2 -2
  80. data/src/cxx_supportlib/{Utils → Algorithms}/Hasher.h +4 -4
  81. data/src/cxx_supportlib/AppTypeDetector/Detector.h +1 -1
  82. data/src/cxx_supportlib/ConfigKit/Schema.h +2 -2
  83. data/src/cxx_supportlib/ConfigKit/Store.h +1 -1
  84. data/src/cxx_supportlib/Constants.h +1 -1
  85. data/src/cxx_supportlib/{Utils → DataStructures}/HashMap.h +4 -4
  86. data/src/cxx_supportlib/DataStructures/HashedStaticString.h +5 -5
  87. data/src/cxx_supportlib/DataStructures/LString.h +3 -3
  88. data/src/cxx_supportlib/{Utils → DataStructures}/StringMap.h +36 -36
  89. data/src/cxx_supportlib/FileTools/FileManip.cpp +1 -1
  90. data/src/cxx_supportlib/FileTools/PathManip.cpp +2 -2
  91. data/src/cxx_supportlib/FileTools/PathSecurityCheck.cpp +1 -1
  92. data/src/cxx_supportlib/Hooks.h +2 -2
  93. data/src/cxx_supportlib/{Utils → IOTools}/BufferedIO.h +5 -5
  94. data/src/cxx_supportlib/{Utils → IOTools}/IOUtils.cpp +2 -2
  95. data/src/cxx_supportlib/{Utils → IOTools}/IOUtils.h +3 -3
  96. data/src/cxx_supportlib/{Utils → IOTools}/MessageIO.h +7 -7
  97. data/src/cxx_supportlib/{MessageReadersWriters.h → IOTools/MessageSerialization.h} +5 -5
  98. data/src/cxx_supportlib/InstanceDirectory.h +4 -4
  99. data/src/cxx_supportlib/Integrations/LibevJsonUtils.h +3 -3
  100. data/src/cxx_supportlib/{Utils → JsonTools}/JsonUtils.h +5 -5
  101. data/src/cxx_supportlib/LoggingKit/Context.h +2 -2
  102. data/src/cxx_supportlib/LoggingKit/Implementation.cpp +3 -3
  103. data/src/cxx_supportlib/MemoryKit/mbuf.cpp +2 -2
  104. data/src/cxx_supportlib/ProcessManagement/Spawn.cpp +5 -5
  105. data/src/cxx_supportlib/ProcessManagement/Utils.h +10 -0
  106. data/src/cxx_supportlib/RandomGenerator.h +2 -2
  107. data/src/cxx_supportlib/{Crypto.cpp → SecurityKit/Crypto.cpp} +4 -4
  108. data/src/cxx_supportlib/{Crypto.h → SecurityKit/Crypto.h} +4 -4
  109. data/src/cxx_supportlib/{Utils → SecurityKit}/MemZeroGuard.h +0 -0
  110. data/src/cxx_supportlib/ServerKit/AcceptLoadBalancer.h +2 -2
  111. data/src/cxx_supportlib/ServerKit/Channel.h +1 -1
  112. data/src/cxx_supportlib/ServerKit/Context.h +2 -2
  113. data/src/cxx_supportlib/ServerKit/FileBufferedChannel.h +1 -1
  114. data/src/cxx_supportlib/ServerKit/HttpHeaderParser.h +3 -3
  115. data/src/cxx_supportlib/ServerKit/HttpHeaderParserState.h +2 -2
  116. data/src/cxx_supportlib/ServerKit/HttpServer.h +16 -10
  117. data/src/cxx_supportlib/ServerKit/Server.h +3 -3
  118. data/src/cxx_supportlib/{Utils → StrIntTools}/DateParsing.h +5 -5
  119. data/src/cxx_supportlib/{Utils → StrIntTools}/StrIntUtils.cpp +3 -3
  120. data/src/cxx_supportlib/{Utils → StrIntTools}/StrIntUtils.h +0 -0
  121. data/src/cxx_supportlib/{Utils → StrIntTools}/StrIntUtilsNoStrictAliasing.cpp +2 -2
  122. data/src/cxx_supportlib/{Utils → StrIntTools}/StringScanning.h +5 -5
  123. data/src/cxx_supportlib/{Utils → StrIntTools}/Template.h +30 -5
  124. data/src/cxx_supportlib/SystemTools/ContainerHelpers.h +34 -0
  125. data/src/cxx_supportlib/{Utils → SystemTools}/ProcessMetricsCollector.h +6 -6
  126. data/src/cxx_supportlib/{Utils → SystemTools}/SystemMetricsCollector.h +3 -3
  127. data/src/cxx_supportlib/{Utils → SystemTools}/SystemTime.cpp +1 -1
  128. data/src/cxx_supportlib/{Utils → SystemTools}/SystemTime.h +0 -0
  129. data/src/cxx_supportlib/SystemTools/UserDatabase.h +1 -1
  130. data/src/cxx_supportlib/Utils.cpp +2 -2
  131. data/src/cxx_supportlib/Utils/CachedFileStat.hpp +3 -3
  132. data/src/cxx_supportlib/Utils/Curl.h +2 -2
  133. data/src/cxx_supportlib/Utils/FileChangeChecker.h +2 -2
  134. data/src/cxx_supportlib/Utils/MessagePassing.h +1 -1
  135. data/src/cxx_supportlib/Utils/SpeedMeter.h +2 -2
  136. data/src/cxx_supportlib/Utils/Timer.h +2 -2
  137. data/src/cxx_supportlib/Utils/VariantMap.h +3 -3
  138. data/src/cxx_supportlib/WatchdogLauncher.h +3 -3
  139. data/src/cxx_supportlib/WebSocketCommandReverseServer.h +1 -1
  140. data/src/cxx_supportlib/WrapperRegistry/Registry.h +1 -1
  141. data/src/cxx_supportlib/vendor-modified/psg_sysqueue.h +3 -0
  142. data/src/ruby_supportlib/phusion_passenger.rb +1 -1
  143. data/src/ruby_supportlib/phusion_passenger/common_library.rb +11 -11
  144. data/src/ruby_supportlib/phusion_passenger/config/agent_compiler.rb +4 -4
  145. data/src/ruby_supportlib/phusion_passenger/config/nginx_engine_compiler.rb +1 -1
  146. data/src/ruby_supportlib/phusion_passenger/message_channel.rb +2 -2
  147. data/src/ruby_supportlib/phusion_passenger/packaging.rb +20 -19
  148. data/src/ruby_supportlib/phusion_passenger/platform_info/apache.rb +22 -4
  149. data/src/ruby_supportlib/phusion_passenger/platform_info/ruby.rb +33 -13
  150. data/src/schema_printer/SchemaPrinterMain.cpp +2 -0
  151. metadata +28 -86
  152. data/.editorconfig +0 -134
  153. data/CODE_OF_CONDUCT.md +0 -52
  154. data/dev/boost-patches/0001-Patch-boost-thread-so-that-oxt-thread-can-use-it.patch +0 -48
  155. data/dev/boost-patches/0002-Make-boost-thread_interrupted-derive-from-oxt-tracab.patch +0 -33
  156. data/dev/boost-patches/0003-Disable-a-Clang-pragma-to-prevent-warnings-on-OS-X.patch +0 -25
  157. data/dev/ci/README.md +0 -134
  158. data/dev/ci/lib/functions.sh +0 -129
  159. data/dev/ci/lib/set-container-envvars.sh +0 -53
  160. data/dev/ci/lib/setup-container.sh +0 -46
  161. data/dev/ci/run-tests-natively +0 -24
  162. data/dev/ci/run-tests-with-docker +0 -42
  163. data/dev/ci/scripts/debug-console-wrapper.sh +0 -29
  164. data/dev/ci/scripts/docker-entrypoint-stage2.sh +0 -17
  165. data/dev/ci/scripts/docker-entrypoint.sh +0 -17
  166. data/dev/ci/scripts/inituidgid +0 -17
  167. data/dev/ci/scripts/run-tests-natively-stage2.sh +0 -17
  168. data/dev/ci/scripts/setup-host-natively.sh +0 -11
  169. data/dev/ci/setup-host +0 -56
  170. data/dev/ci/tests/apache2/run +0 -6
  171. data/dev/ci/tests/apache2/setup +0 -4
  172. data/dev/ci/tests/binaries/Jenkinsfile +0 -105
  173. data/dev/ci/tests/binaries/build-linux +0 -38
  174. data/dev/ci/tests/binaries/build-macos +0 -40
  175. data/dev/ci/tests/binaries/prepare-macos +0 -38
  176. data/dev/ci/tests/binaries/test-linux +0 -45
  177. data/dev/ci/tests/binaries/test-macos +0 -38
  178. data/dev/ci/tests/cxx/run +0 -9
  179. data/dev/ci/tests/cxx/setup +0 -4
  180. data/dev/ci/tests/debian/Jenkinsfile +0 -89
  181. data/dev/ci/tests/debian/run +0 -60
  182. data/dev/ci/tests/nginx-dynamic/run +0 -20
  183. data/dev/ci/tests/nginx-dynamic/setup +0 -4
  184. data/dev/ci/tests/nginx/run +0 -5
  185. data/dev/ci/tests/nginx/setup +0 -4
  186. data/dev/ci/tests/nodejs/run +0 -4
  187. data/dev/ci/tests/nodejs/setup +0 -4
  188. data/dev/ci/tests/rpm/Jenkinsfile +0 -68
  189. data/dev/ci/tests/rpm/run +0 -63
  190. data/dev/ci/tests/ruby/run +0 -4
  191. data/dev/ci/tests/ruby/setup +0 -4
  192. data/dev/ci/tests/source-packaging/run +0 -4
  193. data/dev/ci/tests/source-packaging/setup +0 -4
  194. data/dev/ci/tests/standalone/run +0 -4
  195. data/dev/ci/tests/standalone/setup +0 -4
  196. data/dev/configkit-schemas/index.json +0 -1850
  197. data/dev/configkit-schemas/update_schema_inline_comments.rb +0 -118
  198. data/dev/rack.test/config.ru +0 -5
  199. data/dev/rack.test/public/asset.txt +0 -1
  200. data/dev/vagrant/apache_default_site.conf +0 -35
  201. data/dev/vagrant/apache_passenger.conf +0 -5
  202. data/dev/vagrant/apache_passenger.load +0 -1
  203. data/dev/vagrant/apache_ports.conf +0 -24
  204. data/dev/vagrant/apache_rack_test.conf +0 -9
  205. data/dev/vagrant/bashrc +0 -23
  206. data/dev/vagrant/nginx.conf +0 -39
  207. data/dev/vagrant/nginx_rakefile +0 -33
  208. data/dev/vagrant/nginx_start +0 -32
  209. data/dev/vagrant/provision.sh +0 -117
  210. data/dev/vagrant/sudoers.conf +0 -5
  211. data/resources/templates/error_renderer/.editorconfig +0 -19
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2013-2017 Phusion Holding B.V.
3
+ * Copyright (c) 2013-2018 Phusion Holding B.V.
4
4
  *
5
5
  * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
6
  * trademarks of Phusion Holding B.V.
@@ -61,7 +61,7 @@
61
61
  #include <Exceptions.h>
62
62
  #include <FileTools/FileManip.h>
63
63
  #include <Utils.h>
64
- #include <Utils/StrIntUtils.h>
64
+ #include <StrIntTools/StrIntUtils.h>
65
65
 
66
66
  namespace Passenger {
67
67
 
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2010-2017 Phusion Holding B.V.
3
+ * Copyright (c) 2010-2018 Phusion Holding B.V.
4
4
  *
5
5
  * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
6
  * trademarks of Phusion Holding B.V.
@@ -30,7 +30,7 @@
30
30
  #include <cerrno>
31
31
 
32
32
  #include <Utils/CachedFileStat.hpp>
33
- #include <Utils/SystemTime.h>
33
+ #include <SystemTools/SystemTime.h>
34
34
 
35
35
  namespace Passenger {
36
36
 
@@ -36,7 +36,7 @@
36
36
  #include <oxt/macros.hpp>
37
37
  #include <jsoncpp/json.h>
38
38
  #include <Exceptions.h>
39
- #include <Utils/SystemTime.h>
39
+ #include <SystemTools/SystemTime.h>
40
40
 
41
41
  #include <list>
42
42
 
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2014-2017 Phusion Holding B.V.
3
+ * Copyright (c) 2014-2018 Phusion Holding B.V.
4
4
  *
5
5
  * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
6
  * trademarks of Phusion Holding B.V.
@@ -30,7 +30,7 @@
30
30
  #include <cstdlib>
31
31
  #include <cassert>
32
32
  #include <limits>
33
- #include <Utils/SystemTime.h>
33
+ #include <SystemTools/SystemTime.h>
34
34
 
35
35
  namespace Passenger {
36
36
 
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2010-2017 Phusion Holding B.V.
3
+ * Copyright (c) 2010-2018 Phusion Holding B.V.
4
4
  *
5
5
  * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
6
  * trademarks of Phusion Holding B.V.
@@ -28,7 +28,7 @@
28
28
 
29
29
  #include <boost/thread.hpp>
30
30
  #include <oxt/system_calls.hpp>
31
- #include <Utils/SystemTime.h>
31
+ #include <SystemTools/SystemTime.h>
32
32
 
33
33
  namespace Passenger {
34
34
 
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * Phusion Passenger - https://www.phusionpassenger.com/
3
- * Copyright (c) 2010-2017 Phusion Holding B.V.
3
+ * Copyright (c) 2010-2018 Phusion Holding B.V.
4
4
  *
5
5
  * "Passenger", "Phusion Passenger" and "Union Station" are registered
6
6
  * trademarks of Phusion Holding B.V.
@@ -36,8 +36,8 @@
36
36
  #include <jsoncpp/json.h>
37
37
  #include <modp_b64.h>
38
38
  #include <Exceptions.h>
39
- #include <Utils/StrIntUtils.h>
40
- #include <Utils/MessageIO.h>
39
+ #include <StrIntTools/StrIntUtils.h>
40
+ #include <IOTools/MessageIO.h>
41
41
 
42
42
  namespace Passenger {
43
43
 
@@ -86,8 +86,8 @@ void psg_watchdog_launcher_free(PsgWatchdogLauncher *launcher);
86
86
  #include <LoggingKit/Context.h>
87
87
  #include <ProcessManagement/Utils.h>
88
88
  #include <Utils.h>
89
- #include <Utils/IOUtils.h>
90
- #include <Utils/MessageIO.h>
89
+ #include <IOTools/IOUtils.h>
90
+ #include <IOTools/MessageIO.h>
91
91
  #include <Utils/Timer.h>
92
92
  #include <Utils/ScopeGuard.h>
93
93
  #include <Utils/ClassUtils.h>
@@ -370,7 +370,7 @@ public:
370
370
  afterFork();
371
371
  }
372
372
 
373
- closeAllFileDescriptors(FEEDBACK_FD, true);
373
+ closeAllFileDescriptors(FEEDBACK_FD);
374
374
 
375
375
  execl(agentFilename.c_str(), AGENT_EXE, "watchdog",
376
376
  // Some extra space to allow the child process to change its process title.
@@ -49,7 +49,7 @@
49
49
  #include <FileTools/PathManip.h>
50
50
  #include <FileTools/FileManip.h>
51
51
  #include <Utils.h>
52
- #include <Utils/StrIntUtils.h>
52
+ #include <StrIntTools/StrIntUtils.h>
53
53
 
54
54
  namespace Passenger {
55
55
 
@@ -37,7 +37,7 @@
37
37
  #include <DataStructures/StringKeyTable.h>
38
38
  #include <Constants.h>
39
39
  #include <Utils.h>
40
- #include <Utils/StrIntUtils.h>
40
+ #include <StrIntTools/StrIntUtils.h>
41
41
 
42
42
  namespace Passenger {
43
43
  namespace WrapperRegistry {
@@ -129,6 +129,9 @@
129
129
  #undef LIST_ENTRY
130
130
  #undef LIST_REMOVE
131
131
  #undef LIST_SWAP
132
+ #undef LIST_INSERT_BEFORE
133
+ #undef LIST_INSERT_AFTER
134
+ #undef LIST_INSERT_HEAD
132
135
  #undef TAILQ_HEAD
133
136
  #undef TAILQ_ENTRY
134
137
  #undef TAILQ_INSERT_AFTER
@@ -31,7 +31,7 @@ module PhusionPassenger
31
31
 
32
32
  PACKAGE_NAME = 'passenger'
33
33
  # Run 'rake src/cxx_supportlib/Constants.h configkit_schemas_inline_comments' after changing this number.
34
- VERSION_STRING = '5.3.5'
34
+ VERSION_STRING = '5.3.6'
35
35
 
36
36
  PREFERRED_NGINX_VERSION = '1.14.0'
37
37
  NGINX_SHA256_CHECKSUM = '5d15becbf69aba1fe33f8d416d97edd95ea8919ea9ac519eff9bafebb6022cb5'
@@ -293,24 +293,24 @@ COMMON_LIBRARY = CommonLibraryBuilder.new do
293
293
  :source => 'SystemTools/UserDatabase.cpp',
294
294
  :category => :base
295
295
  define_component 'Utils/SystemTime.o',
296
- :source => 'Utils/SystemTime.cpp',
296
+ :source => 'SystemTools/SystemTime.cpp',
297
297
  :category => :base
298
- define_component 'Utils/StrIntUtils.o',
299
- :source => 'Utils/StrIntUtils.cpp',
298
+ define_component 'StrIntTools/StrIntUtils.o',
299
+ :source => 'StrIntTools/StrIntUtils.cpp',
300
300
  :category => :base,
301
301
  :optimize => :very_heavy
302
- define_component 'Utils/StrIntUtilsNoStrictAliasing.o',
303
- :source => 'Utils/StrIntUtilsNoStrictAliasing.cpp',
302
+ define_component 'StrIntTools/StrIntUtilsNoStrictAliasing.o',
303
+ :source => 'StrIntTools/StrIntUtilsNoStrictAliasing.cpp',
304
304
  :category => :base,
305
305
  # Compiling with -O3 causes segfaults on RHEL 6
306
306
  :optimize => :heavy,
307
307
  :strict_aliasing => false
308
- define_component 'Utils/IOUtils.o',
309
- :source => 'Utils/IOUtils.cpp',
308
+ define_component 'IOTools/IOUtils.o',
309
+ :source => 'IOTools/IOUtils.cpp',
310
310
  :optimize => :light,
311
311
  :category => :base
312
- define_component 'Utils/Hasher.o',
313
- :source => 'Utils/Hasher.cpp',
312
+ define_component 'Algorithms/Hasher.o',
313
+ :source => 'Algorithms/Hasher.cpp',
314
314
  :category => :base,
315
315
  :optimize => :very_heavy
316
316
  define_component 'Utils.o',
@@ -321,8 +321,8 @@ COMMON_LIBRARY = CommonLibraryBuilder.new do
321
321
  :category => :base,
322
322
  :optimize => true
323
323
 
324
- define_component 'Crypto.o',
325
- :source => 'Crypto.cpp',
324
+ define_component 'SecurityKit/Crypto.o',
325
+ :source => 'SecurityKit/Crypto.cpp',
326
326
  :category => :other,
327
327
  :cflags => PhusionPassenger::PlatformInfo.crypto_extra_cflags
328
328
  define_component 'Utils/CachedFileStat.o',
@@ -1,7 +1,7 @@
1
1
  # encoding: utf-8
2
2
  #
3
3
  # Phusion Passenger - https://www.phusionpassenger.com/
4
- # Copyright (c) 2010-2017 Phusion Holding B.V.
4
+ # Copyright (c) 2010-2018 Phusion Holding B.V.
5
5
  #
6
6
  # "Passenger", "Phusion Passenger" and "Union Station" are registered
7
7
  # trademarks of Phusion Holding B.V.
@@ -133,9 +133,9 @@ module PhusionPassenger
133
133
  puts "<banner>Compiling #{PROGRAM_NAME} agent...</banner>"
134
134
  progress_bar = ProgressBar.new
135
135
  e_working_dir = Shellwords.escape(@working_dir)
136
- args = "#{e_working_dir}/support-binaries/#{AGENT_EXE}" +
137
- " CACHING=false" +
138
- " OUTPUT_DIR=#{e_working_dir} "
136
+ args = "#{e_working_dir}/support-binaries/#{AGENT_EXE}" \
137
+ " CACHING=false" \
138
+ " OUTPUT_DIR=#{e_working_dir} " \
139
139
  " OPTIMIZE=#{!!@optimize}"
140
140
  begin
141
141
  progress_bar.set(0)
@@ -251,7 +251,7 @@ module PhusionPassenger
251
251
  if @nginx_tarball
252
252
  new_screen
253
253
  puts "You specified --nginx-tarball, but the file could not be extracted. " +
254
- "Please check the path and format (tar.gz), and ensure Passenger can write to " +
254
+ "Please check the path and format (tar.gz), and ensure Passenger can write to " +
255
255
  PlatformInfo.tmpexedir + "."
256
256
  puts
257
257
  else
@@ -1,6 +1,6 @@
1
1
  # encoding: binary
2
2
  # Phusion Passenger - https://www.phusionpassenger.com/
3
- # Copyright (c) 2010-2017 Phusion Holding B.V.
3
+ # Copyright (c) 2010-2018 Phusion Holding B.V.
4
4
  #
5
5
  # "Passenger", "Phusion Passenger" and "Union Station" are registered
6
6
  # trademarks of Phusion Holding B.V.
@@ -26,7 +26,7 @@
26
26
  module PhusionPassenger
27
27
 
28
28
  # This class allows reading and writing structured messages over
29
- # I/O channels. This is the Ruby implementation of src/cxx_supportlib/Utils/MessageIO.h;
29
+ # I/O channels. This is the Ruby implementation of src/cxx_supportlib/IOTools/MessageIO.h;
30
30
  # see that file for more information.
31
31
  class MessageChannel
32
32
  HEADER_SIZE = 2 # :nodoc:
@@ -1,5 +1,5 @@
1
1
  # Phusion Passenger - https://www.phusionpassenger.com/
2
- # Copyright (c) 2010-2017 Phusion Holding B.V.
2
+ # Copyright (c) 2010-2018 Phusion Holding B.V.
3
3
  #
4
4
  # "Passenger", "Phusion Passenger" and "Union Station" are registered
5
5
  # trademarks of Phusion Holding B.V.
@@ -56,11 +56,9 @@ module PhusionPassenger
56
56
  # A list of globs which match all files that should be packaged
57
57
  # in the Phusion Passenger gem or tarball.
58
58
  GLOB = [
59
- '.editorconfig',
60
59
  'configure',
61
60
  'Rakefile',
62
61
  'README.md',
63
- 'CODE_OF_CONDUCT.md',
64
62
  'CONTRIBUTORS',
65
63
  'CONTRIBUTING.md',
66
64
  'LICENSE',
@@ -74,46 +72,49 @@ module PhusionPassenger
74
72
  'doc/**/*',
75
73
  'images/*',
76
74
  'man/*',
77
- 'dev/**/*',
75
+ # Only inlcude the top-level scripts, required by e.g. the Homebrew packaging.
76
+ 'dev/*',
78
77
  'src/**/*',
79
78
  'resources/**/*',
80
79
  'resources/templates/error_renderer/.editorconfig'
81
80
  ]
82
81
 
83
82
  # Files that should be excluded from the gem or tarball. Overrides GLOB.
83
+ #
84
+ # This is not merely an exclusion list on top of GLOB! All files that you
85
+ # do not want to include in the package must be explicitly specified here!
86
+ # Otherwise source_packaging_test.rb will complain.
84
87
  EXCLUDE_GLOB = [
85
88
  '**/.DS_Store',
86
- '.gitignore',
89
+ '**/*.gch',
90
+ '**/.editorconfig',
91
+ '.externalToolBuilders/**/*',
92
+ '.github/**/*',
93
+ '.settings/**/*',
94
+ '.vscode/**/*',
95
+ '.cproject',
87
96
  '.gitattributes',
97
+ '.gitignore',
88
98
  '.gitmodules',
89
- '.github/*',
90
- '.settings/*',
91
- '.externalToolBuilders/*',
92
- '.vscode/*',
93
- '.cproject',
94
99
  '.project',
100
+ 'CODE_OF_CONDUCT.md',
95
101
  'Gemfile',
96
102
  'Gemfile.lock',
97
- 'yarn.lock',
98
- 'Vagrantfile',
99
103
  'Jenkinsfile',
100
104
  'Passenger.sublime-project',
101
- 'Passenger.xcodeproj/**/*',
105
+ 'Vagrantfile',
106
+ 'yarn.lock',
102
107
  'build/support/vendor/*/.*',
103
108
  'build/support/vendor/*/spec/**/*',
109
+ 'dev/*/**/*',
110
+ 'packaging/**/*',
104
111
  'src/ruby_supportlib/phusion_passenger/vendor/*/.*',
105
112
  'src/ruby_supportlib/phusion_passenger/vendor/*/hacking/**/*',
106
113
  'src/ruby_supportlib/phusion_passenger/vendor/*/spec/**/*',
107
114
  'src/cxx_supportlib/vendor-copy/*/.*',
108
- 'packaging/**/*',
109
115
  'test/**/*'
110
116
  ]
111
117
 
112
- # Files and directories that should be excluded from the Homebrew installation.
113
- HOMEBREW_EXCLUDE = [
114
- "package.json", "npm-shrinkwrap.json"
115
- ]
116
-
117
118
  def self.files
118
119
  result = Dir[*GLOB] - Dir[*EXCLUDE_GLOB]
119
120
  result.reject! { |path| path =~ %r{/\.\.?$} }
@@ -577,6 +577,23 @@ module PhusionPassenger
577
577
  end
578
578
  memoize :apache2_sbindir
579
579
 
580
+ def self.apache2_modulesdir(options = {})
581
+ apxs2 = options.fetch(:apxs2, self.apxs2)
582
+ if apxs2.nil?
583
+ # macOS >= 10.13 High Sierra no longer ships apxs2, so we'll use
584
+ # a hardcoded default.
585
+ if os_name_simple == 'macosx' && os_version >= '10.13' \
586
+ && httpd(:apxs2 => apxs2) == '/usr/sbin/httpd'
587
+ '/usr/libexec/apache2'
588
+ else
589
+ nil
590
+ end
591
+ else
592
+ `#{apxs2} -q LIBEXECDIR`.strip
593
+ end
594
+ end
595
+ memoize :apache2_modulesdir
596
+
580
597
 
581
598
  ################ Compiler and linker flags ################
582
599
 
@@ -824,8 +841,8 @@ module PhusionPassenger
824
841
  # /Library/Developer/CommandLineTools.
825
842
  xcode_prefix = `/usr/bin/xcode-select -p`.strip
826
843
  ["-I#{xcode_prefix}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/apr-1 " \
827
- "-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/apache2",
828
- '-lapr-1']
844
+ "-I#{xcode_prefix}/SDKs/MacOSX.sdk/usr/include/apr-1",
845
+ '-lapr-1']
829
846
  else
830
847
  ['-I/usr/include/apr-1', '-lapr-1']
831
848
  end
@@ -873,8 +890,9 @@ module PhusionPassenger
873
890
  # On macOS >= 10.13 High Sierra /usr/include no longer
874
891
  # exists.
875
892
  xcode_prefix = `/usr/bin/xcode-select -p`.strip
876
- ["-I#{xcode_prefix}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/apr-1",
877
- '-laprutil-1']
893
+ ["-I#{xcode_prefix}/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/apr-1" \
894
+ "-I#{xcode_prefix}/SDKs/MacOSX.sdk/usr/include/apr-1",
895
+ '-laprutil-1']
878
896
  else
879
897
  ['-I/usr/include/apr-1', '-laprutil-1']
880
898
  end
@@ -1,6 +1,6 @@
1
1
  # encoding: binary
2
2
  # Phusion Passenger - https://www.phusionpassenger.com/
3
- # Copyright (c) 2010-2017 Phusion Holding B.V.
3
+ # Copyright (c) 2010-2018 Phusion Holding B.V.
4
4
  #
5
5
  # "Passenger", "Phusion Passenger" and "Union Station" are registered
6
6
  # trademarks of Phusion Holding B.V.
@@ -48,6 +48,22 @@ module PhusionPassenger
48
48
  end
49
49
  GEM_PATH = gem_path
50
50
 
51
+ # 'bundle exec' modifies $GEM_HOME and $GEM_PATH so let's
52
+ # store the values that we had before Bundler's modifications.
53
+ gem_home = ENV['BUNDLER_ORIG_GEM_HOME']
54
+ if gem_home
55
+ gem_home = gem_home.strip.freeze
56
+ gem_home = nil if gem_home.empty?
57
+ end
58
+ BUNDLER_ORIG_GEM_HOME = gem_home
59
+
60
+ gem_path = ENV['BUNDLER_ORIG_GEM_PATH']
61
+ if gem_path
62
+ gem_path = gem_path.strip.freeze
63
+ gem_path = nil if gem_path.empty?
64
+ end
65
+ BUNDLER_ORIG_GEM_PATH = gem_path
66
+
51
67
  if defined?(::RUBY_ENGINE)
52
68
  RUBY_ENGINE = ::RUBY_ENGINE
53
69
  else
@@ -257,12 +273,6 @@ module PhusionPassenger
257
273
  # Returns nil otherwise.
258
274
  def self.rvm_ruby_string
259
275
  if in_rvm?
260
- # RVM used to export the necessary information through
261
- # environment variables, but doesn't always do that anymore
262
- # in the latest versions in order to fight env var pollution.
263
- # Scanning $LOAD_PATH seems to be the only way to obtain
264
- # the information.
265
-
266
276
  # Getting the RVM name of the Ruby interpreter ("ruby-1.9.2")
267
277
  # isn't so hard, we can extract it from the #ruby_executable
268
278
  # string. Getting the gemset name is a bit harder, so let's
@@ -273,16 +283,26 @@ module PhusionPassenger
273
283
  # /Users/hongli/.rvm/gems/ruby-1.9.3-p392
274
284
  # But also:
275
285
  # /home/bitnami/.rvm/gems/ruby-1.9.3-p385-perf@njist325/ruby/1.9.1
276
- if GEM_HOME && GEM_HOME =~ %r{rvm/gems/(.+)}
277
- return $1.sub(/\/.*/, '')
286
+ #
287
+ # Caveat when we're executed through 'bundle exec':
288
+ # if `bundle install` was run with `--path=`, then `bundle exec`
289
+ # will modify $GEM_HOME to the --path directory. That's
290
+ # why we need to parse the version of $GEM_HOME *before*
291
+ # `bundle exec` had modified it.
292
+ [GEM_HOME, BUNDLER_ORIG_GEM_HOME].each do |gem_home|
293
+ if gem_home && gem_home =~ %r{rvm/gems/(.+)}
294
+ return $1.sub(/\/.*/, '')
295
+ end
278
296
  end
279
297
 
280
298
  # User might have explicitly set GEM_HOME to a custom directory,
281
299
  # or might have nuked $GEM_HOME. Extract info from $GEM_PATH.
282
- if GEM_PATH
283
- GEM_PATH.split(':').each do |gem_path|
284
- if gem_path =~ %r{rvm/gems/(.+)}
285
- return $1.sub(/\/.*/, '')
300
+ [GEM_PATH, BUNDLER_ORIG_GEM_PATH].each do |gem_path|
301
+ if gem_path
302
+ gem_path.split(':').each do |gem_path_part|
303
+ if gem_path_part =~ %r{rvm/gems/(.+)}
304
+ return $1.sub(/\/.*/, '')
305
+ end
286
306
  end
287
307
  end
288
308
  end