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.
- data/.travis.yml +3 -0
- data/NEWS +77 -7
- data/README.md +3 -11
- data/bin/passenger-install-apache2-module +24 -20
- data/bin/passenger-install-nginx-module +25 -23
- data/build/agents.rb +11 -0
- data/build/apache2.rb +9 -5
- data/build/basics.rb +37 -30
- data/build/common_library.rb +4 -1
- data/build/cplusplus_support.rb +5 -5
- data/build/cxx_tests.rb +28 -8
- data/build/integration_tests.rb +6 -3
- data/build/nginx.rb +3 -3
- data/build/packaging.rb +95 -57
- data/build/ruby_extension.rb +34 -21
- data/build/ruby_tests.rb +4 -2
- data/build/test_basics.rb +1 -1
- data/dev/run_travis.sh +36 -1
- data/doc/Users guide Apache.html +425 -308
- data/doc/Users guide Apache.idmap.txt +78 -70
- data/doc/Users guide Apache.index.sqlite3 +0 -0
- data/doc/Users guide Apache.txt +33 -92
- data/doc/Users guide Nginx.html +519 -220
- data/doc/Users guide Nginx.idmap.txt +78 -60
- data/doc/Users guide Nginx.txt +115 -26
- data/doc/Users guide Standalone.html +8 -2
- data/doc/users_guide_snippets/analysis_and_system_maintenance.txt +1 -7
- data/doc/users_guide_snippets/installation.txt +167 -22
- data/doc/users_guide_snippets/rackup_specifications.txt +4 -0
- data/doc/users_guide_snippets/since_version.txt +1 -0
- data/doc/users_guide_snippets/support_information.txt +3 -7
- data/doc/users_guide_snippets/tips.txt +0 -24
- data/ext/apache2/Configuration.cpp +11 -33
- data/ext/apache2/Configuration.hpp +3 -18
- data/ext/apache2/DirectoryMapper.h +20 -70
- data/ext/apache2/Hooks.cpp +2 -2
- data/ext/common/AgentsStarter.cpp +0 -2
- data/ext/common/AgentsStarter.h +0 -1
- data/ext/common/AgentsStarter.hpp +1 -3
- data/ext/common/ApplicationPool2/AppTypes.cpp +74 -0
- data/ext/common/ApplicationPool2/AppTypes.h +202 -0
- data/ext/common/ApplicationPool2/Common.h +12 -10
- data/ext/common/ApplicationPool2/DirectSpawner.h +256 -0
- data/ext/common/ApplicationPool2/DummySpawner.h +90 -0
- data/ext/common/ApplicationPool2/Group.h +311 -94
- data/ext/common/ApplicationPool2/Implementation.cpp +405 -145
- data/ext/common/ApplicationPool2/Options.h +24 -26
- data/ext/common/ApplicationPool2/PipeWatcher.h +20 -13
- data/ext/common/ApplicationPool2/Pool.h +326 -183
- data/ext/common/ApplicationPool2/Process.h +205 -55
- data/ext/common/ApplicationPool2/README.md +1 -1
- data/ext/common/ApplicationPool2/Session.h +21 -10
- data/ext/common/ApplicationPool2/SmartSpawner.h +801 -0
- data/ext/common/ApplicationPool2/Spawner.h +141 -1149
- data/ext/common/ApplicationPool2/SpawnerFactory.h +132 -0
- data/ext/common/ApplicationPool2/SuperGroup.h +146 -223
- data/ext/common/Constants.h +4 -2
- data/ext/common/Exceptions.h +23 -1
- data/ext/common/Logging.cpp +17 -6
- data/ext/common/Logging.h +37 -7
- data/ext/common/ResourceLocator.h +1 -1
- data/ext/common/Utils.cpp +49 -1
- data/ext/common/Utils.h +13 -4
- data/ext/common/{AnsiColorConstants.h → Utils/AnsiColorConstants.h} +0 -0
- data/ext/common/{BCrypt.cpp → Utils/BCrypt.cpp} +0 -0
- data/ext/common/{BCrypt.h → Utils/BCrypt.h} +0 -0
- data/ext/common/{Blowfish.c → Utils/Blowfish.c} +0 -0
- data/ext/common/{Blowfish.h → Utils/Blowfish.h} +0 -0
- data/ext/common/Utils/CachedFileStat.hpp +27 -25
- data/ext/common/Utils/Curl.h +184 -0
- data/ext/common/{HttpConstants.h → Utils/HttpConstants.h} +3 -0
- data/ext/common/Utils/IOUtils.cpp +6 -2
- data/ext/common/{IniFile.h → Utils/IniFile.h} +0 -0
- data/ext/common/Utils/LargeFiles.cpp +30 -0
- data/ext/common/Utils/LargeFiles.h +40 -0
- data/ext/common/Utils/StrIntUtils.cpp +72 -8
- data/ext/common/Utils/StrIntUtils.h +24 -2
- data/ext/common/Utils/StringMap.h +12 -2
- data/ext/common/Utils/VariantMap.h +51 -2
- data/ext/common/Utils/jsoncpp.cpp +1 -1
- data/ext/common/agents/Base.cpp +147 -11
- data/ext/common/agents/HelperAgent/AgentOptions.h +14 -6
- data/ext/common/agents/HelperAgent/Main.cpp +79 -19
- data/ext/common/agents/HelperAgent/RequestHandler.h +36 -16
- data/ext/common/agents/LoggingAgent/LoggingServer.h +3 -5
- data/ext/common/agents/LoggingAgent/Main.cpp +2 -4
- data/ext/common/agents/LoggingAgent/RemoteSender.h +18 -24
- data/ext/common/agents/SpawnPreparer.cpp +7 -0
- data/ext/common/agents/Watchdog/Main.cpp +96 -38
- data/ext/nginx/Configuration.c +26 -22
- data/ext/nginx/Configuration.h +4 -2
- data/ext/nginx/ContentHandler.c +23 -52
- data/ext/nginx/ContentHandler.h +5 -11
- data/ext/nginx/config +10 -3
- data/ext/nginx/ngx_http_passenger_module.c +21 -6
- data/ext/nginx/ngx_http_passenger_module.h +4 -1
- data/ext/oxt/dynamic_thread_group.hpp +9 -1
- data/ext/oxt/system_calls.cpp +2 -2
- data/ext/ruby/extconf.rb +2 -1
- data/helper-scripts/backtrace-sanitizer.rb +2 -0
- data/helper-scripts/wsgi-loader.py +54 -21
- data/lib/phusion_passenger.rb +5 -3
- data/lib/phusion_passenger/abstract_installer.rb +18 -41
- data/lib/phusion_passenger/admin_tools/memory_stats.rb +2 -2
- data/lib/phusion_passenger/admin_tools/server_instance.rb +2 -2
- data/lib/phusion_passenger/common_library.rb +23 -3
- data/lib/phusion_passenger/debug_logging.rb +10 -3
- data/lib/phusion_passenger/packaging.rb +1 -0
- data/lib/phusion_passenger/platform_info.rb +113 -115
- data/lib/phusion_passenger/platform_info/compiler.rb +224 -134
- data/lib/phusion_passenger/platform_info/cxx_portability.rb +143 -0
- data/lib/phusion_passenger/platform_info/depcheck.rb +371 -0
- data/lib/phusion_passenger/platform_info/depcheck_specs/apache2.rb +124 -0
- data/lib/phusion_passenger/platform_info/depcheck_specs/compiler_toolchain.rb +97 -0
- data/lib/phusion_passenger/platform_info/depcheck_specs/gems.rb +39 -0
- data/lib/phusion_passenger/platform_info/depcheck_specs/libs.rb +118 -0
- data/lib/phusion_passenger/platform_info/depcheck_specs/ruby.rb +137 -0
- data/lib/phusion_passenger/platform_info/depcheck_specs/utilities.rb +15 -0
- data/lib/phusion_passenger/platform_info/operating_system.rb +6 -5
- data/lib/phusion_passenger/platform_info/ruby.rb +45 -34
- data/lib/phusion_passenger/request_handler.rb +35 -22
- data/lib/phusion_passenger/request_handler/thread_handler.rb +5 -6
- data/lib/phusion_passenger/ruby_core_enhancements.rb +7 -1
- data/lib/phusion_passenger/standalone/runtime_installer.rb +43 -34
- data/lib/phusion_passenger/utils/robust_interruption.rb +34 -18
- data/passenger.gemspec +25 -0
- data/resources/templates/standalone/config.erb +3 -1
- data/test/config.json.travis +2 -2
- data/test/cxx/ApplicationPool2/DirectSpawnerTest.cpp +37 -5
- data/test/cxx/ApplicationPool2/PoolTest.cpp +143 -50
- data/test/cxx/ApplicationPool2/ProcessTest.cpp +8 -0
- data/test/cxx/ApplicationPool2/SmartSpawnerTest.cpp +28 -17
- data/test/cxx/ApplicationPool2/SpawnerTestCases.cpp +31 -26
- data/test/cxx/RequestHandlerTest.cpp +17 -1
- data/test/cxx/UtilsTest.cpp +84 -10
- data/test/integration_tests/apache2_tests.rb +49 -163
- data/test/integration_tests/hello_world_wsgi_spec.rb +2 -2
- data/test/integration_tests/mycook_spec.rb +1 -1
- data/test/integration_tests/nginx_tests.rb +37 -19
- data/test/ruby/request_handler_spec.rb +1 -0
- data/test/ruby/spec_helper.rb +52 -1
- data/test/stub/nginx/nginx.conf.erb +2 -0
- data/test/stub/rack/start.rb +5 -0
- data/test/stub/rails3.0/Gemfile.lock +30 -30
- data/test/stub/rails3.1/Gemfile +1 -1
- data/test/stub/rails3.1/Gemfile.lock +3 -3
- data/test/stub/rails3.2/Gemfile +1 -1
- data/test/stub/rails3.2/Gemfile.lock +4 -4
- data/test/stub/rails_apps/2.3/mycook/app/controllers/welcome_controller.rb +1 -1
- data/test/stub/rails_apps/2.3/mycook/app/helpers/recipes_helper.rb +2 -0
- data/test/stub/rails_apps/2.3/mycook/app/helpers/test_helper.rb +2 -0
- data/test/stub/rails_apps/2.3/mycook/app/helpers/uploads_helper.rb +2 -0
- data/test/stub/rails_apps/2.3/mycook/app/helpers/welcome_helper.rb +2 -0
- data/test/support/nginx_controller.rb +2 -1
- metadata +160 -156
- data/build/gempackagetask.rb +0 -99
- data/build/packagetask.rb +0 -186
- data/ext/common/StringListCreator.h +0 -83
- data/lib/phusion_passenger/dependencies.rb +0 -657
data/build/common_library.rb
CHANGED
@@ -21,6 +21,8 @@
|
|
21
21
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
22
|
# THE SOFTWARE.
|
23
23
|
|
24
|
+
require 'phusion_passenger/platform_info/cxx_portability'
|
25
|
+
|
24
26
|
########## Phusion Passenger common library ##########
|
25
27
|
|
26
28
|
require 'phusion_passenger/common_library'
|
@@ -198,5 +200,6 @@ end
|
|
198
200
|
|
199
201
|
libboost_oxt_cflags = ""
|
200
202
|
libboost_oxt_cflags << " -faddress-sanitizer" if USE_ASAN
|
203
|
+
libboost_oxt_cflags.strip!
|
201
204
|
LIBBOOST_OXT = define_libboost_oxt_task("common", COMMON_OUTPUT_DIR + "libboost_oxt", libboost_oxt_cflags)
|
202
|
-
COMMON_LIBRARY.define_tasks
|
205
|
+
COMMON_LIBRARY.define_tasks(libboost_oxt_cflags)
|
data/build/cplusplus_support.rb
CHANGED
@@ -23,11 +23,11 @@
|
|
23
23
|
|
24
24
|
# Rake functions for compiling/linking C++ stuff.
|
25
25
|
|
26
|
-
def compile_c(source, flags = "#{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS}")
|
26
|
+
def compile_c(source, flags = "#{EXTRA_PRE_CFLAGS} #{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS}")
|
27
27
|
sh "#{CC} #{flags} -c #{source}"
|
28
28
|
end
|
29
29
|
|
30
|
-
def compile_cxx(source, flags = "#{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS}")
|
30
|
+
def compile_cxx(source, flags = "#{EXTRA_PRE_CXXFLAGS} #{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS}")
|
31
31
|
sh "#{CXX} #{flags} -c #{source}"
|
32
32
|
end
|
33
33
|
|
@@ -43,15 +43,15 @@ def create_static_library(target, sources)
|
|
43
43
|
sh "ranlib #{target}"
|
44
44
|
end
|
45
45
|
|
46
|
-
def create_executable(target, sources, linkflags = "#{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS} #{PlatformInfo.portability_ldflags} #{EXTRA_LDFLAGS}")
|
46
|
+
def create_executable(target, sources, linkflags = "#{EXTRA_PRE_CXXFLAGS} #{EXTRA_PRE_LDFLAGS} #{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS} #{PlatformInfo.portability_ldflags} #{EXTRA_LDFLAGS}")
|
47
47
|
sh "#{CXX} #{sources} -o #{target} #{linkflags}"
|
48
48
|
end
|
49
49
|
|
50
|
-
def create_c_executable(target, sources, linkflags = "#{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS} #{PlatformInfo.portability_ldflags} #{EXTRA_LDFLAGS}")
|
50
|
+
def create_c_executable(target, sources, linkflags = "#{EXTRA_PRE_CFLAGS} #{EXTRA_PRE_LDFLAGS} #{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS} #{PlatformInfo.portability_ldflags} #{EXTRA_LDFLAGS}")
|
51
51
|
sh "#{CC} #{sources} -o #{target} #{linkflags}"
|
52
52
|
end
|
53
53
|
|
54
|
-
def create_shared_library(target, sources, flags = "#{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS} #{PlatformInfo.portability_ldflags} #{EXTRA_LDFLAGS}")
|
54
|
+
def create_shared_library(target, sources, flags = "#{EXTRA_PRE_CXXFLAGS} #{EXTRA_PRE_LDFLAGS} #{PlatformInfo.portability_cflags} #{EXTRA_CXXFLAGS} #{PlatformInfo.portability_ldflags} #{EXTRA_LDFLAGS}")
|
55
55
|
if RUBY_PLATFORM =~ /darwin/
|
56
56
|
shlib_flag = "-flat_namespace -bundle -undefined dynamic_lookup"
|
57
57
|
else
|
data/build/cxx_tests.rb
CHANGED
@@ -43,7 +43,9 @@ TEST_CXX_OBJECTS = {
|
|
43
43
|
test/cxx/TestSupport.cpp
|
44
44
|
test/cxx/TestSupport.h
|
45
45
|
ext/common/SafeLibev.h
|
46
|
-
ext/common/BackgroundEventLoop.cpp
|
46
|
+
ext/common/BackgroundEventLoop.cpp
|
47
|
+
ext/common/Exceptions.h
|
48
|
+
ext/common/Utils.h),
|
47
49
|
'test/cxx/ApplicationPool2/OptionsTest.o' => %w(
|
48
50
|
test/cxx/ApplicationPool2/OptionsTest.cpp
|
49
51
|
ext/common/ApplicationPool2/Options.h),
|
@@ -53,14 +55,16 @@ TEST_CXX_OBJECTS = {
|
|
53
55
|
ext/common/ApplicationPool2/Options.h
|
54
56
|
ext/common/ApplicationPool2/Process.h
|
55
57
|
ext/common/ApplicationPool2/Socket.h
|
56
|
-
ext/common/ApplicationPool2/Spawner.h
|
58
|
+
ext/common/ApplicationPool2/Spawner.h
|
59
|
+
ext/common/ApplicationPool2/DirectSpawner.h),
|
57
60
|
'test/cxx/ApplicationPool2/SmartSpawnerTest.o' => %w(
|
58
61
|
test/cxx/ApplicationPool2/SmartSpawnerTest.cpp
|
59
62
|
test/cxx/ApplicationPool2/SpawnerTestCases.cpp
|
60
63
|
ext/common/ApplicationPool2/Options.h
|
61
64
|
ext/common/ApplicationPool2/Process.h
|
62
65
|
ext/common/ApplicationPool2/Socket.h
|
63
|
-
ext/common/ApplicationPool2/Spawner.h
|
66
|
+
ext/common/ApplicationPool2/Spawner.h
|
67
|
+
ext/common/ApplicationPool2/SmartSpawner.h),
|
64
68
|
'test/cxx/ApplicationPool2/ProcessTest.o' => %w(
|
65
69
|
test/cxx/ApplicationPool2/ProcessTest.cpp
|
66
70
|
ext/common/ApplicationPool2/Process.h
|
@@ -71,7 +75,14 @@ TEST_CXX_OBJECTS = {
|
|
71
75
|
ext/common/ApplicationPool2/SuperGroup.h
|
72
76
|
ext/common/ApplicationPool2/Group.h
|
73
77
|
ext/common/ApplicationPool2/Pool.h
|
74
|
-
ext/common/ApplicationPool2/
|
78
|
+
ext/common/ApplicationPool2/Process.h
|
79
|
+
ext/common/ApplicationPool2/Socket.h
|
80
|
+
ext/common/ApplicationPool2/Options.h
|
81
|
+
ext/common/ApplicationPool2/Spawner.h
|
82
|
+
ext/common/ApplicationPool2/SpawnerFactory.h
|
83
|
+
ext/common/ApplicationPool2/SmartSpawner.h
|
84
|
+
ext/common/ApplicationPool2/DirectSpawner.h
|
85
|
+
ext/common/ApplicationPool2/DummySpawner.h),
|
75
86
|
'test/cxx/MessageReadersWritersTest.o' => %w(
|
76
87
|
test/cxx/MessageReadersWritersTest.cpp
|
77
88
|
ext/common/MessageReadersWriters.h
|
@@ -133,7 +144,12 @@ TEST_CXX_OBJECTS = {
|
|
133
144
|
ext/common/ApplicationPool2/SuperGroup.h
|
134
145
|
ext/common/ApplicationPool2/Group.h
|
135
146
|
ext/common/ApplicationPool2/Process.h
|
136
|
-
ext/common/ApplicationPool2/
|
147
|
+
ext/common/ApplicationPool2/Options.h
|
148
|
+
ext/common/ApplicationPool2/Spawner.h
|
149
|
+
ext/common/ApplicationPool2/SpawnerFactory.h
|
150
|
+
ext/common/ApplicationPool2/SmartSpawner.h
|
151
|
+
ext/common/ApplicationPool2/DirectSpawner.h
|
152
|
+
ext/common/ApplicationPool2/DummySpawner.h),
|
137
153
|
'test/cxx/FileBackedPipeTest.o' => %w(
|
138
154
|
test/cxx/FileBackedPipeTest.cpp
|
139
155
|
ext/common/agents/HelperAgent/FileBackedPipe.h),
|
@@ -171,7 +187,8 @@ TEST_CXX_OBJECTS = {
|
|
171
187
|
ext/common/Utils/VariantMap.h),
|
172
188
|
'test/cxx/StringMapTest.o' => %w(
|
173
189
|
test/cxx/StringMapTest.cpp
|
174
|
-
ext/common/Utils/StringMap.h
|
190
|
+
ext/common/Utils/StringMap.h
|
191
|
+
ext/common/Utils/HashMap.h),
|
175
192
|
'test/cxx/ProcessMetricsCollectorTest.o' => %w(
|
176
193
|
test/cxx/ProcessMetricsCollectorTest.cpp
|
177
194
|
ext/common/Utils/ProcessMetricsCollector.h),
|
@@ -189,10 +206,10 @@ TEST_CXX_OBJECTS = {
|
|
189
206
|
dependencies = [
|
190
207
|
'test/cxx/CxxTestMain',
|
191
208
|
'test/support/allocate_memory',
|
192
|
-
|
209
|
+
NATIVE_SUPPORT_TARGET,
|
193
210
|
AGENT_OUTPUT_DIR + 'SpawnPreparer',
|
194
211
|
AGENT_OUTPUT_DIR + 'EnvPrinter'
|
195
|
-
]
|
212
|
+
].compact
|
196
213
|
desc "Run unit tests for the Apache 2 and Nginx C++ components"
|
197
214
|
task 'test:cxx' => dependencies do
|
198
215
|
args = ENV['GROUPS'].to_s.split(",").map{ |name| "-g #{name}" }
|
@@ -202,6 +219,9 @@ task 'test:cxx' => dependencies do
|
|
202
219
|
elsif boolean_option('VALGRIND')
|
203
220
|
command = "valgrind --dsymutil=yes --db-attach=yes --child-silent-after-fork=yes #{command}"
|
204
221
|
end
|
222
|
+
if boolean_option('SUDO')
|
223
|
+
command = "sudo #{command}"
|
224
|
+
end
|
205
225
|
if boolean_option('REPEAT')
|
206
226
|
if boolean_option('GDB')
|
207
227
|
abort "You cannot set both REPEAT=1 and GDB=1."
|
data/build/integration_tests.rb
CHANGED
@@ -27,8 +27,9 @@ desc "Run all integration tests"
|
|
27
27
|
task 'test:integration' => ['test:integration:apache2', 'test:integration:nginx'] do
|
28
28
|
end
|
29
29
|
|
30
|
+
dependencies = [:apache2, NATIVE_SUPPORT_TARGET].compact
|
30
31
|
desc "Run Apache 2 integration tests"
|
31
|
-
task 'test:integration:apache2' =>
|
32
|
+
task 'test:integration:apache2' => dependencies do
|
32
33
|
if PlatformInfo.rspec.nil?
|
33
34
|
abort "RSpec is not installed for Ruby interpreter '#{PlatformInfo.ruby_command}'. Please install it."
|
34
35
|
else
|
@@ -38,8 +39,9 @@ task 'test:integration:apache2' => [:apache2, :native_support] do
|
|
38
39
|
end
|
39
40
|
end
|
40
41
|
|
42
|
+
dependencies = [:nginx, NATIVE_SUPPORT_TARGET].compact
|
41
43
|
desc "Run Nginx integration tests"
|
42
|
-
task 'test:integration:nginx' =>
|
44
|
+
task 'test:integration:nginx' => dependencies do
|
43
45
|
if PlatformInfo.rspec.nil?
|
44
46
|
abort "RSpec is not installed for Ruby interpreter '#{PlatformInfo.ruby_command}'. Please install it."
|
45
47
|
else
|
@@ -49,8 +51,9 @@ task 'test:integration:nginx' => :nginx do
|
|
49
51
|
end
|
50
52
|
end
|
51
53
|
|
54
|
+
dependencies = [:apache2, NATIVE_SUPPORT_TARGET].compact
|
52
55
|
desc "Run the 'restart' integration test infinitely, and abort if/when it fails"
|
53
|
-
task 'test:restart' =>
|
56
|
+
task 'test:restart' => dependencies do
|
54
57
|
Dir.chdir("test") do
|
55
58
|
color_code_start = "\e[33m\e[44m\e[1m"
|
56
59
|
color_code_end = "\e[0m"
|
data/build/nginx.rb
CHANGED
@@ -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
|
#
|
@@ -24,8 +24,8 @@
|
|
24
24
|
desc "Build Nginx support files"
|
25
25
|
task :nginx => [
|
26
26
|
:nginx_without_native_support,
|
27
|
-
|
28
|
-
]
|
27
|
+
NATIVE_SUPPORT_TARGET
|
28
|
+
].compact
|
29
29
|
|
30
30
|
task :nginx_without_native_support => [
|
31
31
|
AGENT_OUTPUT_DIR + 'PassengerHelperAgent',
|
data/build/packaging.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Phusion Passenger - https://www.phusionpassenger.com/
|
2
|
-
# Copyright (c) 2010
|
2
|
+
# Copyright (c) 2010-2013 Phusion
|
3
3
|
#
|
4
4
|
# "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
|
5
5
|
#
|
@@ -21,6 +21,11 @@
|
|
21
21
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
22
|
# THE SOFTWARE.
|
23
23
|
|
24
|
+
task :clobber => 'package:clean'
|
25
|
+
|
26
|
+
desc "Build the gem and tarball"
|
27
|
+
task 'package' => ['package:gem', 'package:tarball']
|
28
|
+
|
24
29
|
task 'package:check' do
|
25
30
|
require 'phusion_passenger'
|
26
31
|
|
@@ -30,68 +35,46 @@ task 'package:check' do
|
|
30
35
|
end
|
31
36
|
end
|
32
37
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
s.rubyforge_project = "passenger"
|
40
|
-
s.author = "Phusion - http://www.phusion.nl/"
|
41
|
-
s.email = "info@phusion.nl"
|
42
|
-
s.require_paths = ["lib"]
|
43
|
-
s.add_dependency 'rake', '>= 0.8.1'
|
44
|
-
s.add_dependency 'fastthread', '>= 1.0.1'
|
45
|
-
s.add_dependency 'daemon_controller', '>= 1.1.0'
|
46
|
-
s.add_dependency 'rack'
|
47
|
-
s.files = FileList[*Packaging::GLOB] - FileList[*Packaging::EXCLUDE_GLOB]
|
48
|
-
s.executables = Packaging::USER_EXECUTABLES + Packaging::SUPER_USER_EXECUTABLES
|
49
|
-
s.description = "Easy and robust Ruby web application deployment."
|
38
|
+
desc "Build the gem"
|
39
|
+
task 'package:gem' => [:doc, 'package:check'] do
|
40
|
+
require 'phusion_passenger'
|
41
|
+
sh "gem build #{PhusionPassenger::PACKAGE_NAME}.gemspec"
|
42
|
+
sh "mkdir -p pkg"
|
43
|
+
sh "mv #{PhusionPassenger::PACKAGE_NAME}-#{PhusionPassenger::VERSION_STRING}.gem pkg/"
|
50
44
|
end
|
51
45
|
|
52
|
-
|
53
|
-
|
54
|
-
|
46
|
+
desc "Build the tarball"
|
47
|
+
task 'package:tarball' => [:doc, 'package:check'] do
|
48
|
+
require 'phusion_passenger'
|
49
|
+
require 'fileutils'
|
55
50
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
#
|
72
|
-
# The reason why we don't just specify Packaging::ASCII_DOCS
|
73
|
-
# as a task dependency is because we only want to generate
|
74
|
-
# the HTML files if they don't already exist; we don't want
|
75
|
-
# to regenerate if they exist but their source .txt files
|
76
|
-
# are modified. When the user installs Phusion Passenger
|
77
|
-
# via a gem/tarball/package, all file timestamps are set
|
78
|
-
# to the current clock time, which could lead Rake into
|
79
|
-
# thinking that the source .txt files are modified. Since
|
80
|
-
# the user probably has no write permission to the original
|
81
|
-
# Phusion Passenger sources we want to avoid trying to
|
82
|
-
# regenerate the HTML files.
|
83
|
-
Packaging::ASCII_DOCS.each do |ascii_doc|
|
84
|
-
Rake::Task[ascii_doc].invoke if !File.exist?(ascii_doc)
|
51
|
+
basename = "#{PhusionPassenger::PACKAGE_NAME}-#{PhusionPassenger::VERSION_STRING}"
|
52
|
+
sh "rm -rf pkg/#{basename}"
|
53
|
+
sh "mkdir -p pkg/#{basename}"
|
54
|
+
files = Dir[*PhusionPassenger::Packaging::GLOB] -
|
55
|
+
Dir[*PhusionPassenger::Packaging::EXCLUDE_GLOB]
|
56
|
+
files.each_with_index do |filename, i|
|
57
|
+
dir = File.dirname(filename)
|
58
|
+
if !File.exist?("pkg/#{basename}/#{dir}")
|
59
|
+
FileUtils.mkdir_p("pkg/#{basename}/#{dir}")
|
60
|
+
end
|
61
|
+
if !File.directory?(filename)
|
62
|
+
FileUtils.install(filename, "pkg/#{basename}/#{filename}")
|
63
|
+
end
|
64
|
+
printf "\r[%5d/%5d] [%3.0f%%] Copying files...", i, files.size, i * 100.0 / files.size
|
65
|
+
STDOUT.flush
|
85
66
|
end
|
86
|
-
puts
|
67
|
+
puts
|
68
|
+
sh "cd pkg && tar -c #{basename} | gzip --best > #{basename}.tar.gz"
|
69
|
+
sh "rm -rf pkg/#{basename}"
|
87
70
|
end
|
88
71
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
72
|
+
desc "Remove gem and tarball"
|
73
|
+
task 'package:clean' do
|
74
|
+
require 'phusion_passenger'
|
75
|
+
sh "rm -f #{PhusionPassenger::PACKAGE_NAME}-#{PhusionPassenger::VERSION_STRING}.gem"
|
76
|
+
sh "rm -f #{PhusionPassenger::PACKAGE_NAME}-#{PhusionPassenger::VERSION_STRING}.tar.gz"
|
77
|
+
end
|
95
78
|
|
96
79
|
desc "Create a fakeroot, useful for building native packages"
|
97
80
|
task :fakeroot => [:apache2, :nginx] + Packaging::ASCII_DOCS do
|
@@ -175,3 +158,58 @@ task 'package:debian' => 'package:check' do
|
|
175
158
|
|
176
159
|
sh "debuild"
|
177
160
|
end
|
161
|
+
|
162
|
+
desc "Sign all packaged files"
|
163
|
+
task 'package:sign' => 'package:check' do
|
164
|
+
require 'phusion_passenger'
|
165
|
+
begin
|
166
|
+
require 'highline'
|
167
|
+
rescue LoadError
|
168
|
+
abort "Please run `gem install highline` first."
|
169
|
+
end
|
170
|
+
h = HighLine.new
|
171
|
+
password = h.ask("Password for software-signing@phusion.nl GPG key: ") { |q| q.echo = false }
|
172
|
+
begin
|
173
|
+
File.open(".gpg-password", "w", 0600) do |f|
|
174
|
+
f.write(password)
|
175
|
+
end
|
176
|
+
version = PhusionPassenger::VERSION_STRING
|
177
|
+
["passenger-#{version}.gem",
|
178
|
+
"passenger-#{version}.tar.gz",
|
179
|
+
"passenger-enterprise-server-#{version}.gem",
|
180
|
+
"passenger-enterprise-server-#{version}.tar.gz"].each do |name|
|
181
|
+
if File.exist?("pkg/#{name}")
|
182
|
+
sh "gpg --sign --detach-sign --passphrase-file .gpg-password --local-user software-signing@phusion.nl --armor pkg/#{name}"
|
183
|
+
end
|
184
|
+
end
|
185
|
+
ensure
|
186
|
+
File.unlink('.gpg-password') if File.exist?('.gpg-password')
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
desc "Upload packages and signatures"
|
191
|
+
task 'package:upload' => ['package', 'package:sign'] do
|
192
|
+
require 'phusion_passenger'
|
193
|
+
version = PhusionPassenger::VERSION_STRING
|
194
|
+
|
195
|
+
signatures = []
|
196
|
+
["passenger-#{version}.gem.asc",
|
197
|
+
"passenger-#{version}.tar.gz.asc",
|
198
|
+
"passenger-enterprise-server-#{version}.gem.asc",
|
199
|
+
"passenger-enterprise-server-#{version}.tar.gz.asc"].each do |name|
|
200
|
+
if File.exist?("pkg/#{name}")
|
201
|
+
signatures << "pkg/#{name}"
|
202
|
+
end
|
203
|
+
end
|
204
|
+
sh "scp #{signatures.join(' ')} app@shell.phusion.nl:/u/apps/signatures/phusion-passenger/"
|
205
|
+
|
206
|
+
if File.exist?("pkg/passenger-#{version}.gem")
|
207
|
+
#sh "gem push pkg/passenger-#{version}.gem"
|
208
|
+
end
|
209
|
+
|
210
|
+
if File.exist?("pkg/passenger-#{version}.tar.gz")
|
211
|
+
puts "--------------"
|
212
|
+
puts "All done. Please upload pkg/passenger-#{version}.tar.gz " +
|
213
|
+
"to RubyForge and update the version number in the Phusion Passenger website."
|
214
|
+
end
|
215
|
+
end
|
data/build/ruby_extension.rb
CHANGED
@@ -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
|
#
|
@@ -21,28 +21,41 @@
|
|
21
21
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
22
22
|
# THE SOFTWARE.
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
source_dir = "ext/ruby"
|
24
|
+
if RUBY_PLATFORM =~ /java/
|
25
|
+
NATIVE_SUPPORT_TARGET = nil
|
27
26
|
|
28
|
-
task :native_support
|
29
|
-
|
27
|
+
task :native_support do
|
28
|
+
# Do nothing.
|
29
|
+
end
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
31
|
+
task 'native_support:clean' do
|
32
|
+
# Do nothing.
|
33
|
+
end
|
34
|
+
else
|
35
|
+
output_dir = RUBY_EXTENSION_OUTPUT_DIR
|
36
|
+
output_name = "passenger_native_support.#{LIBEXT}"
|
37
|
+
source_dir = "ext/ruby"
|
38
|
+
NATIVE_SUPPORT_TARGET = "#{output_dir}/#{output_name}"
|
39
39
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
40
|
+
task :native_support => "#{output_dir}/#{output_name}"
|
41
|
+
task :clean => 'native_support:clean'
|
42
|
+
|
43
|
+
dependencies = [
|
44
|
+
"#{output_dir}/Makefile",
|
45
|
+
"#{source_dir}/passenger_native_support.c"
|
46
|
+
]
|
47
|
+
file("#{output_dir}/#{output_name}" => dependencies) do
|
48
|
+
sh "mkdir -p '#{output_dir}'" if !File.exist?(output_dir)
|
49
|
+
sh "cd '#{output_dir}' && make"
|
50
|
+
end
|
51
|
+
|
52
|
+
file "#{output_dir}/Makefile" => "#{source_dir}/extconf.rb" do
|
53
|
+
sh "mkdir -p '#{output_dir}'" if !File.exist?(output_dir)
|
54
|
+
extconf_rb = File.expand_path("#{source_dir}/extconf.rb")
|
55
|
+
sh "cd '#{output_dir}' && #{PlatformInfo.ruby_command} '#{extconf_rb}'"
|
56
|
+
end
|
45
57
|
|
46
|
-
task 'native_support:clean' do
|
47
|
-
|
58
|
+
task 'native_support:clean' do
|
59
|
+
sh "echo rm -rf #{output_dir}"
|
60
|
+
end
|
48
61
|
end
|
data/build/ruby_tests.rb
CHANGED
@@ -23,8 +23,9 @@
|
|
23
23
|
|
24
24
|
### Ruby components tests ###
|
25
25
|
|
26
|
+
dependencies = [NATIVE_SUPPORT_TARGET, AGENT_OUTPUT_DIR + 'PassengerLoggingAgent'].compact
|
26
27
|
desc "Run unit tests for the Ruby libraries"
|
27
|
-
task 'test:ruby' =>
|
28
|
+
task 'test:ruby' => dependencies do
|
28
29
|
if PlatformInfo.rspec.nil?
|
29
30
|
abort "RSpec is not installed for Ruby interpreter '#{PlatformInfo.ruby_command}'. Please install it."
|
30
31
|
else
|
@@ -34,8 +35,9 @@ task 'test:ruby' => [:native_support, AGENT_OUTPUT_DIR + 'PassengerLoggingAgent'
|
|
34
35
|
end
|
35
36
|
end
|
36
37
|
|
38
|
+
dependencies = [NATIVE_SUPPORT_TARGET].compact
|
37
39
|
desc "Run coverage tests for the Ruby libraries"
|
38
|
-
task 'test:rcov' =>
|
40
|
+
task 'test:rcov' => dependencies do
|
39
41
|
if PlatformInfo.rspec.nil?
|
40
42
|
abort "RSpec is not installed for Ruby interpreter '#{PlatformInfo.ruby_command}'. Please install it."
|
41
43
|
else
|