Skip to content

Commit

Permalink
tools: remove deps/zlib/GN-scraper.py
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
legendecas authored Mar 2, 2025
1 parent a3657da commit 4644853
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 31 deletions.
28 changes: 0 additions & 28 deletions deps/zlib/GN-scraper.py

This file was deleted.

6 changes: 3 additions & 3 deletions tools/dep_updaters/update-zlib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ echo "Comparing latest upstream with current revision"

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

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

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

rm "$ZLIB_TARBALL"

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

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

mv zlib "$DEPS_DIR/"

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

mkdir "$DEPS_DIR/zlib/win32"

Expand Down
4 changes: 4 additions & 0 deletions tools/gyp_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
sys.path.insert(0, os.path.join(node_root, 'tools', 'gyp', 'pylib'))
import gyp

# Add search path for `pymod_do_main` first to avoid depending on
# load order of gyp files.
sys.path.insert(0, os.path.join(node_root, 'tools', 'v8_gypfiles'))

# Directory within which we want all generated files (including Makefiles)
# to be written.
output_dir = os.path.join(os.path.abspath(node_root), 'out')
Expand Down
4 changes: 4 additions & 0 deletions tools/v8_gypfiles/GN-scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# Use of this source code is governed by an MIT-style license.
import re
import os
import sys

PLAIN_SOURCE_RE = re.compile(r'\s*"([^/$].+)"\s*')
def DoMain(args):
Expand All @@ -22,3 +23,6 @@ def DoMain(args):
# always use `/` since GYP will process paths further downstream
rel_files = ['"%s/%s"' % (src_root, f) for f in files]
return ' '.join(rel_files)

if __name__ == '__main__':
print(DoMain(sys.argv[1:]))

0 comments on commit 4644853

Please sign in to comment.