Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: slave/skia_slave_scripts/detect_static_initializers.py

Issue 648353002: Remove Skia's forked buildbot code (Closed) Base URL: https://skia.googlesource.com/buildbot.git@master
Patch Set: Address comment Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « slave/skia_slave_scripts/compile.py ('k') | slave/skia_slave_scripts/do_auto_roll.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: slave/skia_slave_scripts/detect_static_initializers.py
diff --git a/slave/skia_slave_scripts/detect_static_initializers.py b/slave/skia_slave_scripts/detect_static_initializers.py
deleted file mode 100644
index 576dd6177a1d1f9117c6d8cb8da34589531c24d6..0000000000000000000000000000000000000000
--- a/slave/skia_slave_scripts/detect_static_initializers.py
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-""" Detect static initializers in compiled Skia code. """
-
-from build_step import BuildStep, BuildStepWarning
-from py.utils import shell_utils
-import os
-import re
-import sys
-import urllib2
-
-
-DUMP_STATIC_INITIALIZERS_FILENAME = 'dump-static-initializers.py'
-DUMP_STATIC_INITIALIZERS_URL = ('http://src.chromium.org/svn/trunk/src/tools/'
- + 'linux/' + DUMP_STATIC_INITIALIZERS_FILENAME)
-
-
-class DetectStaticInitializers(BuildStep):
- def _Run(self):
- # Build the Skia libraries in Release mode.
- os.environ['GYP_DEFINES'] = 'skia_static_initializers=0'
- shell_utils.run(['python', 'gyp_skia'])
- shell_utils.run(['make', 'skia_lib', 'BUILDTYPE=Release', '--jobs'])
-
- # Obtain the dump-static-initializers script.
- print 'Downloading %s' % DUMP_STATIC_INITIALIZERS_URL
- dl = urllib2.urlopen(DUMP_STATIC_INITIALIZERS_URL)
- with open(DUMP_STATIC_INITIALIZERS_FILENAME, 'wb') as f:
- f.write(dl.read())
-
- # Run the script over the compiled files.
- results = []
- for built_file_name in os.listdir(os.path.join('out', 'Release')):
- if built_file_name.endswith('.a') or built_file_name.endswith('.so'):
- output = shell_utils.run(['python', DUMP_STATIC_INITIALIZERS_FILENAME,
- os.path.join('out', 'Release',
- built_file_name)])
- matches = re.search('Found (\d+) static initializers', output)
- if matches:
- num_found = int(matches.groups()[0])
- if num_found:
- results.append((built_file_name, num_found))
- if results:
- print
- print 'Found static initializers:'
- print
- for result in results:
- print ' %s: %d' % result
- print
- # TODO(borenet): Make this an error once we have no static initializers.
- raise BuildStepWarning('Static initializers found!')
-
-
-if '__main__' == __name__:
- sys.exit(BuildStep.RunBuildStep(DetectStaticInitializers))
« no previous file with comments | « slave/skia_slave_scripts/compile.py ('k') | slave/skia_slave_scripts/do_auto_roll.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698