-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathstart-rubyci
executable file
·186 lines (155 loc) · 6.21 KB
/
start-rubyci
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
#!/usr/bin/env ruby
# start-rubyci - build start script
#
# Copyright (C) 2005-2013 Tanaka Akira <akr@fsij.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# 3. The name of the author may not be used to endorse or promote
# products derived from this software without specific prior
# written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
$:.unshift File.dirname(File.expand_path(__FILE__))
require 'chkbuild'
#ENV['LC_ALL'] = 'C'
# resource limits
#word_bytes = [nil].pack("p").length
#ChkBuild.limit(:cpu => 3600*4) # seconds
#ChkBuild.limit(:stack => 1024*1024*10*word_bytes) # bytes
#ChkBuild.limit(:data => 1024*1024*500*word_bytes) # bytes
#ChkBuild.limit(:as => 1024*1024*500*word_bytes) # bytes
# process priority
#ChkBuild.nice = 10
# ChkBuild.nickname identify chkbuild installation.
# It is used for title of HTML, etc.
# The default is the hostname (without domain).
# ChkBuild.nickname = 'nickname'
ChkBuild.nickname = ENV["RUBYCI_NICKNAME"] if ENV["RUBYCI_NICKNAME"]
# ChkBuild.top_uri is used for RSS.
# ChkBuild.top_uri = "file://#{ChkBuild.public_top}/"
# ChkBuild.top_uri = nil # use relative URL
# Oneshot commit build is not triggered periodically, so wait until
# other builds are finished.
ChkBuild.wait_in_progress_builds = true if ENV["RUBYCI_ONESHOT_BUILD_COMMIT"]
#ChkBuild.azure_upload_target rescue nil
ChkBuild.s3_upload_target
arg = [].push(
[
{ :suffix_? => 'master', :output_interval_timeout => '30min' },
*ChkBuild::Ruby.maintained_release_branches
],
if commit = ENV["RUBYCI_ONESHOT_BUILD_COMMIT"]
{ :suffix_? => 'oneshot', :ruby_revision => commit }
end,
# [ # :abi_check needs --enable-shared
# { :suffix_? => 'trunk', :abi_check_notitle => '/home/akr/ruby/200p0', :output_interval_timeout => '10min' },
# { :suffix_? => '2.1', :abi_check => '/home/akr/ruby/210p0' },
# { :suffix_? => '2.0.0', :abi_check => '/home/akr/ruby/200p0' },
# { :suffix_? => '1.9.3', :abi_check => '/home/akr/ruby/193p0', :abi_check_options => ['--skip-symbols', ChkBuild::SAMPLE_DIRECTORY+'abi-check-ruby-1.9.3-skip-symbols.txt'] },
# ],
# ChkBuild::Ruby::MaintainedBranches,
# %w[trunk],
# %w[trunk 2.0.0],
# ['o0', 'o1', nil, 'o3', 'os'],
[nil, "pth"],
# ['m32', 'm64'],
# [nil, { :suffix_? => "-outofplace", :inplace_build => false}]
# :git_shallow_clone => true,
# :autoconf_command => 'autoconf',
# :configure_args_valgrind => %w[--with-valgrind],
# :configure_args_enable_shared => %w[--enable-shared],
# :cppflags => %w[-DRUBY_DEBUG_ENV],
# :optflags => %w[-O2],
# :debugflags => %w[-g],
# :warnflags => %w[-W -Wall -Wformat=2 -Wundef -Wno-parentheses -Wno-unused-parameter -Wno-missing-field-initializers],
# :dldflags => %w[],
# :validate_dependencies => false,
# :validate_dependencies => true, # needs gmake and gcc 4.5 or later.
#
# :do_test => true,
# :old => 1,
:use_rubyspec => false,
:use_rubyspec_in_tree => true,
:timeout => '2h',
:output_interval_timeout => '5min'
)
h = arg[-1]
case uname = `uname -srm`
when /\ALinux/
ENV['HOME'] = "/home/#{ENV['USER']}" if File.exist?('/etc/redhat-release')
h[:optflags] = '-O3 -mfpmath=sse -msse2' if /i.86/ =~ uname
when /\AFreeBSD/
ENV['PATH'] = "#{ENV['PATH']}:/usr/local/bin"
h[:configure_args_with_opt_dir] = %w[--with-opt-dir=/usr/local]
h[:optflags] = '-O3 -mfpmath=sse -msse2' if /i.86/ =~ uname
end
if ChkBuild.nickname.end_with?("-no-yjit")
arg[0].slice!(1,9) # run only master
h[:configure_args_disable_yjit] = %w[--disable-yjit]
elsif ChkBuild.nickname.end_with?("-yjit")
arg[0].slice!(1,9) # run only master
h[:configure_args_enable_yjit] = %w[--enable-yjit]
end
if ChkBuild.nickname.start_with?("osx")
h[:autoreconf_command] = 'autoreconf'
ENV["PATH"] = "/opt/local/bin:/opt/local/sbin:#{ENV['PATH']}"
h[:configure_args_with_openssl_dir] = %w[--with-openssl-dir=/opt/local]
h[:configure_args_with_libyaml_dir] = %w[--with-libyaml-dir=/opt/local]
end
case ChkBuild.nickname
when 'tk2-243-31075', 'armv8b'
arg[0].slice!(1,9)
when 'debian' # Debian 11.0(testing) x86_64
h[:autoreconf_command] = 'autoreconf'
when 'arch'
h[:autoreconf_command] = 'autoreconf'
when 'scw-9d6766'
arg[0].slice!(1,9)
h[:timeout] = '3h'
when 'openbsd-current'
h[:autoconf_command] = 'autoconf-2.69'
h[:autoreconf_command] = 'autoreconf-2.69'
h[:configure_args_opt] = %w[--with-opt-dir=/usr/local]
h[:output_interval_timeout] = '10min'
ENV['RUBY_FIBER_VM_STACK_SIZE'] = '32768'
ENV['RUBY_FIBER_MACHINE_STACK_SIZE'] = '65536'
ENV["AUTOMAKE_VERSION"] = "1.16"
h[:git_shallow_clone] = true
when 'icc-x64'
ENV["CC"] = "icx -std=gnu99"
ENV["CXX"] = "icx -std=gnu++11"
h[:output_interval_timeout] = '20min'
when /\Aandroid\d+-/
arg[0].slice!(1,9)
h[:git_shallow_clone] = true
# hardlink is not available for a normal user on Android
def File.link(new, old); end
h[:autoreconf_command] = 'autoreconf'
when /riscv64/
arg[0].slice!(1,9)
h[:timeout] = '4h'
ENV["RUBY_TEST_TIMEOUT_SCALE"] = "5"
h[:git_shallow_clone] = true
end
h[:configure_args] = ["--with-baseruby=#{RbConfig.ruby}"]
ChkBuild::Ruby.def_target(*arg)
ChkBuild.main