OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
6 | 6 |
7 import os | |
7 import os.path | 8 import os.path |
8 import shutil | 9 import shutil |
9 import sys | 10 import sys |
10 import subprocess | 11 import subprocess |
11 | 12 |
12 import bot | 13 import bot |
13 import bot_utils | 14 import bot_utils |
14 | 15 |
15 utils = bot_utils.GetUtils() | 16 utils = bot_utils.GetUtils() |
16 | 17 |
17 BUILD_OS = utils.GuessOS() | 18 BUILD_OS = utils.GuessOS() |
18 | 19 |
19 (bot_name, _) = bot.GetBotName() | 20 (bot_name, _) = bot.GetBotName() |
20 CHANNEL = bot_utils.GetChannelFromName(bot_name) | 21 CHANNEL = bot_utils.GetChannelFromName(bot_name) |
21 | 22 |
22 def BuildSDK(): | 23 def BuildSDK(): |
23 with bot.BuildStep('Build SDK'): | 24 with bot.BuildStep('Build SDK'): |
25 sysroot_env = dict(os.environ) | |
26 ia32root = os.path.join(bot_utils.DART_DIR, 'sysroots', 'build', 'linux', | |
27 'debian_wheezy_i386-sysroot') | |
28 sysroot_env['CXXFLAGS'] = ("--sysroot=%s -I=/usr/include/c++/4.6 " | |
29 "-I=/usr/include/c++/4.6/i486-linux-gnu") % ia32root | |
30 sysroot_env['LDFLAGS'] = '--sysroot=%s' % ia32root | |
31 sysroot_env['CFLAGS'] = '--sysroot=%s' % ia32root | |
24 Run([sys.executable, './tools/build.py', '--mode=release', | 32 Run([sys.executable, './tools/build.py', '--mode=release', |
25 '--arch=ia32,x64', 'create_sdk']) | 33 '--arch=ia32', 'create_sdk'], env=sysroot) |
Bill Hesse
2016/08/10 15:34:06
This should have been env=sysroot_env
| |
34 | |
35 x64root = os.path.join(bot_utils.DART_DIR, 'sysroots', 'build', 'linux', | |
36 'debian_wheezy_amd64-sysroot') | |
37 sysroot_env['CXXFLAGS'] = ("--sysroot=%s -I=/usr/include/c++/4.6 " | |
38 "-I=/usr/include/c++/4.6/x86_64-linux-gnu") % x64root | |
39 sysroot_env['LDFLAGS'] = '--sysroot=%s' % x64root | |
40 sysroot_env['CFLAGS'] = '--sysroot=%s' % x64root | |
41 Run([sys.executable, './tools/build.py', '--mode=release', | |
42 '--arch=x64', 'create_sdk'], env=sysroot) | |
26 | 43 |
27 def BuildDartdocAPIDocs(dirname): | 44 def BuildDartdocAPIDocs(dirname): |
28 dart_sdk = os.path.join(bot_utils.DART_DIR, | 45 dart_sdk = os.path.join(bot_utils.DART_DIR, |
29 utils.GetBuildRoot(BUILD_OS, 'release', 'ia32'), | 46 utils.GetBuildRoot(BUILD_OS, 'release', 'ia32'), |
30 'dart-sdk') | 47 'dart-sdk') |
31 dart_exe = os.path.join(dart_sdk, 'bin', 'dart') | 48 dart_exe = os.path.join(dart_sdk, 'bin', 'dart') |
32 dartdoc_dart = os.path.join(bot_utils.DART_DIR, | 49 dartdoc_dart = os.path.join(bot_utils.DART_DIR, |
33 'third_party', 'pkg' , 'dartdoc' , 'bin' , | 50 'third_party', 'pkg' , 'dartdoc' , 'bin' , |
34 'dartdoc.dart') | 51 'dartdoc.dart') |
35 packages_dir = os.path.join(bot_utils.DART_DIR, | 52 packages_dir = os.path.join(bot_utils.DART_DIR, |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
207 assert '/' in remote_path and not remote_path.endswith('/') | 224 assert '/' in remote_path and not remote_path.endswith('/') |
208 | 225 |
209 mangled_filename = remote_path[remote_path.rfind('/') + 1:] | 226 mangled_filename = remote_path[remote_path.rfind('/') + 1:] |
210 local_md5sum = bot_utils.CreateMD5ChecksumFile(local_path, | 227 local_md5sum = bot_utils.CreateMD5ChecksumFile(local_path, |
211 mangled_filename) | 228 mangled_filename) |
212 gsutil.upload(local_md5sum, remote_path + '.md5sum', public=True) | 229 gsutil.upload(local_md5sum, remote_path + '.md5sum', public=True) |
213 local_sha256 = bot_utils.CreateSha256ChecksumFile(local_path, | 230 local_sha256 = bot_utils.CreateSha256ChecksumFile(local_path, |
214 mangled_filename) | 231 mangled_filename) |
215 gsutil.upload(local_sha256, remote_path + '.sha256sum', public=True) | 232 gsutil.upload(local_sha256, remote_path + '.sha256sum', public=True) |
216 | 233 |
217 def Run(command): | 234 def Run(command, env=None): |
218 print "Running %s" % ' '.join(command) | 235 print "Running %s" % ' '.join(command) |
219 return bot.RunProcess(command) | 236 return bot.RunProcess(command, env=env) |
220 | 237 |
221 if __name__ == '__main__': | 238 if __name__ == '__main__': |
222 # We always clobber the bot, to make sure releases are build from scratch | 239 # We always clobber the bot, to make sure releases are build from scratch |
223 force = CHANNEL != bot_utils.Channel.BLEEDING_EDGE | 240 force = CHANNEL != bot_utils.Channel.BLEEDING_EDGE |
224 bot.Clobber(force=force) | 241 bot.Clobber(force=force) |
225 | 242 |
226 CreateUploadSDK() | 243 CreateUploadSDK() |
227 if BUILD_OS == 'linux': | 244 if BUILD_OS == 'linux': |
228 CreateUploadVersionFile() | 245 CreateUploadVersionFile() |
229 CreateUploadAPIDocs() | 246 CreateUploadAPIDocs() |
OLD | NEW |