Skip to content

Commit 1cc4cec

Browse files
author
vandebo@chromium.org
committed
Revert 166085 - Selective build clobbering feature (landmines.py and android build scripts).
It looks like this made win extract_build fail. Adds the ability for devs/troopers/etc. to set 'landmines' in the tree so that the build will selectively clobber when a builder moves over a revision with such a change. This cl has an basis landmines.py, and hooks the clobber mechanism to the android build scripts. The relevant cl which implements this for compile.py is here: https://chromiumcodereview.appspot.com/11234013/ I'm planning to also implement an informational invocation for gclient to let devs know about any potential landmines so they can decide if they need to clobber. R=cmp,maruel@chromium.org BUG=121897 Review URL: https://chromiumcodereview.appspot.com/11175016 TBR=iannucci@chromium.org Review URL: https://codereview.chromium.org/11293111 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166105 0039d316-1c4b-4281-b951-d872f2087c98
1 parent 96efe1c commit 1cc4cec

File tree

5 files changed

+50
-294
lines changed

5 files changed

+50
-294
lines changed

DEPS

-5
Original file line numberDiff line numberDiff line change
@@ -631,9 +631,4 @@ hooks = [
631631
"pattern": ".",
632632
"action": ["python", "src/build/gyp_chromium"],
633633
},
634-
{
635-
# Check for landmines (reasons to clobber the build).
636-
"pattern": ".",
637-
"action": ["python", "src/build/landmines.py"],
638-
},
639634
]

build/android/buildbot/buildbot_functions.sh

+16-31
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ function bb_baseline_setup {
4747
shift
4848
cd $SRC_ROOT
4949

50+
if [[ $BUILDBOT_CLOBBER ]]; then
51+
echo "@@@BUILD_STEP Clobber@@@"
52+
# Sdk key expires, delete android folder.
53+
# crbug.com/145860
54+
rm -rf ~/.android
55+
rm -rf "${SRC_ROOT}"/out
56+
if [ -e "${SRC_ROOT}"/out ] ; then
57+
echo "Clobber appeared to fail? ${SRC_ROOT}/out still exists."
58+
echo "@@@STEP_WARNINGS@@@"
59+
fi
60+
fi
61+
5062
echo "@@@BUILD_STEP Environment setup@@@"
5163
bb_parse_args "$@"
5264

@@ -56,44 +68,17 @@ function bb_baseline_setup {
5668
fi
5769
export GOMA_DIR=/b/build/goma
5870
. build/android/envsetup.sh
71+
adb kill-server
72+
adb start-server
73+
}
5974

75+
function bb_compile_setup {
6076
local extra_gyp_defines="$(bb_get_json_prop "$FACTORY_PROPERTIES" \
6177
extra_gyp_defines)"
6278
export GYP_DEFINES+=" fastbuild=1 $extra_gyp_defines"
6379
if echo $extra_gyp_defines | grep -q clang; then
6480
unset CXX_target
6581
fi
66-
67-
adb kill-server
68-
adb start-server
69-
70-
local build_path="${SRC_ROOT}/out/${BUILDTYPE}"
71-
local landmines_triggered_path="$build_path/.landmines_triggered"
72-
python "$SRC_ROOT/build/landmines.py"
73-
74-
if [[ $BUILDBOT_CLOBBER || -f "$landmines_triggered_path" ]]; then
75-
echo "@@@BUILD_STEP Clobber@@@"
76-
77-
if [[ -z $BUILDBOT_CLOBBER ]]; then
78-
echo "Clobbering due to triggered landmines: "
79-
cat "$landmines_triggered_path"
80-
else
81-
# Also remove all the files under out/ on an explicit clobber
82-
find "${SRC_ROOT}/out" -maxdepth 1 -type f -exec rm -f {} +
83-
fi
84-
85-
# Sdk key expires, delete android folder.
86-
# crbug.com/145860
87-
rm -rf ~/.android
88-
rm -rf "$build_path"
89-
if [[ -e $build_path ]] ; then
90-
echo "Clobber appeared to fail? $build_path still exists."
91-
echo "@@@STEP_WARNINGS@@@"
92-
fi
93-
fi
94-
}
95-
96-
function bb_compile_setup {
9782
bb_setup_goma_internal
9883
# Should be called only after envsetup is done.
9984
gclient runhooks

build/gyp_chromium

+34-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
# is invoked by Chromium beyond what can be done in the gclient hooks.
99

1010
import glob
11-
import gyp_helper
1211
import os
1312
import shlex
1413
import subprocess
@@ -45,6 +44,36 @@ if sys.platform == 'win32':
4544
else:
4645
psyco = None
4746

47+
def apply_gyp_environment(file_path=None):
48+
"""
49+
Reads in a *.gyp_env file and applies the valid keys to os.environ.
50+
"""
51+
if not file_path or not os.path.exists(file_path):
52+
return
53+
file_contents = open(file_path).read()
54+
try:
55+
file_data = eval(file_contents, {'__builtins__': None}, None)
56+
except SyntaxError, e:
57+
e.filename = os.path.abspath(file_path)
58+
raise
59+
supported_vars = ( 'CC',
60+
'CHROMIUM_GYP_FILE',
61+
'CHROMIUM_GYP_SYNTAX_CHECK',
62+
'CXX',
63+
'GYP_DEFINES',
64+
'GYP_GENERATOR_FLAGS',
65+
'GYP_GENERATOR_OUTPUT',
66+
'GYP_GENERATORS', )
67+
for var in supported_vars:
68+
val = file_data.get(var)
69+
if val:
70+
if var in os.environ:
71+
print 'INFO: Environment value for "%s" overrides value in %s.' % (
72+
var, os.path.abspath(file_path)
73+
)
74+
else:
75+
os.environ[var] = val
76+
4877
def additional_include_files(args=[]):
4978
"""
5079
Returns a list of additional (.gypi) files to include, without
@@ -95,7 +124,10 @@ if __name__ == '__main__':
95124
p.communicate()
96125
sys.exit(p.returncode)
97126

98-
gyp_helper.apply_chromium_gyp_env()
127+
if 'SKIP_CHROMIUM_GYP_ENV' not in os.environ:
128+
# Update the environment based on chromium.gyp_env
129+
gyp_env_path = os.path.join(os.path.dirname(chrome_src), 'chromium.gyp_env')
130+
apply_gyp_environment(gyp_env_path)
99131

100132
# This could give false positives since it doesn't actually do real option
101133
# parsing. Oh well.

build/gyp_helper.py

-48
This file was deleted.

build/landmines.py

-208
This file was deleted.

0 commit comments

Comments
 (0)