OLD | NEW |
---|---|
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Entry point for both build and try bots. | 6 """Entry point for both build and try bots. |
7 | 7 |
8 This script is invoked from XXX, usually without arguments | 8 This script is invoked from XXX, usually without arguments |
9 to package an SDK. It automatically determines whether | 9 to package an SDK. It automatically determines whether |
10 this SDK is for mac, win, linux. | 10 this SDK is for mac, win, linux. |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
179 readme_text = readme_text.replace('${NACL_REVISION}', nacl_revision) | 179 readme_text = readme_text.replace('${NACL_REVISION}', nacl_revision) |
180 | 180 |
181 # Year/Month/Day Hour:Minute:Second | 181 # Year/Month/Day Hour:Minute:Second |
182 time_format = '%Y/%m/%d %H:%M:%S' | 182 time_format = '%Y/%m/%d %H:%M:%S' |
183 readme_text = readme_text.replace('${DATE}', | 183 readme_text = readme_text.replace('${DATE}', |
184 datetime.datetime.now().strftime(time_format)) | 184 datetime.datetime.now().strftime(time_format)) |
185 | 185 |
186 open(os.path.join(pepperdir, 'README'), 'w').write(readme_text) | 186 open(os.path.join(pepperdir, 'README'), 'w').write(readme_text) |
187 | 187 |
188 | 188 |
189 def PrunePNaClToolchain(root): | |
190 dirs_to_prune = [ | |
191 'newlib/lib-bc-x86-64', | |
192 'newlib/usr-bc-x86-64' | |
193 # TODO(sbc): remove this once its really not needed. | |
194 # Currently we seem to rely on it at least for <bits/stat.h> | |
eliben
2013/08/10 00:49:08
Hmm, this is weird :-/
| |
195 #'newlib/sysroot', | |
196 ] | |
197 for dirname in dirs_to_prune: | |
198 buildbot_common.RemoveDir(os.path.join(root, dirname)) | |
199 | |
200 | |
189 def BuildStepUntarToolchains(pepperdir, arch, toolchains): | 201 def BuildStepUntarToolchains(pepperdir, arch, toolchains): |
190 buildbot_common.BuildStep('Untar Toolchains') | 202 buildbot_common.BuildStep('Untar Toolchains') |
191 platform = getos.GetPlatform() | 203 platform = getos.GetPlatform() |
192 tcname = platform + '_' + arch | 204 tcname = platform + '_' + arch |
193 tmpdir = os.path.join(OUT_DIR, 'tc_temp') | 205 tmpdir = os.path.join(OUT_DIR, 'tc_temp') |
194 buildbot_common.RemoveDir(tmpdir) | 206 buildbot_common.RemoveDir(tmpdir) |
195 buildbot_common.MakeDir(tmpdir) | 207 buildbot_common.MakeDir(tmpdir) |
196 | 208 |
197 if 'newlib' in toolchains: | 209 if 'newlib' in toolchains: |
198 # Untar the newlib toolchains | 210 # Untar the newlib toolchains |
(...skipping 30 matching lines...) Expand all Loading... | |
229 tmpdir = os.path.join(tmpdir, 'pnacl') | 241 tmpdir = os.path.join(tmpdir, 'pnacl') |
230 buildbot_common.RemoveDir(tmpdir) | 242 buildbot_common.RemoveDir(tmpdir) |
231 buildbot_common.MakeDir(tmpdir) | 243 buildbot_common.MakeDir(tmpdir) |
232 tarfile = GetPNaClToolchain(arch) | 244 tarfile = GetPNaClToolchain(arch) |
233 buildbot_common.Run([sys.executable, CYGTAR, '-C', tmpdir, '-xf', tarfile], | 245 buildbot_common.Run([sys.executable, CYGTAR, '-C', tmpdir, '-xf', tarfile], |
234 cwd=NACL_DIR) | 246 cwd=NACL_DIR) |
235 | 247 |
236 # Then rename/move it to the pepper toolchain directory | 248 # Then rename/move it to the pepper toolchain directory |
237 pnacldir = os.path.join(pepperdir, 'toolchain', tcname + '_pnacl') | 249 pnacldir = os.path.join(pepperdir, 'toolchain', tcname + '_pnacl') |
238 buildbot_common.Move(tmpdir, pnacldir) | 250 buildbot_common.Move(tmpdir, pnacldir) |
251 PrunePNaClToolchain(pnacldir) | |
239 | 252 |
240 buildbot_common.RemoveDir(tmpdir) | 253 buildbot_common.RemoveDir(tmpdir) |
241 | 254 |
242 if options.gyp and platform != 'win': | 255 if options.gyp and platform != 'win': |
243 # If the gyp options is specified we install a toolchain | 256 # If the gyp options is specified we install a toolchain |
244 # wrapper so that gyp can switch toolchains via a commandline | 257 # wrapper so that gyp can switch toolchains via a commandline |
245 # option. | 258 # option. |
246 bindir = os.path.join(pepperdir, 'toolchain', tcname, 'bin') | 259 bindir = os.path.join(pepperdir, 'toolchain', tcname, 'bin') |
247 wrapper = os.path.join(SDK_SRC_DIR, 'tools', 'compiler-wrapper.py') | 260 wrapper = os.path.join(SDK_SRC_DIR, 'tools', 'compiler-wrapper.py') |
248 buildbot_common.MakeDir(bindir) | 261 buildbot_common.MakeDir(bindir) |
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
938 BuildStepArchiveSDKTools() | 951 BuildStepArchiveSDKTools() |
939 | 952 |
940 return 0 | 953 return 0 |
941 | 954 |
942 | 955 |
943 if __name__ == '__main__': | 956 if __name__ == '__main__': |
944 try: | 957 try: |
945 sys.exit(main(sys.argv)) | 958 sys.exit(main(sys.argv)) |
946 except KeyboardInterrupt: | 959 except KeyboardInterrupt: |
947 buildbot_common.ErrorExit('build_sdk: interrupted') | 960 buildbot_common.ErrorExit('build_sdk: interrupted') |
OLD | NEW |