Skip to content

Commit db8ce5b

Browse files
zcbenztargos
authored andcommitted
tools: recognize GN files in dep_updaters
PR-URL: #50693 Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Tierney Cyren <hello@bnb.im> Reviewed-By: Michael Dawson <midawson@redhat.com>
1 parent c81d2ac commit db8ce5b

9 files changed

+53
-23
lines changed

tools/dep_updaters/update-ada.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ rm "$ADA_ZIP"
5454

5555
curl -sL -o "$ADA_LICENSE" "https://raw.githubusercontent.com/ada-url/ada/HEAD/LICENSE-MIT"
5656

57-
echo "Replacing existing ada (except GYP build files)"
58-
mv "$DEPS_DIR/ada/"*.gyp "$DEPS_DIR/ada/README.md" "$WORKSPACE/"
57+
echo "Replacing existing ada (except GYP and GN build files)"
58+
mv "$DEPS_DIR/ada/"*.gyp "$DEPS_DIR/ada/"*.gn "$DEPS_DIR/ada/"*.gni "$DEPS_DIR/ada/README.md" "$WORKSPACE/"
5959
rm -rf "$DEPS_DIR/ada"
6060
mv "$WORKSPACE" "$DEPS_DIR/ada"
6161

tools/dep_updaters/update-brotli.sh

+4-1
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,15 @@ mv "brotli-$NEW_VERSION" "brotli"
6060
echo "Copying existing gyp file"
6161
cp "$DEPS_DIR/brotli/brotli.gyp" "$WORKSPACE/brotli"
6262

63+
echo "Copying existing GN files"
64+
cp "$DEPS_DIR/brotli/"*.gn "$DEPS_DIR/brotli/"*.gni "$WORKSPACE/brotli"
65+
6366
echo "Deleting existing brotli"
6467
rm -rf "$DEPS_DIR/brotli"
6568
mkdir "$DEPS_DIR/brotli"
6669

6770
echo "Update c and LICENSE"
68-
mv "$WORKSPACE/brotli/c" "$WORKSPACE/brotli/LICENSE" "$WORKSPACE/brotli/brotli.gyp" "$DEPS_DIR/brotli"
71+
mv "$WORKSPACE/brotli/"*.gn "$WORKSPACE/brotli/"*.gni "$WORKSPACE/brotli/c" "$WORKSPACE/brotli/LICENSE" "$WORKSPACE/brotli/brotli.gyp" "$DEPS_DIR/brotli"
6972

7073
# Update the version number on maintaining-dependencies.md
7174
# and print the new version as the last line of the script as we need

tools/dep_updaters/update-c-ares.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,11 @@ mv "c-ares-$NEW_VERSION" cares
5656
echo "Removing tests"
5757
rm -rf "$WORKSPACE/cares/test"
5858

59-
echo "Copying existing .gitignore, config and gyp files"
59+
echo "Copying existing .gitignore, config, gyp and gn files"
6060
cp -R "$DEPS_DIR/cares/config" "$WORKSPACE/cares"
6161
cp "$DEPS_DIR/cares/.gitignore" "$WORKSPACE/cares"
6262
cp "$DEPS_DIR/cares/cares.gyp" "$WORKSPACE/cares"
63+
cp "$DEPS_DIR/cares/"*.gn "$DEPS_DIR/cares/"*.gni "$WORKSPACE/cares"
6364

6465
echo "Replacing existing c-ares"
6566
rm -rf "$DEPS_DIR/cares"

tools/dep_updaters/update-libuv.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ gzip -dc "$LIBUV_TARBALL" | tar xf -
5959
rm "$LIBUV_TARBALL"
6060
mv libuv-libuv-* uv
6161

62-
echo "Replacing existing libuv (except GYP build files)"
63-
mv "$DEPS_DIR/uv/"*.gyp "$DEPS_DIR/uv/"*.gypi "$WORKSPACE/uv/"
62+
echo "Replacing existing libuv (except GYP and GN build files)"
63+
mv "$DEPS_DIR/uv/"*.gyp "$DEPS_DIR/uv/"*.gypi "$DEPS_DIR/uv/"*.gn "$DEPS_DIR/uv/"*.gni "$WORKSPACE/uv/"
6464
rm -rf "$DEPS_DIR/uv"
6565
mv "$WORKSPACE/uv" "$DEPS_DIR/"
6666

tools/dep_updaters/update-llhttp.sh

+5
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ trap cleanup INT TERM EXIT
4545

4646
cd "$WORKSPACE"
4747

48+
echo "Replacing existing llhttp (except GYP and GN build files)"
49+
mv "$DEPS_DIR/llhttp/"*.gn "$DEPS_DIR/llhttp/"*.gni "$WORKSPACE/"
50+
4851
if echo "$NEW_VERSION" | grep -qs "/" ; then # Download a release
4952
REPO="git@github.com:$NEW_VERSION.git"
5053
BRANCH=$2
@@ -74,6 +77,8 @@ else
7477
cp -a "llhttp-release-v$NEW_VERSION" "$DEPS_DIR/llhttp"
7578
fi
7679

80+
mv "$WORKSPACE/"*.gn "$WORKSPACE/"*.gni "$DEPS_DIR/llhttp"
81+
7782
# Update the version number on maintaining-dependencies.md
7883
# and print the new version as the last line of the script as we need
7984
# to add it to $GITHUB_ENV variable

tools/dep_updaters/update-nghttp2.sh

+3
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ cp "$DEPS_DIR/nghttp2/lib/includes/config.h" "$WORKSPACE/nghttp2/lib/includes"
7373
echo "Copying existing gyp files"
7474
cp "$DEPS_DIR/nghttp2/nghttp2.gyp" "$WORKSPACE/nghttp2"
7575

76+
echo "Copying existing GN files"
77+
cp "$DEPS_DIR/nghttp2/"*.gn "$DEPS_DIR/nghttp2/"*.gni "$WORKSPACE/nghttp2"
78+
7679
echo "Replacing existing nghttp2"
7780
rm -rf "$DEPS_DIR/nghttp2"
7881
mv "$WORKSPACE/nghttp2" "$DEPS_DIR/"

tools/dep_updaters/update-postject.sh

+28-14
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,49 @@
77

88
set -ex
99

10-
ROOT=$(cd "$(dirname "$0")/../.." && pwd)
11-
[ -z "$NODE" ] && NODE="$ROOT/out/Release/node"
10+
BASE_DIR=$(cd "$(dirname "$0")/../.." && pwd)
11+
DEPS_DIR="$BASE_DIR/deps"
12+
[ -z "$NODE" ] && NODE="$BASE_DIR/out/Release/node"
1213
[ -x "$NODE" ] || NODE=$(command -v node)
13-
NPM="$ROOT/deps/npm/bin/npm-cli.js"
14+
NPM="$BASE_DIR/deps/npm/bin/npm-cli.js"
1415

1516
# shellcheck disable=SC1091
16-
. "$ROOT/tools/dep_updaters/utils.sh"
17+
. "$BASE_DIR/tools/dep_updaters/utils.sh"
1718

1819
NEW_VERSION=$("$NODE" "$NPM" view postject dist-tags.latest)
1920
CURRENT_VERSION=$("$NODE" -p "require('./test/fixtures/postject-copy/node_modules/postject/package.json').version")
2021

2122
# This function exit with 0 if new version and current version are the same
2223
compare_dependency_version "postject" "$NEW_VERSION" "$CURRENT_VERSION"
2324

24-
cd "$( dirname "$0" )/../.." || exit
25-
rm -rf test/fixtures/postject-copy
26-
mkdir test/fixtures/postject-copy
27-
cd test/fixtures/postject-copy || exit
25+
echo "Making temporary workspace..."
26+
27+
WORKSPACE=$(mktemp -d 2> /dev/null || mktemp -d -t 'tmp')
28+
29+
cleanup () {
30+
EXIT_CODE=$?
31+
[ -d "$WORKSPACE" ] && rm -rf "$WORKSPACE"
32+
exit $EXIT_CODE
33+
}
34+
35+
trap cleanup INT TERM EXIT
36+
37+
cd "$WORKSPACE"
38+
39+
echo "Installing postject npm package..."
2840

2941
"$NODE" "$NPM" init --yes
3042

3143
"$NODE" "$NPM" install --no-bin-links --ignore-scripts "postject@$NEW_VERSION"
3244

33-
# TODO(RaisinTen): Replace following with $WORKSPACE
34-
cd ../../..
35-
rm -rf deps/postject
36-
mkdir deps/postject
37-
cp test/fixtures/postject-copy/node_modules/postject/LICENSE deps/postject
38-
cp test/fixtures/postject-copy/node_modules/postject/dist/postject-api.h deps/postject
45+
echo "Replacing existing postject (except GN build files)"
46+
47+
mv "$DEPS_DIR/postject/"*.gn "$DEPS_DIR/postject/"*.gni "$WORKSPACE/"
48+
rm -rf "$DEPS_DIR/postject"
49+
mkdir "$DEPS_DIR/postject"
50+
mv "$WORKSPACE/"*.gn "$WORKSPACE/"*.gni "$DEPS_DIR/postject"
51+
mv "$WORKSPACE/node_modules/postject/LICENSE" "$DEPS_DIR/postject"
52+
mv "$WORKSPACE/node_modules/postject/dist/postject-api.h" "$DEPS_DIR/postject"
3953

4054
# Update the version number on maintaining-dependencies.md
4155
# and print the new version as the last line of the script as we need

tools/dep_updaters/update-simdutf.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ rm ./*_demo.cpp
5454

5555
curl -sL -o "$SIMDUTF_LICENSE" "https://raw.githubusercontent.com/simdutf/simdutf/HEAD/LICENSE-MIT"
5656

57-
echo "Replacing existing simdutf (except GYP build files)"
58-
mv "$DEPS_DIR/simdutf/"*.gyp "$DEPS_DIR/simdutf/README.md" "$WORKSPACE/"
57+
echo "Replacing existing simdutf (except GYP and GN build files)"
58+
mv "$DEPS_DIR/simdutf/"*.gyp "$DEPS_DIR/simdutf/"*.gn "$DEPS_DIR/simdutf/"*.gni "$DEPS_DIR/simdutf/README.md" "$WORKSPACE/"
5959
rm -rf "$DEPS_DIR/simdutf"
6060
mv "$WORKSPACE" "$DEPS_DIR/simdutf"
6161

tools/dep_updaters/update-uvwasi.sh

+5-1
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,17 @@ log_and_verify_sha256sum "uvwasi" "$UVWASI_ZIP.zip"
5454

5555
echo "Moving existing GYP build file"
5656
mv "$DEPS_DIR/uvwasi/"*.gyp "$WORKSPACE/"
57+
58+
echo "Moving existing GN build file"
59+
mv "$DEPS_DIR/uvwasi/"*.gn "$DEPS_DIR/uvwasi/"*.gni "$WORKSPACE/"
60+
5761
rm -rf "$DEPS_DIR/uvwasi/"
5862

5963
echo "Unzipping..."
6064
unzip "$UVWASI_ZIP.zip" -d "$DEPS_DIR/uvwasi/"
6165
rm "$UVWASI_ZIP.zip"
6266

63-
mv "$WORKSPACE/"*.gyp "$DEPS_DIR/uvwasi/"
67+
mv "$WORKSPACE/"*.gyp "$WORKSPACE/"*.gn "$WORKSPACE/"*.gni "$DEPS_DIR/uvwasi/"
6468
cd "$DEPS_DIR/uvwasi/"
6569

6670
echo "Copying new files to deps folder"

0 commit comments

Comments
 (0)