Skip to content

Commit

Permalink
attempt to work around assert in server2 code
Browse files Browse the repository at this point in the history
  • Loading branch information
darwin committed Feb 24, 2017
1 parent 3bb883e commit 4724775
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tools/build-cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

CHROMIUM_SRC=${CHROMIUM_SRC:?"Please set CHROMIUM_SRC env var pointing to your chrome/src checkout directory"}

echo "chromium src dir: ${CHROMIUM_SRC}"

set -e

pushd () {
Expand Down Expand Up @@ -29,8 +31,16 @@ if [ ! -d "$WORKDIR" ] ; then
mkdir -p "$WORKDIR"
fi

# a hack around some asserts in update_cache.py, not sure what went wrong and why they don't fix it
pushd .
cd "${CHROMIUM_SRC}"
git reset --hard HEAD
git clean -fd
git apply "${TOOLS}/chromium.patch"
popd

pushd .
cd "${CHROMIUM_SRC}chrome/common/extensions/docs/server2"
cd "${SERVER2_DIR}"

# without this bootstrapping subsequent update_cache.py would fail
# with 'ImportError: No module named third_party.json_schema_compiler.memoize'
Expand All @@ -47,4 +57,6 @@ cd "${CHROMIUM_SRC}"
SHA=`git rev-parse HEAD`
echo "$SHA" > "$APIS_LAST_FILE"

git reset --hard HEAD

popd
12 changes: 12 additions & 0 deletions tools/chromium.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/chrome/common/extensions/docs/server2/api_schema_graph.py b/chrome/common/extensions/docs/server2/api_schema_graph.py
index 0c90ba1d9afa..53e36f4ed241 100644
--- a/chrome/common/extensions/docs/server2/api_schema_graph.py
+++ b/chrome/common/extensions/docs/server2/api_schema_graph.py
@@ -80,7 +80,6 @@ class APINodeCursor(object):
if self._lookup_path[-1] == 'callback':
# This is an event callback, so lookup_path[-2] is the event
# node name, thus lookup_path[-3] must be 'events'.
- assert self._lookup_path[-3] == 'events'
return self._lookup_path[:-1]
# This is a function parameter.
assert self._lookup_path[-2] == 'parameters'

0 comments on commit 4724775

Please sign in to comment.