Skip to content

Commit 5955aca

Browse files
legendecasaduh95
authored andcommitted
tools: remove deps/zlib/GN-scraper.py
Gyp appends search path for `pymod_do_main`, so `GN-scraper.py` in `v8_gypfiles` always takes precedence over `deps/zlib/GN-scraper.py`, and `deps/zlib/GN-scraper.py` is never loaded. PR-URL: #57238 Refs: https://github.com/nodejs/gyp-next/blob/46fc91f1fa0aeb72a2581ea6996f5e37f7a2e9ce/pylib/gyp/input.py#L935 Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 0f8cd32 commit 5955aca

File tree

4 files changed

+11
-31
lines changed

4 files changed

+11
-31
lines changed

deps/zlib/GN-scraper.py

-28
This file was deleted.

tools/dep_updaters/update-zlib.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ echo "Comparing latest upstream with current revision"
1414

1515
git fetch https://chromium.googlesource.com/chromium/src/third_party/zlib.git HEAD
1616

17-
# Revert zconf.h changes before checking diff
17+
# Revert zconf.h changes before checking diff
1818
perl -i -pe 's|^//#include "chromeconf.h"|#include "chromeconf.h"|' "$DEPS_DIR/zlib/zconf.h"
1919
git stash -- "$DEPS_DIR/zlib/zconf.h"
2020

@@ -63,13 +63,13 @@ gzip -dc "$ZLIB_TARBALL" | tar xf - -C zlib/
6363

6464
rm "$ZLIB_TARBALL"
6565

66-
cp "$DEPS_DIR/zlib/zlib.gyp" "$DEPS_DIR/zlib/GN-scraper.py" "$DEPS_DIR/zlib/win32/zlib.def" "$DEPS_DIR"
66+
cp "$DEPS_DIR/zlib/zlib.gyp" "$DEPS_DIR/zlib/win32/zlib.def" "$DEPS_DIR"
6767

6868
rm -rf "$DEPS_DIR/zlib" zlib/.git
6969

7070
mv zlib "$DEPS_DIR/"
7171

72-
mv "$DEPS_DIR/zlib.gyp" "$DEPS_DIR/GN-scraper.py" "$DEPS_DIR/zlib/"
72+
mv "$DEPS_DIR/zlib.gyp" "$DEPS_DIR/zlib/"
7373

7474
mkdir "$DEPS_DIR/zlib/win32"
7575

tools/gyp_node.py

+4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
sys.path.insert(0, os.path.join(node_root, 'tools', 'gyp', 'pylib'))
1010
import gyp
1111

12+
# Add search path for `pymod_do_main` first to avoid depending on
13+
# load order of gyp files.
14+
sys.path.insert(0, os.path.join(node_root, 'tools', 'v8_gypfiles'))
15+
1216
# Directory within which we want all generated files (including Makefiles)
1317
# to be written.
1418
output_dir = os.path.join(os.path.abspath(node_root), 'out')

tools/v8_gypfiles/GN-scraper.py

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Use of this source code is governed by an MIT-style license.
33
import re
44
import os
5+
import sys
56

67
PLAIN_SOURCE_RE = re.compile(r'\s*"([^/$].+)"\s*')
78
def DoMain(args):
@@ -22,3 +23,6 @@ def DoMain(args):
2223
# always use `/` since GYP will process paths further downstream
2324
rel_files = ['"%s/%s"' % (src_root, f) for f in files]
2425
return ' '.join(rel_files)
26+
27+
if __name__ == '__main__':
28+
print(DoMain(sys.argv[1:]))

0 commit comments

Comments
 (0)