Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 314 lines (243 sloc) 10.409 kb
2cdd46a @adunstan Initial client release
adunstan authored
1
2 # -*-perl-*- hey - emacs - this is a perl file
3
15cf4ed @adunstan Add missed license/copyright notices.
adunstan authored
4 =comment
5
6 Copyright (c) 2003-2010, Andrew Dunstan
7
8 See accompanying License file for license details
9
10 =cut
11
2cdd46a @adunstan Initial client release
adunstan authored
12 package PGBuild;
13
334f23e @adunstan . config file compile warning fix
adunstan authored
14 use strict;
15
2cdd46a @adunstan Initial client release
adunstan authored
16 use vars qw(%conf);
17
e8d0ea6 @adunstan Mark Release 4.8
adunstan authored
18 # use vars qw($VERSION); $VERSION = 'REL_4.8';
e86c931 @adunstan Move to tag based versioning scheme - we'll be able to sue this with …
adunstan authored
19
334f23e @adunstan . config file compile warning fix
adunstan authored
20 my $branch;
21 {
db2ba88 @adunstan Perltidy run.
adunstan authored
22 no warnings qw(once);
23 $branch = $main::branch;
334f23e @adunstan . config file compile warning fix
adunstan authored
24 }
1bdfe9f @adunstan . allow per-branch config
adunstan authored
25
db2ba88 @adunstan Perltidy run.
adunstan authored
26 %conf =(
27 scm => 'git', # or 'cvs'
28 scmrepo => undef, # default is community repo for either type
29 scm_url => undef, # webref for diffs on server - use default for community
30 # git_reference => undef, # for --reference on git repo
31 # cvsmethod => 'update', # or 'export'
32 use_git_cvsserver => undef, # or 'true' if repo is a git cvsserver
33 make => 'make', # or gmake if required. can include path if necessary.
0705780 @adunstan Support make_jobs config param for parallel builds.
adunstan authored
34 make_jobs => undef, # >1 for parallel "make" and "make check" steps
db2ba88 @adunstan Perltidy run.
adunstan authored
35 tar_log_cmd => undef, # default is "tar -z -cf runlogs.tgz *.log"
36 # replacement must have the same effect
37 # must be absolute, can be either Unix or Windows style for MSVC
38 build_root => '/path/to/buildroot',
39 use_vpath => undef, # set true to do vpath builds
40
41 # path to directory with auxiliary web script
42 # if relative, the must be relative to buildroot/branch
43 # possibly only necessary now on WIndows, if at all
44 aux_path => "../..",
45
46 keep_error_builds => 0,
47 target => "http://www.pgbuildfarm.org/cgi-bin/pgstatus.pl",
48 upgrade_target => "http://www.pgbuildfarm.org/cgi-bin/upgrade.pl",
49 animal => "CHANGEME",
50 secret => "CHANGEME",
51
52 # change this to a true value if using MSVC, in which case also
53 # see MSVC section below
54
55 using_msvc => undef,
56
57 # if force_every is a scalar it will be used on all branches, like this
58 # for legacy reasons:
59 # force_every => 336 , # max hours between builds, undef or 0 = unforced
60 # we now prefer it to be a hash with branch names as the keys, like this
61 #
62 # this setting should be kept conservatively high, or not used at all -
63 # for the most part it's best to let the script decide if something
64 # has changed that requires a new run for the branch.
65 #
66 # an entry with a name of 'default' matches any branch not named
67 force_every => {
68
69 # HEAD => 48,
70 # REL8_3_STABLE => 72,
71 # default => 168,
72 },
73
74 # alerts are triggered if the server doesn't see a build on a branch after
75 # this many hours, and then sent out every so often,
76
77 alerts => {
78
79 #HEAD => { alert_after => 72, alert_every => 24 },
80 # REL8_1_STABLE => { alert_after => 240, alert_every => 48 },
81 },
82
83 print_success => undef,
84
c458d50 @adunstan Provide default extra_config, add fsync=off in sample.
adunstan authored
85 # include / exclude pattern for files whose trigger a build
86 # if both are specified then they are both applied as filters
87 # undef means don't ignore anything.
88 # exclude qr[/(doc|po)/] to ignore changes to docs and po files (recommended)
89 # undef means null filter.
4f21839 @adunstan Use new filters in sample conf.
adunstan authored
90 trigger_exclude => qr[/(doc|po)/],
c458d50 @adunstan Provide default extra_config, add fsync=off in sample.
adunstan authored
91 trigger_include => undef,
db2ba88 @adunstan Perltidy run.
adunstan authored
92
93 # settings for mail notices - default to notifying nobody
94 # these lists contain addresses to be notified
95 # must be complete email addresses, as the email is sent from the server
96
97 mail_events =>{
98 all => [], # unconditional
99 fail => [], # if this build fails
100 change => [], # if this build causes a state change
101 green => [], # if this build causes a state change to/from OK
102 },
103
104 # env settings to apply within build/report process
105 # these settings will be seen by all the processes, including the
106 # configure process.
107
108 build_env =>{
109
110 # use a dedicated cache for the build farm. this should give us
111 # very high hit rates and slightly faster cache searching.
112
113 CCACHE_DIR => "/home/andrew/pgfarmbuild/ccache/$branch",
114
115 ### use these settings for CYGWIN
116 # CYGWIN => 'server',
117 # MAX_CONNECTIONS => '3',
118
119 ### set this if you need a proxy setting for the
120 # outbound web transaction that reports the results
121 # BF_PROXY => 'http://my.proxy.server:portnum/',
122
123 # see below for MSVC settings
124
125 },
126
127 # env settings to pass to configure. These settings will only be seen by
128 # configure.
129 config_env =>{CC => 'ccache gcc',},
130
131 # don't use --prefix or --with-pgport here
132 # they are set up by the script
133 # per-branch config can be done here or
134 # more simply by using the examples below.
135 # (default ldap flag is below because it's not supported in all branches)
136
137 # see below for MSVC config
138
139 config_opts =>[
140 qw(
141 --enable-cassert
142 --enable-debug
143 --enable-nls
144 --enable-integer-datetimes
145 --with-perl
146 --with-python
147 --with-tcl
148 --with-krb5 --with-includes=/usr/include/et
149 --with-openssl
150 )
151 ],
152
c458d50 @adunstan Provide default extra_config, add fsync=off in sample.
adunstan authored
153 # per-branch contents of extra config for check stages.
db2ba88 @adunstan Perltidy run.
adunstan authored
154 # each branch has an array of setting lines (no \n required)
c458d50 @adunstan Provide default extra_config, add fsync=off in sample.
adunstan authored
155 # a DEFAULT entry is used for all branches, before any
156 # branch-specific settings.
db2ba88 @adunstan Perltidy run.
adunstan authored
157 extra_config =>{
c458d50 @adunstan Provide default extra_config, add fsync=off in sample.
adunstan authored
158 DEFAULT => [
db2ba88 @adunstan Perltidy run.
adunstan authored
159 q(log_line_prefix = '[%c:%l] '),
160 "log_connections = 'true'",
161 "log_disconnections = 'true'",
c458d50 @adunstan Provide default extra_config, add fsync=off in sample.
adunstan authored
162 "log_statement = 'all'",
163 "fsync = off"
db2ba88 @adunstan Perltidy run.
adunstan authored
164 ],
165 },
166
167 optional_steps =>{
168
169 # which optional steps to run and when to run them
170 # valid keys are: branches, dow, min_hours_since, min_hour, max_hour
171 # find_typedefs => { branches => ['HEAD'], dow => [1,4],
172 # min_hours_since => 25 },
173 # build_docs => {min_hours_since => 24},
174 },
175
176 # locales to test
177
178 locales => [qw( C )],
179
180 # port number actually used will be based on this param and the branch,
181 # so we ensure they don't collide
182
183 base_port => 5678,
184
a96b4e4 @adunstan perltidy run
adunstan authored
185 modules => [qw(TestUpgrade)],
186
db2ba88 @adunstan Perltidy run.
adunstan authored
187 #
188 );
2cdd46a @adunstan Initial client release
adunstan authored
189
3404eda @adunstan Clean up processing for branches = ALL.
adunstan authored
190 if ($branch eq 'global')
191 {
db2ba88 @adunstan Perltidy run.
adunstan authored
192
193 # $conf{branches_to_build} = 'ALL'; # or [qw( HEAD RELx_y_STABLE etc )]
3404eda @adunstan Clean up processing for branches = ALL.
adunstan authored
194 }
89c9d15 @adunstan Beginning of support for running buildfamr with MSVC - this gets me t…
adunstan authored
195
196 # MSVC setup
197
198 if ($conf{using_msvc})
199 {
200
db2ba88 @adunstan Perltidy run.
adunstan authored
201 # all this stuff is to support MSVC builds - it's literally what
202 # a VS Command Prompt sets for me.
203 # make sure it's what your sets for you. There can be subtle differences.
204 # Note: we need to set here whatever would be set in buildenv.bat, as
205 # we aren't going to write that file. This supercedes it. In
206 # particular, the PATH possibly needs to include the path to perl, bison,
207 # flex etc., as well as CVS if that's not in the path.
208
209 my %extra_buildenv =(
210
211 VSINSTALLDIR => 'C:\Program Files\Microsoft Visual Studio 8',
212 VCINSTALLDIR => 'C:\Program Files\Microsoft Visual Studio 8\VC',
213 VS80COMNTOOLS =>
214 'C:\Program Files\Microsoft Visual Studio 8\Common7\Tools',
215 FrameworkDir => 'C:\WINDOWS\Microsoft.NET\Framework',
216 FrameworkVersion => 'v2.0.50727',
217 FrameworkSDKDir =>'C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0',
218 DevEnvDir => 'C:\Program Files\Microsoft Visual Studio 8\Common7\IDE',
219
220 PATH => join(';',
221 'C:\Program Files\Microsoft Visual Studio 8\Common7\IDE',
222 'C:\Program Files\Microsoft Visual Studio 8\VC\BIN',
223 'C:\Program Files\Microsoft Visual Studio 8\Common7\Tools',
224 'C:\Program Files\Microsoft Visual Studio 8\Common7\Tools\bin',
225 'C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\bin',
226 'C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\bin',
227 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727',
228 'C:\Program Files\Microsoft Visual Studio 8\VC\VCPackages',
229 'C:\Perl\Bin',
230 'c:\prog\pgdepend\bin',
231 $ENV{PATH}),
232 INCLUDE => join(';',
233 'C:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\INCLUDE',
234 'C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE',
235 'C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\include',
236 'C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\include',
237 $ENV{INCLUDE}),
238
239 LIB => join(';',
240 'C:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\LIB',
241 'C:\Program Files\Microsoft Visual Studio 8\VC\LIB'
242 .'C:\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\lib',
243 'C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\lib'
244 .$ENV{LIB}),
245
246 LIBPATH => join(';',
247 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727',
248 'C:\Program Files\Microsoft Visual Studio 8\VC\ATLMFC\LIB'),
249 );
250
251 %{$conf{build_env}} = (%{$conf{build_env}}, %extra_buildenv);
252
253 # MSVC needs a somewhat different style of config opts (why??)
254 # What we write here will be literally (via Data::Dumper) put into
255 # the config.pl file for the MSVC build.
256
257 $conf{config_opts} ={
258 asserts=>1, # --enable-cassert
844d4e1 @adunstan Line up comments in MSVC config section.
adunstan authored
259 integer_datetimes=>1, # --enable-integer-datetimes
260 nls=>undef, # --enable-nls=<path>
261 tcl=>'c:\tcl', # --with-tcl=<path>
262 perl=>'c:\perl', # --with-perl=<path>
263 python=>'c:\python25', # --with-python=<path>
264 krb5=> undef, # --with-krb5=<path>
db2ba88 @adunstan Perltidy run.
adunstan authored
265 ldap=>0, # --with-ldap
844d4e1 @adunstan Line up comments in MSVC config section.
adunstan authored
266 openssl=> undef, # --with-ssl=<path>
267 xml=> undef, # --with-libxml=<path>
268 xslt=> undef, # --with-libxslt=<path>,
269 iconv=> undef, # path to iconv library
270 zlib=> undef, # --with-zlib=<path>
db2ba88 @adunstan Perltidy run.
adunstan authored
271 };
272
273 }
89c9d15 @adunstan Beginning of support for running buildfamr with MSVC - this gets me t…
adunstan authored
274
1bdfe9f @adunstan . allow per-branch config
adunstan authored
275 ##################################
276 #
1493695 @adunstan add --with-ldap to distributed config flags.
adunstan authored
277 # examples of per branch processing
1bdfe9f @adunstan . allow per-branch config
adunstan authored
278 # tailor as required for your site.
279 #
280 ##################################
281
1493695 @adunstan add --with-ldap to distributed config flags.
adunstan authored
282 # ldap support is new as of 8.2
283 if ($branch eq 'HEAD' || $branch ge 'REL8_2')
284 {
89c9d15 @adunstan Beginning of support for running buildfamr with MSVC - this gets me t…
adunstan authored
285
db2ba88 @adunstan Perltidy run.
adunstan authored
286 # msvc can set it up separately - see above
287
288 push(@{$conf{config_opts}},"--with-ldap")
289 unless $conf{using_msvc};
1493695 @adunstan add --with-ldap to distributed config flags.
adunstan authored
290 }
291
2cb2340 @adunstan improve defaults and bring up to date
adunstan authored
292 # libxml/libxslt support as of 8.3
715fd53 @adunstan Add support for integer datetimes on MSVC and --with-libxml in releva…
adunstan authored
293 if ($branch eq 'HEAD' || $branch ge 'REL8_3')
294 {
295
db2ba88 @adunstan Perltidy run.
adunstan authored
296 # msvc can set it up separately - see above
715fd53 @adunstan Add support for integer datetimes on MSVC and --with-libxml in releva…
adunstan authored
297
db2ba88 @adunstan Perltidy run.
adunstan authored
298 push(@{$conf{config_opts}},"--with-libxml", "--with-libxslt")
299 unless $conf{using_msvc};
300 }
1493695 @adunstan add --with-ldap to distributed config flags.
adunstan authored
301
1bdfe9f @adunstan . allow per-branch config
adunstan authored
302 if ($branch eq 'HEAD')
303 {
db2ba88 @adunstan Perltidy run.
adunstan authored
304
305 # push(@{$conf{config_opts}},"--enable-depend");
1bdfe9f @adunstan . allow per-branch config
adunstan authored
306 }
307 elsif ($branch =~ /^REL7_/)
308 {
309
db2ba88 @adunstan Perltidy run.
adunstan authored
310 # push(@{$conf{config_opts}},"--without-tk");
311 }
1bdfe9f @adunstan . allow per-branch config
adunstan authored
312
2cdd46a @adunstan Initial client release
adunstan authored
313 1;
Something went wrong with that request. Please try again.