Skip to content
Newer
Older
100644 292 lines (235 sloc) 8.18 KB
90c05c1 @drbrain Update INSTALL to latest information.
drbrain authored Oct 18, 2007
1 # NOTE! When updating this file, also update INSTALL, if necessary.
a8bdc6b @evanphx Cleanup / reorganize Rakefile
evanphx authored Jan 22, 2008
2 # NOTE! Please keep your tasks grouped together.
90c05c1 @drbrain Update INSTALL to latest information.
drbrain authored Oct 18, 2007
3
1651179 @brixen Fixed Rake::DSL warnings.
brixen authored Jul 25, 2012
4 include Rake::DSL if Rake.const_defined? :DSL
5
af5cae6 Refuse to configure, build if RUBYLIB is set.
Brian Ford authored Oct 1, 2010
6 if ENV["RUBYLIB"]
16d3c35 @brixen Allow RUBYLIB to be set, but issue a huge warning.
brixen authored Jul 25, 2012
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
d113a68 @headius Fix misspelling.
headius authored Jul 26, 2012
16 WARNING warned. We recommend unsetting this environment variable WARNING
16d3c35 @brixen Allow RUBYLIB to be set, but issue a huge warning.
brixen authored Jul 26, 2012
17 WARNING and running the build again. WARNING
18 WARNING WARNING
19 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
20 EOM
af5cae6 Refuse to configure, build if RUBYLIB is set.
Brian Ford authored Oct 1, 2010
21 end
22
c3a6df2 Wipe out CDPATH when building. Fixes #555
Evan Phoenix authored Nov 2, 2010
23 # Wipe out CDPATH, it interferes with building in some cases,
e4c03c2 @czarneckid Change only the appropriate references to point from evanphx to rubin…
czarneckid authored Jun 11, 2011
24 # see http://github.com/rubinius/rubinius/issues#issue/555
c3a6df2 Wipe out CDPATH when building. Fixes #555
Evan Phoenix authored Nov 2, 2010
25 if ENV["CDPATH"]
26 ENV.delete("CDPATH")
27 end
28
1088784 Silence a rake warning
Jacqui Maher and Wilson Bilkovich authored Jan 22, 2009
29 $trace ||= false
69a6063 Enable warnings for rake.
Tilman Sauerbeck authored Nov 29, 2007
30 $VERBOSE = true
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored Oct 20, 2008
31 $verbose = Rake.application.options.trace || ARGV.delete("-v")
32
a352624 Start of new LLVM JIT
Evan Phoenix authored Apr 20, 2009
33 if !$verbose and respond_to?(:verbose)
34 verbose(false) if verbose() == :default
35 end
36
9465976 Generalize building with MRI 1.8/1.9 or rbx.
Brian Ford authored Jun 16, 2010
37 $:.unshift File.expand_path("../", __FILE__)
38
0e0a439 @brixen Fixed reloading config.rb.
brixen authored Jul 23, 2012
39 BUILD_CONFIG = {} unless Object.const_defined? :BUILD_CONFIG
a632b48 Added new rake install tasks.
Brian Ford authored Nov 24, 2009
40
0e0a439 @brixen Fixed reloading config.rb.
brixen authored Jul 24, 2012
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
243a775 Reworked configuring tasks.
Brian Ford authored Nov 23, 2009
52 end
53
0e0a439 @brixen Fixed reloading config.rb.
brixen authored Jul 24, 2012
54 load_configuration
0941eb2 @drbrain Add tasks to build .rba files
drbrain authored Nov 8, 2007
55
ce78ad9 @dbussink Fix LLVM package task
dbussink authored Aug 1, 2012
56 unless BUILD_CONFIG[:config_version] == 162
e846db9 Ensure Rakefile checks configure version before anything. Closes #385.
Brian Ford authored Jun 23, 2010
57 STDERR.puts "Your configuration is outdated, please run ./configure first"
9465976 Generalize building with MRI 1.8/1.9 or rbx.
Brian Ford authored Jun 16, 2010
58 exit 1
59 end
60
e846db9 Ensure Rakefile checks configure version before anything. Closes #385.
Brian Ford authored Jun 23, 2010
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"
84e1594 Added config version to enable detecting stale configuration.
Brian Ford authored Jan 4, 2010
64 exit 1
65 end
66
7862130 @brixen Build Rubinius file system location independent.
brixen authored Jul 12, 2012
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
31a0d90 Merge master.
Brian Ford authored Nov 22, 2010
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
a5aff42 @dbussink Verify that the ruby to build with is the one it was configured with
dbussink authored Sep 14, 2010
90
91 unless BUILD_CONFIG[:build_ruby] == build_ruby
3ae4157 Tweaks for configure, Rakefile and install to support common ruby com…
Brian Ford authored Nov 18, 2010
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
a5aff42 @dbussink Verify that the ruby to build with is the one it was configured with
dbussink authored Sep 14, 2010
108 exit 1
109 end
110
6b363a8 Propagate --cc configure setting to CC, CXX env vars. Closes #520.
Brian Ford authored Oct 9, 2010
111 # Set the build compiler to the configured compiler unless
112 # the compiler is set via CC environment variable.
6596ed7 Provide both --cc and --cxx in configure.
Brian Ford authored Oct 17, 2010
113 ENV['CC'] = BUILD_CONFIG[:cc] unless ENV['CC']
114 ENV['CXX'] = BUILD_CONFIG[:cxx] unless ENV['CXX']
6b363a8 Propagate --cc configure setting to CC, CXX env vars. Closes #520.
Brian Ford authored Oct 10, 2010
115
bd6aef7 @dbussink Use RbConfig instead of Config
dbussink authored Aug 26, 2010
116 $dlext = RbConfig::CONFIG["DLEXT"]
53969ac Fixed package:llvm task, remove unused misleading compile_c.
Brian Ford authored Apr 28, 2011
117 $CC = ENV['CC']
9ebee09 Add mspec and spec rakelib files from master.
Brian Ford authored Aug 20, 2008
118
02d7caa @brixen Run all spec tasks even when a failure occurs.
brixen authored Apr 11, 2012
119 class SpecRunner
d5be52f @brixen Fixed rake process exit status. Fixes #1687.
brixen authored May 1, 2012
120
121 @at_exit_handler_set = false
122 @at_exit_status = 0
123
7862130 @brixen Build Rubinius file system location independent.
brixen authored Jul 12, 2012
124 def self.at_exit_status
125 @at_exit_status
126 end
127
d5be52f @brixen Fixed rake process exit status. Fixes #1687.
brixen authored May 2, 2012
128 def self.set_at_exit_handler
129 return if @at_exit_handler_set
130
1c5008a @brixen Access SpecRunner exit status via a method call.
brixen authored Oct 3, 2012
131 at_exit { exit SpecRunner.at_exit_status }
d5be52f @brixen Fixed rake process exit status. Fixes #1687.
brixen authored May 2, 2012
132 @at_exit_handler_set = true
133 end
134
135 def self.set_at_exit_status(status)
136 @at_exit_status = status
137 end
02d7caa @brixen Run all spec tasks even when a failure occurs.
brixen authored Apr 11, 2012
138
139 def initialize
7862130 @brixen Build Rubinius file system location independent.
brixen authored Jul 12, 2012
140 unless File.directory? BUILD_CONFIG[:runtimedir]
02d7caa @brixen Run all spec tasks even when a failure occurs.
brixen authored Apr 11, 2012
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
0c1fb8e Make specs run from rake regardless of install config.
Brian Ford authored Nov 28, 2009
147
02d7caa @brixen Run all spec tasks even when a failure occurs.
brixen authored Apr 11, 2012
148 ENV.delete("RUBYOPT")
149
150 @handler = lambda do |ok, status|
d5be52f @brixen Fixed rake process exit status. Fixes #1687.
brixen authored May 2, 2012
151 self.class.set_at_exit_status(status.exitstatus) unless ok
02d7caa @brixen Run all spec tasks even when a failure occurs.
brixen authored Apr 11, 2012
152 end
153 end
4e10d14 @brixen Unset RUBYOPT when running CI from rake.
brixen authored Oct 3, 2011
154
02d7caa @brixen Run all spec tasks even when a failure occurs.
brixen authored Apr 11, 2012
155 def run(flags=nil)
84b9977 @brixen Fixed setting exit status when specs run.
brixen authored May 4, 2012
156 self.class.set_at_exit_handler
157
c75e346 @brixen Try adding Agent to CI again.
brixen authored Jun 26, 2012
158 sh("bin/mspec ci #{ENV['CI_MODE_FLAG'] || flags} -d --agent --background", &@handler)
02d7caa @brixen Run all spec tasks even when a failure occurs.
brixen authored Apr 11, 2012
159 end
c4e6508 Added spec, spec18, spec19 rake tasks.
Brian Ford authored Oct 12, 2010
160 end
161
7862130 @brixen Build Rubinius file system location independent.
brixen authored Jul 12, 2012
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
8dd2b6b @evanphx r43@vatu: evan | 2006-08-24 16:34:21 -0700
evanphx authored Aug 24, 2006
171
6ea4f49 @evanphx Add github task to aid in migration
evanphx authored Jun 7, 2011
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
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored Oct 20, 2008
183 # See vm.rake for more information
7862130 @brixen Build Rubinius file system location independent.
brixen authored Jul 12, 2012
184 desc "Build Rubinius"
185 task :build => %w[build:build gems:install]
1ce3d9b Reduced Rakefile to a minimally working version
Ryan Davis authored Jul 17, 2008
186
90ffc92 @drbrain Rip out irrelevant parts of the Rakefile
drbrain authored Aug 14, 2008
187 desc "Recompile all ruby system files"
188 task :rebuild => %w[clean build]
1ce3d9b Reduced Rakefile to a minimally working version
Ryan Davis authored Jul 17, 2008
189
5853d7f Specific :ci18 and :ci19 tasks.
Brian Ford authored Oct 7, 2010
190 def run_ci
a8390a9 Add ci rake task
Evan Phoenix authored Dec 31, 2009
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
5853d7f Specific :ci18 and :ci19 tasks.
Brian Ford authored Oct 7, 2010
199 desc "Run CI in default (configured) mode"
a276d22 @brixen Run specs in 1.8 and 1.9 mode by default.
brixen authored Sep 19, 2011
200 task :ci => %w[build vm:test] do
5853d7f Specific :ci18 and :ci19 tasks.
Brian Ford authored Oct 7, 2010
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"
a276d22 @brixen Run specs in 1.8 and 1.9 mode by default.
brixen authored Sep 19, 2011
207 task :ci18 => %w[build vm:test] do
208 ENV['CI_MODE_FLAG'] = "-T -X18"
5853d7f Specific :ci18 and :ci19 tasks.
Brian Ford authored Oct 7, 2010
209 run_ci
210 end
211
212 desc "Run CI in 1.9 mode"
a276d22 @brixen Run specs in 1.8 and 1.9 mode by default.
brixen authored Sep 19, 2011
213 task :ci19 => %w[build vm:test] do
5853d7f Specific :ci18 and :ci19 tasks.
Brian Ford authored Oct 7, 2010
214 ENV['CI_MODE_FLAG'] = "-T -X19"
215 run_ci
216 end
217
58a50ec Added experimental 2.0 support.
Brian Ford authored Oct 13, 2010
218 desc "Run CI in 2.0 mode"
a276d22 @brixen Run specs in 1.8 and 1.9 mode by default.
brixen authored Sep 19, 2011
219 task :ci20 => %w[build vm:test] do
58a50ec Added experimental 2.0 support.
Brian Ford authored Oct 13, 2010
220 ENV['CI_MODE_FLAG'] = "-T -X20"
221 run_ci
222 end
223
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored Jul 30, 2008
224 desc 'Remove rubinius build files'
af222ee @drbrain Restore generation of ruby_config and rubinius_config, add clean rules
drbrain authored Oct 2, 2008
225 task :clean => %w[
226 vm:clean
227 kernel:clean
228 clean:crap
9ed0630 Reworked compiling C extensions.
Brian Ford authored Nov 10, 2009
229 extensions:clean
af222ee @drbrain Restore generation of ruby_config and rubinius_config, add clean rules
drbrain authored Oct 2, 2008
230 ]
1ce3d9b Reduced Rakefile to a minimally working version
Ryan Davis authored Jul 17, 2008
231
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored Jul 30, 2008
232 desc 'Remove rubinius build files and external library build files'
af222ee @drbrain Restore generation of ruby_config and rubinius_config, add clean rules
drbrain authored Oct 2, 2008
233 task :distclean => %w[
234 clean
235 vm:distclean
236 ]
1ce3d9b Reduced Rakefile to a minimally working version
Ryan Davis authored Jul 17, 2008
237
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored Jul 30, 2008
238 namespace :clean do
239 desc "Cleans up editor files and other misc crap"
240 task :crap do
241 files = (Dir["*~"] + Dir["**/*~"]).uniq
1ce3d9b Reduced Rakefile to a minimally working version
Ryan Davis authored Jul 17, 2008
242
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored Jul 30, 2008
243 rm_f files, :verbose => $verbose unless files.empty?
244 end
245 end
2e737d7 Removed rake spec commands. See rake spec for details.
Brian Ford authored Mar 24, 2009
246
df791c5 Enable running docs site with bootstrap Ruby using 'rake docs'.
Brian Ford authored Sep 27, 2010
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
d5be52f @brixen Fixed rake process exit status. Fixes #1687.
brixen authored May 2, 2012
257 spec_runner = SpecRunner.new
258
c4e6508 Added spec, spec18, spec19 rake tasks.
Brian Ford authored Oct 13, 2010
259 desc "Run the CI specs in 1.8 mode but do not rebuild on failure"
a276d22 @brixen Run specs in 1.8 and 1.9 mode by default.
brixen authored Sep 19, 2011
260 task :spec18 => %w[build vm:test] do
02d7caa @brixen Run all spec tasks even when a failure occurs.
brixen authored Apr 11, 2012
261 spec_runner.run "-T -X18"
c4e6508 Added spec, spec18, spec19 rake tasks.
Brian Ford authored Oct 13, 2010
262 end
2e737d7 Removed rake spec commands. See rake spec for details.
Brian Ford authored Mar 24, 2009
263
c4e6508 Added spec, spec18, spec19 rake tasks.
Brian Ford authored Oct 13, 2010
264 desc "Run the CI specs in 1.9 mode but do not rebuild on failure"
a276d22 @brixen Run specs in 1.8 and 1.9 mode by default.
brixen authored Sep 19, 2011
265 task :spec19 => %w[build vm:test] do
02d7caa @brixen Run all spec tasks even when a failure occurs.
brixen authored Apr 11, 2012
266 spec_runner.run "-T -X19"
c4e6508 Added spec, spec18, spec19 rake tasks.
Brian Ford authored Oct 13, 2010
267 end
2e737d7 Removed rake spec commands. See rake spec for details.
Brian Ford authored Mar 24, 2009
268
58a50ec Added experimental 2.0 support.
Brian Ford authored Oct 13, 2010
269 desc "Run the CI specs in 2.0 mode but do not rebuild on failure"
a276d22 @brixen Run specs in 1.8 and 1.9 mode by default.
brixen authored Sep 19, 2011
270 task :spec20 => %w[build vm:test] do
02d7caa @brixen Run all spec tasks even when a failure occurs.
brixen authored Apr 11, 2012
271 spec_runner.run "-T -X20"
58a50ec Added experimental 2.0 support.
Brian Ford authored Oct 13, 2010
272 end
273
c4e6508 Added spec, spec18, spec19 rake tasks.
Brian Ford authored Oct 13, 2010
274 desc "Run CI in default (configured) mode but do not rebuild on failure"
ccaa717 @brixen Build and test with only 1.8 or 1.9 mode enabled.
brixen authored Feb 16, 2012
275 task :spec => BUILD_CONFIG[:version_list].map { |v| "spec#{v}" }
580e56e @rue Add task :todos to do a simple grep for todo marks in kernel/.
rue authored Dec 1, 2009
276
277 desc "Print list of items marked to-do in kernel/ (@todo|TODO)"
278 task :todos do
0640ece Apply patch for todo. Fixes #810
Evan Phoenix authored Apr 11, 2011
279
280 # create array with files to be checked
281 filesA = Dir['kernel/**/*.*']
7a59f42 @veganstraightedge rake tasks for getting a list of committers by calendar quarter
veganstraightedge authored Aug 11, 2011
282
0640ece Apply patch for todo. Fixes #810
Evan Phoenix authored Apr 11, 2011
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
580e56e @rue Add task :todos to do a simple grep for todo marks in kernel/.
rue authored Nov 30, 2009
291 end
Something went wrong with that request. Please try again.