| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 73fe9d2 commit f419ba7
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,6 +25,7 @@ on: | |||
| 25 | 25 | - gyp-next | |
| 26 | 26 | - histogram | |
| 27 | 27 | - icu | |
| 28 | + - inspector_protocol | ||
| 28 | 29 | - libuv | |
| 29 | 30 | - llhttp | |
| 30 | 31 | - minimatch | |
@@ -149,6 +150,14 @@ jobs: | |||
| 149 | 150 | cat temp-output | |
| 150 | 151 | tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true | |
| 151 | 152 | rm temp-output | |
| 153 | + - id: inspector_protocol | ||
| 154 | + subsystem: deps | ||
| 155 | + label: dependencies, inspector | ||
| 156 | + run: | | ||
| 157 | + ./tools/dep_updaters/update-inspector-protocol.sh > temp-output | ||
| 158 | + cat temp-output | ||
| 159 | + tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true | ||
| 160 | + rm temp-output | ||
| 152 | 161 | - id: libuv | |
| 153 | 162 | subsystem: deps | |
| 154 | 163 | label: dependencies | |
@@ -276,7 +285,9 @@ jobs: | |||
| 276 | 285 | with: | |
| 277 | 286 | persist-credentials: false | |
| 278 | 287 | - name: Set up Python ${{ env.PYTHON_VERSION }} | |
| 279 | - if: matrix.id == 'icu' && (github.event_name == 'schedule' || inputs.id == 'all' || inputs.id == matrix.id) | ||
| 288 | + if: | | ||
| 289 | + (matrix.id == 'icu' || matrix.id == 'inspector_protocol') && | ||
| 290 | + (github.event_name == 'schedule' || inputs.id == 'all' || inputs.id == matrix.id) | ||
| 280 | 291 | uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | |
| 281 | 292 | with: | |
| 282 | 293 | python-version: ${{ env.PYTHON_VERSION }} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,45 @@ | |||
| 1 | + #!/bin/sh | ||
| 2 | + set -e | ||
| 3 | + # Shell script to update inspector_protocol in the source tree to the version same with V8's. | ||
| 4 | + | ||
| 5 | + BASE_DIR=$(cd "$(dirname "$0")/../.." && pwd) | ||
| 6 | + DEPS_DIR="$BASE_DIR/deps" | ||
| 7 | + | ||
| 8 | + # shellcheck disable=SC1091 | ||
| 9 | + . "$BASE_DIR/tools/dep_updaters/utils.sh" | ||
| 10 | + | ||
| 11 | + echo "Making temporary workspace..." | ||
| 12 | + | ||
| 13 | + WORKSPACE=$(mktemp -d 2> /dev/null || mktemp -d -t 'tmp') | ||
| 14 | + | ||
| 15 | + cd "$WORKSPACE" | ||
| 16 | + | ||
| 17 | + git clone https://chromium.googlesource.com/deps/inspector_protocol.git | ||
| 18 | + | ||
| 19 | + INSPECTOR_PROTOCOL_DIR="$WORKSPACE/inspector_protocol" | ||
| 20 | + | ||
| 21 | + echo "Comparing latest upstream with current revision" | ||
| 22 | + | ||
| 23 | + set +e | ||
| 24 | + python "$BASE_DIR/tools/inspector_protocol/roll.py" \ | ||
| 25 | + --ip_src_upstream "$INSPECTOR_PROTOCOL_DIR" \ | ||
| 26 | + --node_src_downstream "$BASE_DIR" | ||
| 27 | + STATUS="$?" | ||
| 28 | + set -e | ||
| 29 | + | ||
| 30 | + if [ "$STATUS" = "0" ]; then | ||
| 31 | + echo "Skipped because inspector_protocol is on the latest version." | ||
| 32 | + exit 0 | ||
| 33 | + fi | ||
| 34 | + | ||
| 35 | + python "$BASE_DIR/tools/inspector_protocol/roll.py" \ | ||
| 36 | + --ip_src_upstream "$INSPECTOR_PROTOCOL_DIR" \ | ||
| 37 | + --node_src_downstream "$BASE_DIR" \ | ||
| 38 | + --force | ||
| 39 | + | ||
| 40 | + NEW_VERSION=$(grep "Revision:" "$DEPS_DIR/inspector_protocol/README.node" | sed -n "s/^Revision: \(\\w*\)/\1/p") | ||
| 41 | + | ||
| 42 | + # Update the version number on maintaining-dependencies.md | ||
| 43 | + # and print the new version as the last line of the script as we need | ||
| 44 | + # to add it to $GITHUB_ENV variable | ||
| 45 | + finalize_version_update "inspector_protocol" "$NEW_VERSION" | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -38,15 +38,13 @@ def RunCmd(cmd): | |||
| 38 | 38 | return stdoutdata.decode('utf-8') | |
| 39 | 39 | ||
| 40 | 40 | ||
| 41 | - def CheckRepoIsClean(path, suffix): | ||
| 41 | + def CheckRepoIsClean(path): | ||
| 42 | 42 | os.chdir(path) # As a side effect this also checks for existence of the dir. | |
| 43 | 43 | # If path isn't a git repo, this will throw and exception. | |
| 44 | 44 | # And if it is a git repo and 'git status' has anything interesting to say, | |
| 45 | 45 | # then it's not clean (uncommitted files etc.) | |
| 46 | 46 | if len(RunCmd(['git', 'status', '--porcelain'])) != 0: | |
| 47 | 47 | raise Exception('%s is not a clean git repo (run git status)' % path) | |
| 48 | - if not path.endswith(suffix): | ||
| 49 | - raise Exception('%s does not end with /%s' % (path, suffix)) | ||
| 50 | 48 | ||
| 51 | 49 | ||
| 52 | 50 | def CheckRepoIsNotAtMainBranch(path): | |
@@ -85,6 +83,16 @@ def ReadV8IPRevision(node_src_path): | |||
| 85 | 83 | return line[len(REVISION_LINE_PREFIX):] | |
| 86 | 84 | raise Exception('No V8 inspector protocol revision found') | |
| 87 | 85 | ||
| 86 | + | ||
| 87 | + def ReadNodeIPRevision(node_src_path): | ||
| 88 | + lines = open(os.path.join(node_src_path, 'deps/inspector_protocol/README.node')).readlines() | ||
| 89 | + for line in lines: | ||
| 90 | + line = line.strip() | ||
| 91 | + if line.startswith(REVISION_LINE_PREFIX): | ||
| 92 | + return line[len(REVISION_LINE_PREFIX):] | ||
| 93 | + raise Exception('No Node inspector protocol revision found') | ||
| 94 | + | ||
| 95 | + | ||
| 88 | 96 | def CheckoutRevision(path, revision): | |
| 89 | 97 | os.chdir(path) | |
| 90 | 98 | return RunCmd(['git', 'checkout', revision]) | |
@@ -114,8 +122,8 @@ def main(argv): | |||
| 114 | 122 | upstream = os.path.normpath(os.path.expanduser(args.ip_src_upstream)) | |
| 115 | 123 | downstream = os.path.normpath(os.path.expanduser( | |
| 116 | 124 | args.node_src_downstream)) | |
| 117 | - CheckRepoIsClean(upstream, '/src') | ||
| 118 | - CheckRepoIsClean(downstream, '/node') | ||
| 125 | + CheckRepoIsClean(upstream) | ||
| 126 | + CheckRepoIsClean(downstream) | ||
| 119 | 127 | CheckRepoIsInspectorProtocolCheckout(upstream) | |
| 120 | 128 | # Check that the destination Git repo isn't at the main branch - it's | |
| 121 | 129 | # generally a bad idea to check into the main branch, so we catch this | |
@@ -124,6 +132,10 @@ def main(argv): | |||
| 124 | 132 | ||
| 125 | 133 | # Read V8's inspector_protocol revision | |
| 126 | 134 | v8_ip_revision = ReadV8IPRevision(downstream) | |
| 135 | + node_ip_revision = ReadNodeIPRevision(downstream) | ||
| 136 | + if v8_ip_revision == node_ip_revision: | ||
| 137 | + print('Node is already at V8\'s inspector_protocol revision %s - nothing to do.' % v8_ip_revision) | ||
| 138 | + sys.exit(0) | ||
| 127 | 139 | print('Checking out %s into %s ...' % (upstream, v8_ip_revision)) | |
| 128 | 140 | CheckoutRevision(upstream, v8_ip_revision) | |
| 129 | 141 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments