Use locally installed local-web-server

v8/tools assumes that local-web-server is installed globally. The
instructions in the README don't currently work if followed.

Additionally, some automated source scanners have been
complaining about some packages used by V8 tools directory.

path-to-regexp: https://github.com/advisories/GHSA-9wv6-86v2-598j.

This change should make the warnings go away.


Bug: 366122655
Change-Id: I093b7c090d14ab123305753131a7fe2c6c786685
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5857386
Reviewed-by: Camillo Bruni <cbruni@chromium.org>
Commit-Queue: Issack John <issackjohn@microsoft.com>
Reviewed-by: Seth Brenith <seth.brenith@microsoft.com>
Cr-Commit-Position: refs/heads/main@{#96148}
This commit is contained in:
Issack John authored and V8 LUCI CQ committed 2024-09-17 19:14:28 +00:00
1 parent 17c442d0af
commit a2ce6c553e
4 files changed
+1114 -902

No files matched your search

+2 -2
View File
@@ -10,7 +10,7 @@ For local development you have to start a local webserver under <http://localhos
```
cd tools/;
npm install;
ws;
npm run start-webserver;
```
## Local Symbol Server
@@ -19,7 +19,7 @@ The system-analyzer can symbolize profiles for local binaries by running a
local symbol server
```
cd tools/;
ws --stack system-analyzer/lws-middleware.js lws-static cors;
./system-analyzer/local-server.sh;
```
Note that the local symbol server will run `nm` and `objdump` and has access to
your files.
+1085 -892
View File
File diff suppressed because it is too large. Load diff
+7 -1
View File
@@ -1,7 +1,13 @@
{
"name": "v8-tools",
"version": "1.0.0",
"scripts": {
"start-webserver": "ws"
},
"dependencies": {
"local-web-server": "^5.3.1"
"local-web-server": "^5.4.0"
},
"overrides": {
"path-to-regexp": "6.3.0"
}
}
+20 -7
View File
@@ -19,8 +19,7 @@ for i in "$@"; do
esac
done
if ! command -v ws &> /dev/null
then
if ! npm list local-web-server > /dev/null; then
echo "'ws' not found!"
echo "Please install local-web-server:"
echo "npm install local-web-server"
@@ -33,14 +32,28 @@ TOOLS_DIR=`dirname "$TOOLS_DIR"`;
cd "$TOOLS_DIR/.."
TOOLS_DIR=`pwd -P`
if lsof -t -i TCP:8000; then
echo "locahost:8000 is already in use. You can kill it with:"
echo "lsof -t -i TCP:8000 | xargs kill"
exit 1
# Check if port 8000 is in use
if [[ "$OSTYPE" == "msys" ]]; then
if netstat -ano | findstr :8000 > /dev/null; then
echo "localhost:8000 is already in use. You can kill it with:"
echo "netstat -aon | findstr :8000"
echo "taskkill /PID <PID>"
exit 1
fi
else
if lsof -t -i TCP:8000; then
echo "localhost:8000 is already in use. You can kill it with:"
echo "lsof -t -i TCP:8000 | xargs kill"
exit 1
fi
fi
echo "Starting local symbol server"
ws --stack $TOOLS_DIR/system-analyzer/lws-middleware.js lws-static lws-index & PID=$!
npm run start-webserver -- \
--stack $TOOLS_DIR/system-analyzer/lws-middleware.js \
lws-static \
lws-cors \
lws-index & PID=$!
# Kill server after 1h
for i in `seq 3600`; do