Skip to content
This repository
Newer
Older
100644 291 lines (235 sloc) 8.378 kb
90c05c1f » drbrain
2007-10-18 Update INSTALL to latest information.
1 # NOTE! When updating this file, also update INSTALL, if necessary.
a8bdc6b7 » evanphx
2008-01-22 Cleanup / reorganize Rakefile
2 # NOTE! Please keep your tasks grouped together.
90c05c1f » drbrain
2007-10-18 Update INSTALL to latest information.
3
1651179c » brixen
2012-07-25 Fixed Rake::DSL warnings.
4 include Rake::DSL if Rake.const_defined? :DSL
5
af5cae65 » brixen
2010-10-01 Refuse to configure, build if RUBYLIB is set.
6 if ENV["RUBYLIB"]
16d3c35a » brixen
2012-07-25 Allow RUBYLIB to be set, but issue a huge warning.
7 STDERR.puts <<-EOM
8 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
9 WARNING WARNING
10 WARNING You have the RUBYLIB environment variable set. This can WARNING
11 WARNING cause serious problems building Rubinius, including but WARNING
12 WARNING not limited to causing the build to fail or specs to fail WARNING
13 WARNING or your computer to randomly emit strange beeping sounds WARNING
14 WARNING or burst into flames. Not all these possible catastrophic WARNING
15 WARNING effects have been observed in the wild, but you have been WARNING
d113a681 » headius
2012-07-26 Fix misspelling.
16 WARNING warned. We recommend unsetting this environment variable WARNING
16d3c35a » brixen
2012-07-25 Allow RUBYLIB to be set, but issue a huge warning.
17 WARNING and running the build again. WARNING
18 WARNING WARNING
19 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
20 EOM
af5cae65 » brixen
2010-10-01 Refuse to configure, build if RUBYLIB is set.
21 end
22
c3a6df20 » Evan Phoenix
2010-11-02 Wipe out CDPATH when building. Fixes #555
23 # Wipe out CDPATH, it interferes with building in some cases,
e4c03c2a » czarneckid
2011-06-11 Change only the appropriate references to point from evanphx to rubin…
24 # see http://github.com/rubinius/rubinius/issues#issue/555
c3a6df20 » Evan Phoenix
2010-11-02 Wipe out CDPATH when building. Fixes #555
25 if ENV["CDPATH"]
26 ENV.delete("CDPATH")
27 end
28
10887844 » Jacqui Maher and Wilson Bilkovich
2009-01-22 Silence a rake warning
29 $trace ||= false
69a60630 » Tilman Sauerbeck
2007-11-29 Enable warnings for rake.
30 $VERBOSE = true
bdcf9cb6 » rue
2008-10-20 DEV is gone. See `rake build:help`. vm:test always uses debug flags.
31 $verbose = Rake.application.options.trace || ARGV.delete("-v")
32
a3526242 » Evan Phoenix
2009-04-20 Start of new LLVM JIT
33 if !$verbose and respond_to?(:verbose)
34 verbose(false) if verbose() == :default
35 end
36
9465976f » brixen
2010-06-16 Generalize building with MRI 1.8/1.9 or rbx.
37 $:.unshift File.expand_path("../", __FILE__)
38
0e0a4393 » brixen
2012-07-23 Fixed reloading config.rb.
39 BUILD_CONFIG = {} unless Object.const_defined? :BUILD_CONFIG
a632b482 » brixen
2009-11-24 Added new rake install tasks.
40
0e0a4393 » brixen
2012-07-23 Fixed reloading config.rb.
41 def load_configuration
42 config_rb = File.expand_path "../config.rb", __FILE__
43 config_h = File.expand_path "../vm/gen/config.h", __FILE__
44
45 unless File.exists?(config_rb) and File.exists?(config_h)
46 STDERR.puts "Please run ./configure first"
47 exit 1
48 end
49
50 load config_rb
51 BUILD_CONFIG.replace Rubinius::BUILD_CONFIG
243a7751 » brixen
2009-11-23 Reworked configuring tasks.
52 end
53
0e0a4393 » brixen
2012-07-23 Fixed reloading config.rb.
54 load_configuration
0941eb2a » drbrain
2007-11-08 Add tasks to build .rba files
55
ce78ad9a » dbussink
2012-08-01 Fix LLVM package task
56 unless BUILD_CONFIG[:config_version] == 162
e846db9f » brixen
2010-06-23 Ensure Rakefile checks configure version before anything. Closes #385.
57 STDERR.puts "Your configuration is outdated, please run ./configure first"
9465976f » brixen
2010-06-16 Generalize building with MRI 1.8/1.9 or rbx.
58 exit 1
59 end
60
e846db9f » brixen
2010-06-23 Ensure Rakefile checks configure version before anything. Closes #385.
61 # Yes, this is duplicated from the configure script for now.
62 unless BUILD_CONFIG[:which_ruby] == :ruby or BUILD_CONFIG[:which_ruby] == :rbx
63 STDERR.puts "Sorry, building Rubinius requires MRI or Rubinius"
84e1594d » brixen
2010-01-04 Added config version to enable detecting stale configuration.
64 exit 1
65 end
66
7862130b » brixen
2012-07-12 Build Rubinius file system location independent.
67 def libprefixdir
68 if BUILD_CONFIG[:stagingdir]
69 "#{BUILD_CONFIG[:stagingdir]}#{BUILD_CONFIG[:libdir]}"
70 else
71 "#{BUILD_CONFIG[:sourcedir]}/lib"
72 end
73 end
74
31a0d90d » brixen
2010-11-22 Merge master.
75 # Records the full path to the ruby executable that runs this configure
76 # script. That path will be made available to the rest of the build system
77 # so the same version of ruby is invoked as needed.
78 #
79 # This is duplicated from the configure script for now.
80 @build_ruby = nil
81
82 def build_ruby
83 unless @build_ruby
84 bin = RbConfig::CONFIG["RUBY_INSTALL_NAME"] || RbConfig::CONFIG["ruby_install_name"]
85 bin += (RbConfig::CONFIG['EXEEXT'] || RbConfig::CONFIG['exeext'] || '')
86 @build_ruby = File.join(RbConfig::CONFIG['bindir'], bin)
87 end
88 @build_ruby
89 end
a5aff42b » dbussink
2010-09-14 Verify that the ruby to build with is the one it was configured with
90
91 unless BUILD_CONFIG[:build_ruby] == build_ruby
3ae41574 » brixen
2010-11-18 Tweaks for configure, Rakefile and install to support common ruby com…
92 STDERR.puts "\nUnable to build using the running Ruby executable.\n\n"
93
94 STDERR.puts "To resolve this issue:"
95 if ENV['PATH'] =~ /#{BUILD_CONFIG[:bindir]}/
96 STDERR.puts " * Remove '#{BUILD_CONFIG[:bindir]}' from your PATH."
97 elsif build_ruby == File.join(BUILD_CONFIG[:bindir], BUILD_CONFIG[:program_name])
98 # This may occur using rbx from the build directory to build a version
99 # of rbx to install. The rbx in the build directory will pick up the
100 # lib/rubinius/build_config.rb that was just written by configure.
101 # Obviously, this chewing gum, duct tape, bailing wire, and toilet paper
102 # system needs fixing.
103 STDERR.puts " * Configure using a Ruby executable other than the one in your build directory."
104 else
105 STDERR.puts " * Use '#{BUILD_CONFIG[:build_ruby]}' to build."
106 end
107
a5aff42b » dbussink
2010-09-14 Verify that the ruby to build with is the one it was configured with
108 exit 1
109 end
110
6b363a8d » brixen
2010-10-09 Propagate --cc configure setting to CC, CXX env vars. Closes #520.
111 # Set the build compiler to the configured compiler unless
112 # the compiler is set via CC environment variable.
6596ed77 » brixen
2010-10-17 Provide both --cc and --cxx in configure.
113 ENV['CC'] = BUILD_CONFIG[:cc] unless ENV['CC']
114 ENV['CXX'] = BUILD_CONFIG[:cxx] unless ENV['CXX']
6b363a8d » brixen
2010-10-09 Propagate --cc configure setting to CC, CXX env vars. Closes #520.
115
bd6aef7f » dbussink
2010-08-26 Use RbConfig instead of Config
116 $dlext = RbConfig::CONFIG["DLEXT"]
53969acf » brixen
2011-04-28 Fixed package:llvm task, remove unused misleading compile_c.
117 $CC = ENV['CC']
9ebee090 » brixen
2008-08-20 Add mspec and spec rakelib files from master.
118
02d7caab » brixen
2012-04-11 Run all spec tasks even when a failure occurs.
119 class SpecRunner
d5be52f6 » brixen
2012-05-01 Fixed rake process exit status. Fixes #1687.
120
121 @at_exit_handler_set = false
122 @at_exit_status = 0
123
7862130b » brixen
2012-07-12 Build Rubinius file system location independent.
124 def self.at_exit_status
125 @at_exit_status
126 end
127
d5be52f6 » brixen
2012-05-01 Fixed rake process exit status. Fixes #1687.
128 def self.set_at_exit_handler
129 return if @at_exit_handler_set
130
1c5008a2 » brixen
2012-10-03 Access SpecRunner exit status via a method call.
131 at_exit { exit SpecRunner.at_exit_status }
d5be52f6 » brixen
2012-05-01 Fixed rake process exit status. Fixes #1687.
132 @at_exit_handler_set = true
133 end
134
135 def self.set_at_exit_status(status)
136 @at_exit_status = status
137 end
02d7caab » brixen
2012-04-11 Run all spec tasks even when a failure occurs.
138
139 def initialize
7862130b » brixen
2012-07-12 Build Rubinius file system location independent.
140 unless File.directory? BUILD_CONFIG[:runtimedir]
02d7caab » brixen
2012-04-11 Run all spec tasks even when a failure occurs.
141 # Setting these enables the specs to run when rbx has been configured
142 # to be installed, but rake install has not been run yet.
143 ENV["RBX_RUNTIME"] = File.expand_path "../runtime", __FILE__
144 ENV["RBX_LIB"] = File.expand_path "../lib", __FILE__
145 ENV["CFLAGS"] = "-Ivm/capi"
146 end
0c1fb8ed » brixen
2009-11-28 Make specs run from rake regardless of install config.
147
02d7caab » brixen
2012-04-11 Run all spec tasks even when a failure occurs.
148 ENV.delete("RUBYOPT")
149
150 @handler = lambda do |ok, status|
d5be52f6 » brixen
2012-05-01 Fixed rake process exit status. Fixes #1687.
151 self.class.set_at_exit_status(status.exitstatus) unless ok
02d7caab » brixen
2012-04-11 Run all spec tasks even when a failure occurs.
152 end
153 end
4e10d146 » brixen
2011-10-03 Unset RUBYOPT when running CI from rake.
154
02d7caab » brixen
2012-04-11 Run all spec tasks even when a failure occurs.
155 def run(flags=nil)
84b9977f » brixen
2012-05-04 Fixed setting exit status when specs run.
156 self.class.set_at_exit_handler
157
c75e3463 » brixen
2012-06-26 Try adding Agent to CI again.
158 sh("bin/mspec ci #{ENV['CI_MODE_FLAG'] || flags} -d --agent --background", &@handler)
02d7caab » brixen
2012-04-11 Run all spec tasks even when a failure occurs.
159 end
c4e65081 » brixen
2010-10-12 Added spec, spec18, spec19 rake tasks.
160 end
161
7862130b » brixen
2012-07-12 Build Rubinius file system location independent.
162 if BUILD_CONFIG[:stagingdir]
163 task :default => [:spec, :check_status, :install]
164 else
165 task :default => :spec
166 end
167
168 task :check_status do
169 exit unless SpecRunner.at_exit_status == 0
170 end
8dd2b6b8 » evanphx
2006-08-24 r43@vatu: evan | 2006-08-24 16:34:21 -0700
171
6ea4f497 » evanphx
2011-06-07 Add github task to aid in migration
172 task :github do
173 cur = `git config remote.origin.url`.strip
174 if cur == "git://github.com/evanphx/rubinius.git"
175 sh "git config remote.origin.url git://github.com/rubinius/rubinius.git"
176 puts "\nSwitch to git://github.com/rubinius/rubinius.git"
177 else
178 sh "git config remote.origin.url git@github.com:rubinius/rubinius.git"
179 puts "\nSwitch to github.com:rubinius/rubinius.git"
180 end
181 end
182
bdcf9cb6 » rue
2008-10-20 DEV is gone. See `rake build:help`. vm:test always uses debug flags.
183 # See vm.rake for more information
7862130b » brixen
2012-07-12 Build Rubinius file system location independent.
184 desc "Build Rubinius"
185 task :build => %w[build:build gems:install]
1ce3d9b0 » Ryan Davis
2008-07-17 Reduced Rakefile to a minimally working version
186
90ffc928 » drbrain
2008-08-14 Rip out irrelevant parts of the Rakefile
187 desc "Recompile all ruby system files"
188 task :rebuild => %w[clean build]
1ce3d9b0 » Ryan Davis
2008-07-17 Reduced Rakefile to a minimally working version
189
5853d7ff » brixen
2010-10-07 Specific :ci18 and :ci19 tasks.
190 def run_ci
a8390a9c » Evan Phoenix
2009-12-31 Add ci rake task
191 unless system("rake -q")
192 puts "<< ERROR IN CI, CLEANING AND RERUNNING >>"
193 system "rake -q clean"
194 system "find . -name *.rbc -delete"
195 sh "rake -q"
196 end
197 end
198
5853d7ff » brixen
2010-10-07 Specific :ci18 and :ci19 tasks.
199 desc "Run CI in default (configured) mode"
a276d22a » brixen
2011-09-19 Run specs in 1.8 and 1.9 mode by default.
200 task :ci => %w[build vm:test] do
5853d7ff » brixen
2010-10-07 Specific :ci18 and :ci19 tasks.
201 run_ci
202 end
203
204 # These tasks run the specs in the specified mode regardless of
205 # the default mode with which Rubinius was configured.
206 desc "Run CI in 1.8 mode"
a276d22a » brixen
2011-09-19 Run specs in 1.8 and 1.9 mode by default.
207 task :ci18 => %w[build vm:test] do
208 ENV['CI_MODE_FLAG'] = "-T -X18"
5853d7ff » brixen
2010-10-07 Specific :ci18 and :ci19 tasks.
209 run_ci
210 end
211
212 desc "Run CI in 1.9 mode"
a276d22a » brixen
2011-09-19 Run specs in 1.8 and 1.9 mode by default.
213 task :ci19 => %w[build vm:test] do
5853d7ff » brixen
2010-10-07 Specific :ci18 and :ci19 tasks.
214 ENV['CI_MODE_FLAG'] = "-T -X19"
215 run_ci
216 end
217
58a50ecc » brixen
2010-10-13 Added experimental 2.0 support.
218 desc "Run CI in 2.0 mode"
a276d22a » brixen
2011-09-19 Run specs in 1.8 and 1.9 mode by default.
219 task :ci20 => %w[build vm:test] do
58a50ecc » brixen
2010-10-13 Added experimental 2.0 support.
220 ENV['CI_MODE_FLAG'] = "-T -X20"
221 run_ci
222 end
223
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
224 desc 'Remove rubinius build files'
af222eec » drbrain
2008-10-02 Restore generation of ruby_config and rubinius_config, add clean rules
225 task :clean => %w[
226 vm:clean
227 kernel:clean
228 clean:crap
9ed0630d » brixen
2009-11-10 Reworked compiling C extensions.
229 extensions:clean
af222eec » drbrain
2008-10-02 Restore generation of ruby_config and rubinius_config, add clean rules
230 ]
1ce3d9b0 » Ryan Davis
2008-07-17 Reduced Rakefile to a minimally working version
231
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
232 desc 'Remove rubinius build files and external library build files'
af222eec » drbrain
2008-10-02 Restore generation of ruby_config and rubinius_config, add clean rules
233 task :distclean => %w[
234 clean
235 vm:distclean
236 ]
1ce3d9b0 » Ryan Davis
2008-07-17 Reduced Rakefile to a minimally working version
237
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
238 namespace :clean do
239 desc "Cleans up editor files and other misc crap"
240 task :crap do
241 files = (Dir["*~"] + Dir["**/*~"]).uniq
1ce3d9b0 » Ryan Davis
2008-07-17 Reduced Rakefile to a minimally working version
242
569fccd2 » drbrain
2008-07-30 Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
243 rm_f files, :verbose => $verbose unless files.empty?
244 end
245 end
2e737d73 » brixen
2009-03-24 Removed rake spec commands. See rake spec for details.
246
df791c5a » brixen
2010-09-27 Enable running docs site with bootstrap Ruby using 'rake docs'.
247 desc "Run the Rubinius documentation website"
248 task :docs do
249 require 'kernel/delta/options'
250 require 'rbconfig'
251 require 'webrick'
252 require 'lib/rubinius/documentation'
253
254 Rubinius::Documentation.main
255 end
256
d5be52f6 » brixen
2012-05-01 Fixed rake process exit status. Fixes #1687.
257 spec_runner = SpecRunner.new
258
c4e65081 » brixen
2010-10-12 Added spec, spec18, spec19 rake tasks.
259 desc "Run the CI specs in 1.8 mode but do not rebuild on failure"
a276d22a » brixen
2011-09-19 Run specs in 1.8 and 1.9 mode by default.
260 task :spec18 => %w[build vm:test] do
02d7caab » brixen
2012-04-11 Run all spec tasks even when a failure occurs.
261 spec_runner.run "-T -X18"
c4e65081 » brixen
2010-10-12 Added spec, spec18, spec19 rake tasks.
262 end
2e737d73 » brixen
2009-03-24 Removed rake spec commands. See rake spec for details.
263
c4e65081 » brixen
2010-10-12 Added spec, spec18, spec19 rake tasks.
264 desc "Run the CI specs in 1.9 mode but do not rebuild on failure"
a276d22a » brixen
2011-09-19 Run specs in 1.8 and 1.9 mode by default.
265 task :spec19 => %w[build vm:test] do
02d7caab » brixen
2012-04-11 Run all spec tasks even when a failure occurs.
266 spec_runner.run "-T -X19"
c4e65081 » brixen
2010-10-12 Added spec, spec18, spec19 rake tasks.
267 end
2e737d73 » brixen
2009-03-24 Removed rake spec commands. See rake spec for details.
268
58a50ecc » brixen
2010-10-13 Added experimental 2.0 support.
269 desc "Run the CI specs in 2.0 mode but do not rebuild on failure"
a276d22a » brixen
2011-09-19 Run specs in 1.8 and 1.9 mode by default.
270 task :spec20 => %w[build vm:test] do
02d7caab » brixen
2012-04-11 Run all spec tasks even when a failure occurs.
271 spec_runner.run "-T -X20"
58a50ecc » brixen
2010-10-13 Added experimental 2.0 support.
272 end
273
c4e65081 » brixen
2010-10-12 Added spec, spec18, spec19 rake tasks.
274 desc "Run CI in default (configured) mode but do not rebuild on failure"
ccaa7173 » brixen
2012-02-16 Build and test with only 1.8 or 1.9 mode enabled.
275 task :spec => BUILD_CONFIG[:version_list].map { |v| "spec#{v}" }
580e56e6 » rue
2009-12-01 Add task :todos to do a simple grep for todo marks in kernel/.
276
277 desc "Print list of items marked to-do in kernel/ (@todo|TODO)"
278 task :todos do
0640ecef » Evan Phoenix
2011-04-11 Apply patch for todo. Fixes #810
279
280 # create array with files to be checked
281 filesA = Dir['kernel/**/*.*']
7a59f421 » veganstraightedge
2011-08-11 rake tasks for getting a list of committers by calendar quarter
282
0640ecef » Evan Phoenix
2011-04-11 Apply patch for todo. Fixes #810
283 # search for @todo or TODO
284 filesA.sort!.each do |filename|
285 File.open(filename) do |file|
286 file.each do |line|
287 puts "#{filename} #{file.lineno.to_s}:\t#{line.strip}" if line.include?("@todo") or line.include?("TODO")
288 end
289 end
290 end
580e56e6 » rue
2009-12-01 Add task :todos to do a simple grep for todo marks in kernel/.
291 end
Something went wrong with that request. Please try again.