Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 237 lines (193 sloc) 6.855 kb
90c05c1 @drbrain Update INSTALL to latest information.
drbrain authored
1 # NOTE! When updating this file, also update INSTALL, if necessary.
a8bdc6b @evanphx Cleanup / reorganize Rakefile
evanphx authored
2 # NOTE! Please keep your tasks grouped together.
90c05c1 @drbrain Update INSTALL to latest information.
drbrain authored
3
af5cae6 @brixen Refuse to configure, build if RUBYLIB is set.
brixen authored
4 if ENV["RUBYLIB"]
5 STDERR.puts "ERROR: Please unset RUBYLIB to build Rubinius"
6 exit 1
7 end
8
c3a6df2 Wipe out CDPATH when building. Fixes #555
Evan Phoenix authored
9 # 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
10 # see http://github.com/rubinius/rubinius/issues#issue/555
c3a6df2 Wipe out CDPATH when building. Fixes #555
Evan Phoenix authored
11 if ENV["CDPATH"]
12 ENV.delete("CDPATH")
13 end
14
1088784 Silence a rake warning
Jacqui Maher and Wilson Bilkovich authored
15 $trace ||= false
69a6063 Enable warnings for rake.
Tilman Sauerbeck authored
16 $VERBOSE = true
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored
17 $verbose = Rake.application.options.trace || ARGV.delete("-v")
18
a352624 Start of new LLVM JIT
Evan Phoenix authored
19 if !$verbose and respond_to?(:verbose)
20 verbose(false) if verbose() == :default
21 end
22
9465976 @brixen Generalize building with MRI 1.8/1.9 or rbx.
brixen authored
23 $:.unshift File.expand_path("../", __FILE__)
24
a632b48 @brixen Added new rake install tasks.
brixen authored
25 config_rb = File.expand_path "../config.rb", __FILE__
26 config_h = File.expand_path "../vm/gen/config.h", __FILE__
27
28 unless File.exists?(config_rb) and File.exists?(config_h)
243a775 @brixen Reworked configuring tasks.
brixen authored
29 STDERR.puts "Please run ./configure first"
30 exit 1
31 end
32
a632b48 @brixen Added new rake install tasks.
brixen authored
33 require config_rb
34 BUILD_CONFIG = Rubinius::BUILD_CONFIG
0941eb2 @drbrain Add tasks to build .rba files
drbrain authored
35
a080a18 @brixen Build oniguruma with daedalus.
brixen authored
36 unless BUILD_CONFIG[:config_version] == 155
e846db9 @brixen Ensure Rakefile checks configure version before anything. Closes #385.
brixen authored
37 STDERR.puts "Your configuration is outdated, please run ./configure first"
9465976 @brixen Generalize building with MRI 1.8/1.9 or rbx.
brixen authored
38 exit 1
39 end
40
e846db9 @brixen Ensure Rakefile checks configure version before anything. Closes #385.
brixen authored
41 # Yes, this is duplicated from the configure script for now.
42 unless BUILD_CONFIG[:which_ruby] == :ruby or BUILD_CONFIG[:which_ruby] == :rbx
43 STDERR.puts "Sorry, building Rubinius requires MRI or Rubinius"
84e1594 @brixen Added config version to enable detecting stale configuration.
brixen authored
44 exit 1
45 end
46
31a0d90 @brixen Merge master.
brixen authored
47 # Records the full path to the ruby executable that runs this configure
48 # script. That path will be made available to the rest of the build system
49 # so the same version of ruby is invoked as needed.
50 #
51 # This is duplicated from the configure script for now.
52 @build_ruby = nil
53
54 def build_ruby
55 unless @build_ruby
56 bin = RbConfig::CONFIG["RUBY_INSTALL_NAME"] || RbConfig::CONFIG["ruby_install_name"]
57 bin += (RbConfig::CONFIG['EXEEXT'] || RbConfig::CONFIG['exeext'] || '')
58 @build_ruby = File.join(RbConfig::CONFIG['bindir'], bin)
59 end
60 @build_ruby
61 end
a5aff42 @dbussink Verify that the ruby to build with is the one it was configured with
dbussink authored
62
63 unless BUILD_CONFIG[:build_ruby] == build_ruby
3ae4157 @brixen Tweaks for configure, Rakefile and install to support common ruby com…
brixen authored
64 STDERR.puts "\nUnable to build using the running Ruby executable.\n\n"
65
66 STDERR.puts "To resolve this issue:"
67 if ENV['PATH'] =~ /#{BUILD_CONFIG[:bindir]}/
68 STDERR.puts " * Remove '#{BUILD_CONFIG[:bindir]}' from your PATH."
69 elsif build_ruby == File.join(BUILD_CONFIG[:bindir], BUILD_CONFIG[:program_name])
70 # This may occur using rbx from the build directory to build a version
71 # of rbx to install. The rbx in the build directory will pick up the
72 # lib/rubinius/build_config.rb that was just written by configure.
73 # Obviously, this chewing gum, duct tape, bailing wire, and toilet paper
74 # system needs fixing.
75 STDERR.puts " * Configure using a Ruby executable other than the one in your build directory."
76 else
77 STDERR.puts " * Use '#{BUILD_CONFIG[:build_ruby]}' to build."
78 end
79
a5aff42 @dbussink Verify that the ruby to build with is the one it was configured with
dbussink authored
80 exit 1
81 end
82
6b363a8 @brixen Propagate --cc configure setting to CC, CXX env vars. Closes #520.
brixen authored
83 # Set the build compiler to the configured compiler unless
84 # the compiler is set via CC environment variable.
6596ed7 @brixen Provide both --cc and --cxx in configure.
brixen authored
85 ENV['CC'] = BUILD_CONFIG[:cc] unless ENV['CC']
86 ENV['CXX'] = BUILD_CONFIG[:cxx] unless ENV['CXX']
6b363a8 @brixen Propagate --cc configure setting to CC, CXX env vars. Closes #520.
brixen authored
87
bd6aef7 @dbussink Use RbConfig instead of Config
dbussink authored
88 $dlext = RbConfig::CONFIG["DLEXT"]
53969ac @brixen Fixed package:llvm task, remove unused misleading compile_c.
brixen authored
89 $CC = ENV['CC']
9ebee09 @brixen Add mspec and spec rakelib files from master.
brixen authored
90
c4e6508 @brixen Added spec, spec18, spec19 rake tasks.
brixen authored
91 def run_specs(flags=nil)
0c1fb8e @brixen Make specs run from rake regardless of install config.
brixen authored
92 unless File.directory? BUILD_CONFIG[:runtime]
93 # Setting these enables the specs to run when rbx has been configured
94 # to be installed, but rake install has not been run yet.
95 ENV["RBX_RUNTIME"] = File.expand_path "../runtime", __FILE__
96 ENV["RBX_LIB"] = File.expand_path "../lib", __FILE__
97 ENV["CFLAGS"] = "-Ivm/capi"
98 end
99
4e10d14 @brixen Unset RUBYOPT when running CI from rake.
brixen authored
100 ENV.delete("RUBYOPT")
101
cdb9841 @brixen Added -d to rake spec tasks so full backtraces are output.
brixen authored
102 sh "bin/mspec ci #{ENV['CI_MODE_FLAG'] || flags} -d --background --agent"
c4e6508 @brixen Added spec, spec18, spec19 rake tasks.
brixen authored
103 end
104
a276d22 @brixen Run specs in 1.8 and 1.9 mode by default.
brixen authored
105 task :default => :spec
8dd2b6b @evanphx r43@vatu: evan | 2006-08-24 16:34:21 -0700
evanphx authored
106
6ea4f49 @evanphx Add github task to aid in migration
evanphx authored
107 task :github do
108 cur = `git config remote.origin.url`.strip
109 if cur == "git://github.com/evanphx/rubinius.git"
110 sh "git config remote.origin.url git://github.com/rubinius/rubinius.git"
111 puts "\nSwitch to git://github.com/rubinius/rubinius.git"
112 else
113 sh "git config remote.origin.url git@github.com:rubinius/rubinius.git"
114 puts "\nSwitch to github.com:rubinius/rubinius.git"
115 end
116 end
117
bdcf9cb @rue DEV is gone. See `rake build:help`. vm:test always uses debug flags.
rue authored
118 # See vm.rake for more information
119 desc "Build everything that needs to be built at default level."
39a7914 Introdue Daedalus, a new native code builder
Evan Phoenix authored
120 task :build => ["build:build", "gem_bootstrap"]
1ce3d9b Reduced Rakefile to a minimally working version
Ryan Davis authored
121
90ffc92 @drbrain Rip out irrelevant parts of the Rakefile
drbrain authored
122 desc "Recompile all ruby system files"
123 task :rebuild => %w[clean build]
1ce3d9b Reduced Rakefile to a minimally working version
Ryan Davis authored
124
5853d7f @brixen Specific :ci18 and :ci19 tasks.
brixen authored
125 def run_ci
a8390a9 Add ci rake task
Evan Phoenix authored
126 unless system("rake -q")
127 puts "<< ERROR IN CI, CLEANING AND RERUNNING >>"
128 system "rake -q clean"
129 system "find . -name *.rbc -delete"
130 sh "rake -q"
131 end
132 end
133
5853d7f @brixen Specific :ci18 and :ci19 tasks.
brixen authored
134 desc "Run CI in default (configured) mode"
a276d22 @brixen Run specs in 1.8 and 1.9 mode by default.
brixen authored
135 task :ci => %w[build vm:test] do
5853d7f @brixen Specific :ci18 and :ci19 tasks.
brixen authored
136 run_ci
137 end
138
139 # These tasks run the specs in the specified mode regardless of
140 # the default mode with which Rubinius was configured.
141 desc "Run CI in 1.8 mode"
a276d22 @brixen Run specs in 1.8 and 1.9 mode by default.
brixen authored
142 task :ci18 => %w[build vm:test] do
143 ENV['CI_MODE_FLAG'] = "-T -X18"
5853d7f @brixen Specific :ci18 and :ci19 tasks.
brixen authored
144 run_ci
145 end
146
147 desc "Run CI in 1.9 mode"
a276d22 @brixen Run specs in 1.8 and 1.9 mode by default.
brixen authored
148 task :ci19 => %w[build vm:test] do
5853d7f @brixen Specific :ci18 and :ci19 tasks.
brixen authored
149 ENV['CI_MODE_FLAG'] = "-T -X19"
150 run_ci
151 end
152
58a50ec @brixen Added experimental 2.0 support.
brixen authored
153 desc "Run CI in 2.0 mode"
a276d22 @brixen Run specs in 1.8 and 1.9 mode by default.
brixen authored
154 task :ci20 => %w[build vm:test] do
58a50ec @brixen Added experimental 2.0 support.
brixen authored
155 ENV['CI_MODE_FLAG'] = "-T -X20"
156 run_ci
157 end
158
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
159 desc 'Remove rubinius build files'
af222ee @drbrain Restore generation of ruby_config and rubinius_config, add clean rules
drbrain authored
160 task :clean => %w[
161 vm:clean
162 kernel:clean
163 clean:crap
9ed0630 @brixen Reworked compiling C extensions.
brixen authored
164 extensions:clean
af222ee @drbrain Restore generation of ruby_config and rubinius_config, add clean rules
drbrain authored
165 ]
1ce3d9b Reduced Rakefile to a minimally working version
Ryan Davis authored
166
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
167 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
168 task :distclean => %w[
169 clean
170 vm:distclean
171 ]
1ce3d9b Reduced Rakefile to a minimally working version
Ryan Davis authored
172
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
173 namespace :clean do
174 desc "Cleans up editor files and other misc crap"
175 task :crap do
176 files = (Dir["*~"] + Dir["**/*~"]).uniq
1ce3d9b Reduced Rakefile to a minimally working version
Ryan Davis authored
177
569fccd @drbrain Move vm/Rakefile to rakelib/vm.rake, integrate it into the base rake …
drbrain authored
178 rm_f files, :verbose => $verbose unless files.empty?
179 end
180 end
2e737d7 @brixen Removed rake spec commands. See rake spec for details.
brixen authored
181
a632b48 @brixen Added new rake install tasks.
brixen authored
182 desc 'Move the preinstalled gem setup into place'
183 task :gem_bootstrap do
ef0f8d0 @brixen Better preinstalled gem install (also Windows friendly).
brixen authored
184 pre_gems = Dir["preinstalled-gems/data/specifications/*.gemspec"].sort
185 ins_gems = Dir["gems/rubinius/specifications/*.gemspec"].sort
186 unless pre_gems == ins_gems
d705d31 @brixen Don't fail if gems/rubinius doesn't exist.
brixen authored
187 FileUtils.rm_rf "gems/rubinius"
ef0f8d0 @brixen Better preinstalled gem install (also Windows friendly).
brixen authored
188 FileUtils.mkdir_p "gems/rubinius"
189 FileUtils.cp_r "preinstalled-gems/bin", "gems/bin"
190 FileUtils.cp_r "preinstalled-gems/data", "gems/rubinius/preinstalled"
a632b48 @brixen Added new rake install tasks.
brixen authored
191 end
192 end
193
df791c5 @brixen Enable running docs site with bootstrap Ruby using 'rake docs'.
brixen authored
194 desc "Run the Rubinius documentation website"
195 task :docs do
196 require 'kernel/delta/options'
197 require 'rbconfig'
198 require 'webrick'
199 require 'lib/rubinius/documentation'
200
201 Rubinius::Documentation.main
202 end
203
c4e6508 @brixen Added spec, spec18, spec19 rake tasks.
brixen authored
204 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
205 task :spec18 => %w[build vm:test] do
206 run_specs "-T -X18"
c4e6508 @brixen Added spec, spec18, spec19 rake tasks.
brixen authored
207 end
2e737d7 @brixen Removed rake spec commands. See rake spec for details.
brixen authored
208
c4e6508 @brixen Added spec, spec18, spec19 rake tasks.
brixen authored
209 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
210 task :spec19 => %w[build vm:test] do
c4e6508 @brixen Added spec, spec18, spec19 rake tasks.
brixen authored
211 run_specs "-T -X19"
212 end
2e737d7 @brixen Removed rake spec commands. See rake spec for details.
brixen authored
213
58a50ec @brixen Added experimental 2.0 support.
brixen authored
214 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
215 task :spec20 => %w[build vm:test] do
58a50ec @brixen Added experimental 2.0 support.
brixen authored
216 run_specs "-T -X20"
217 end
218
c4e6508 @brixen Added spec, spec18, spec19 rake tasks.
brixen authored
219 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
220 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
221
222 desc "Print list of items marked to-do in kernel/ (@todo|TODO)"
223 task :todos do
0640ece Apply patch for todo. Fixes #810
Evan Phoenix authored
224
225 # create array with files to be checked
226 filesA = Dir['kernel/**/*.*']
7a59f42 @veganstraightedge rake tasks for getting a list of committers by calendar quarter
veganstraightedge authored
227
0640ece Apply patch for todo. Fixes #810
Evan Phoenix authored
228 # search for @todo or TODO
229 filesA.sort!.each do |filename|
230 File.open(filename) do |file|
231 file.each do |line|
232 puts "#{filename} #{file.lineno.to_s}:\t#{line.strip}" if line.include?("@todo") or line.include?("TODO")
233 end
234 end
235 end
580e56e @rue Add task :todos to do a simple grep for todo marks in kernel/.
rue authored
236 end
Something went wrong with that request. Please try again.