~brian-sidebotham/wxwidgets-cmake/wxpython-2.9.4

« back to all changes in this revision

Viewing changes to wxPython/distrib/all/build-all

  • Committer: Brian Sidebotham
  • Date: 2013-08-03 14:30:08 UTC
  • Revision ID: brian.sidebotham@gmail.com-20130803143008-c7806tkych1tp6fc
Initial import into Bazaar

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python -u
 
2
#----------------------------------------------------------------------
 
3
# Name:        build-all.py
 
4
# Purpose:     Master build script for building all the wxPython
 
5
#              installers and such on all the build machines in
 
6
#              my lab, and then distributing the results as needed.
 
7
#
 
8
#              This will replace the build-all bash script and is
 
9
#              needed because the needs of the build have outgrown
 
10
#              what I can do with bash.
 
11
#
 
12
# Author:      Robin Dunn
 
13
#
 
14
# Created:     05-Nov-2004
 
15
# RCS-ID:      $Id: build-all 72053 2012-07-12 20:24:04Z RD $
 
16
# Copyright:   (c) 2004 by Total Control Software
 
17
# Licence:     wxWindows license
 
18
#----------------------------------------------------------------------
 
19
 
 
20
import sys
 
21
import os
 
22
import time
 
23
from taskrunner import Job, Task, TaskRunner, Config
 
24
 
 
25
#----------------------------------------------------------------------
 
26
# Configuration items
 
27
 
 
28
CFGFILE = "./distrib/all/build-environ.cfg"
 
29
config = Config()
 
30
config.read(CFGFILE)
 
31
 
 
32
#----------------------------------------------------------------------
 
33
# Define all the build tasks
 
34
 
 
35
class Job(Job):
 
36
    LOGBASE = "./tmp"
 
37
 
 
38
#----------------------------------------------------------------------
 
39
 
 
40
def getTasks(config_env):
 
41
    # Things that need to be done before any of the builds
 
42
    initialTask = Task([
 
43
        Job("", "distrib/all/build-setup", env=config_env),
 
44
        Job("", "distrib/all/build-docs", env=config_env),
 
45
        Job("", "distrib/all/build-sources", env=config_env),
 
46
        ])
 
47
    
 
48
    # Build tasks.  Anything that can be done in parallel (depends greatly
 
49
    # on the nature of the build machines configurations...) is a separate
 
50
    # task.
 
51
    
 
52
 
 
53
    carbonTask =  Task([
 
54
        Job("carbon.26", "distrib/all/build-osx", [config.OSX_HOST_carbon, "2.6", "carbon"], env=config_env),
 
55
        Job("carbon.27", "distrib/all/build-osx", [config.OSX_HOST_carbon, "2.7", "carbon"], env=config_env),
 
56
        ])
 
57
 
 
58
    cocoaTask =  Task([
 
59
        Job("cocoa.27", "distrib/all/build-osx", [config.OSX_HOST_cocoa, "2.7", "cocoa"], env=config_env),
 
60
        ])
 
61
 
 
62
    
 
63
    cyclopsTask0 = Task([
 
64
        Job("win32-26", "distrib/all/build-windows", ["2.6"], env=config_env),
 
65
        Job("win32-27", "distrib/all/build-windows", ["2.7"], env=config_env),
 
66
        Job("win64-26", "distrib/all/build-windows", ["2.6", "X64"], env=config_env),
 
67
        Job("win64-27", "distrib/all/build-windows", ["2.7", "X64"], env=config_env),
 
68
        ])
 
69
    
 
70
 
 
71
    cyclopsTask1 = Task([
 
72
        Job("lucid",   "distrib/all/build-deb", ["cy-ubuntu-opd", "/work/chroot/lucid",   "lucid"], env=config_env),
 
73
        Job("lucid64", "distrib/all/build-deb", ["cy-ubuntu-opd", "/work/chroot/lucid64", "lucid64"], env=config_env),
 
74
        Job("maverick",   "distrib/all/build-deb", ["cy-ubuntu-opd", "/work/chroot/maverick",   "maverick"], env=config_env),
 
75
        Job("maverick64", "distrib/all/build-deb", ["cy-ubuntu-opd", "/work/chroot/maverick64", "maverick64"], env=config_env),
 
76
        ])
 
77
 
 
78
    cyclopsTask2 = Task([
 
79
        # 64-bit builds are now handled w/o a VM, see above
 
80
        #Job("win64-26", "distrib/all/build-vmwin", ["cyclops", "WinXP-x64-1", "cy-win64", "2.6", "X64"], env=config_env),
 
81
        #Job("win64-27", "distrib/all/build-vmwin", ["cyclops", "WinXP-x64-1", "cy-win64", "2.7", "X64"], env=config_env),
 
82
        ])
 
83
 
 
84
    cyclopsTask3 = Task([
 
85
        Job("etch",   "distrib/all/build-deb", ["cy-ubuntu-opd", "/work/chroot/etch",     "etch"], env=config_env),
 
86
        Job("etch64", "distrib/all/build-deb", ["cy-ubuntu-opd", "/work/chroot/etch64",   "etch64"], env=config_env),
 
87
        Job("lenny",   "distrib/all/build-deb", ["cy-ubuntu-opd", "/work/chroot/lenny",   "lenny"], env=config_env),
 
88
        Job("lenny64", "distrib/all/build-deb", ["cy-ubuntu-opd", "/work/chroot/lenny64", "lenny64"], env=config_env),
 
89
        ])
 
90
    
 
91
    buildTasks = [ carbonTask,
 
92
                   cocoaTask,
 
93
                   cyclopsTask0,
 
94
                   #cyclopsTask1,
 
95
                   ##cyclopsTask2,
 
96
                   #cyclopsTask3,
 
97
                   ]
 
98
    
 
99
    # Finalization.  This is for things that must wait until all the
 
100
    # builds are done, such as copying the installers someplace, sending
 
101
    # emails, etc.
 
102
    finalizationTask = Task( Job("", "distrib/all/build-finalize", env=config_env) )
 
103
 
 
104
    return initialTask, buildTasks, finalizationTask
 
105
 
 
106
 
 
107
#----------------------------------------------------------------------
 
108
 
 
109
def usage():
 
110
    print ""
 
111
    print "Usage: build-all [command flags...]"
 
112
    print ""
 
113
    print "build types:"
 
114
    print "   dryrun       Do the build, but don't copy anywhere (default)"
 
115
    print "   daily        Do a daily build, copy to starship"
 
116
    print "   release      Do a normal release (cantidate) build, copy to starship"
 
117
    print ""
 
118
    print "optional command flags:"
 
119
    print "   skipsource   Don't build the source archives, use the ones"
 
120
    print "                already in the staging dir."
 
121
    print "   onlysource   Exit after building the source and docs archives"
 
122
    print "   skipdocs     Don't rebuild the docs"
 
123
    print "   skipwin      Don't do the remote Windows build"
 
124
    print "   skiposx      Don't do the remote OSX build"
 
125
    print "   skiprpm      Don't do the remote Linux (RPM) build"
 
126
    print "   skipdeb      Don't do the remote Linux (DEB) build"
 
127
    print "   skipclean    Don't do the cleanup step on the remote builds"
 
128
    print "   skipupload   Don't upload the builds to starship"
 
129
    print ""
 
130
    print "   nocohost     Don't start the coLinux sessions if they are"
 
131
    print "                not already online"
 
132
    print ""
 
133
    
 
134
 
 
135
#----------------------------------------------------------------------
 
136
 
 
137
def main(args):
 
138
    # Make sure we are running in the right directory.  TODO: make
 
139
    # this test more robust.  Currenly we just test for the presence
 
140
    # of 'wxPython' and 'wx' subdirs.
 
141
    if not os.path.isdir("distrib") or not os.path.isdir("wx"):
 
142
        print "Please run this script from the root wxPython directory."
 
143
        sys.exit(1)
 
144
        
 
145
    
 
146
 
 
147
    # Check command line flags
 
148
    for flag in args:
 
149
        if flag in ["dryrun", "daily", "release"]:
 
150
            config.KIND = flag
 
151
 
 
152
        elif flag == "skipsource":
 
153
            config.skipsource = "yes"
 
154
            
 
155
        elif flag == "onlysource":
 
156
            config.onlysource = "yes"
 
157
            
 
158
        elif flag == "skipdocs":
 
159
            config.skipdocs = "yes"
 
160
            
 
161
        elif flag == "skipnewdocs":
 
162
            config.skipnewdocs = "yes"
 
163
            
 
164
        elif flag == "skipwin":
 
165
            config.skipwin = "yes"
 
166
            
 
167
        elif flag == "skiposx":
 
168
            config.skiposx = "yes"
 
169
            
 
170
        elif flag == "skipdeb":
 
171
            config.skipdeb = "yes"
 
172
            
 
173
        elif flag == "skiprpm":
 
174
            config.skiprpm = "yes"
 
175
            
 
176
        elif flag == "skipclean":
 
177
            config.skipclean = "yes"
 
178
            
 
179
        elif flag == "skipupload":
 
180
            config.skipupload = "yes"
 
181
 
 
182
        elif flag == "nocohost":
 
183
            config.startcohost = "no"
 
184
            
 
185
        else:
 
186
            print 'Unknown flag: "%s"' % flag
 
187
            usage()
 
188
            sys.exit(2)
 
189
 
 
190
 
 
191
    # ensure the staging area exists
 
192
    if not os.path.exists(config.STAGING_DIR):
 
193
        os.makedirs(config.STAGING_DIR)
 
194
 
 
195
    # Figure out the wxPython version number, possibly adjusted for being a daily build
 
196
    if config.KIND == "daily":
 
197
        t = time.localtime()
 
198
        config.DAILY = time.strftime("%Y%m%d")   # should it include the hour too?  2-digit year?
 
199
        file("DAILY_BUILD", "w").write(config.DAILY)
 
200
    sys.path.append('.')
 
201
    import setup
 
202
    v = config.VERSION = setup.VERSION
 
203
    config.VER2 = '.'.join(v.split('.')[:2])
 
204
 
 
205
    config_env = config.asDict()
 
206
    config_env.update(os.environ)
 
207
 
 
208
    initialTask, buildTasks, finalizationTask = getTasks(config_env)
 
209
 
 
210
    print "Build getting started at: ", time.ctime()
 
211
 
 
212
    # Run the first task, which will create the docs and sources tarballs
 
213
    tr = TaskRunner(initialTask)
 
214
    rc = tr.run()
 
215
 
 
216
    # cleanup the DAILY_BUILD file
 
217
    if config.KIND == "daily":
 
218
        os.unlink("DAILY_BUILD")
 
219
 
 
220
    # Quit now?
 
221
    if rc != 0 or config.onlysource == "yes":
 
222
        sys.exit(rc)
 
223
 
 
224
 
 
225
    # Run the main build tasks
 
226
    tr = TaskRunner(buildTasks)
 
227
    rc = tr.run()
 
228
    if rc != 0:
 
229
        sys.exit(rc)
 
230
 
 
231
 
 
232
    # when all the builds are done, run the finalization task
 
233
    tr = TaskRunner(finalizationTask)
 
234
    rc = tr.run()
 
235
    if rc != 0:
 
236
        sys.exit(rc)
 
237
 
 
238
    
 
239
    print "Build finished at: ", time.ctime()
 
240
    sys.exit(0)
 
241
 
 
242
 
 
243
 
 
244
 
 
245
if __name__ == "__main__":
 
246
    main(sys.argv[1:])