Skip to content

Commit 79b1f04

Browse files
targoscodebytere
authored andcommitted
tools: sync gyp code base with node-gyp repo
PR-URL: #30563 Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org> Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Rich Trott <rtrott@gmail.com>
1 parent 091b4bf commit 79b1f04

28 files changed

Lines changed: 1354 additions & 821 deletions

‎tools/gyp/DEPS‎

Lines changed: 0 additions & 23 deletions
This file was deleted.

‎tools/gyp/buildbot/buildbot_run.py‎

Lines changed: 0 additions & 137 deletions
This file was deleted.

‎tools/gyp/buildbot/commit_queue/OWNERS‎

Lines changed: 0 additions & 6 deletions
This file was deleted.

‎tools/gyp/buildbot/commit_queue/README‎

Lines changed: 0 additions & 3 deletions
This file was deleted.

‎tools/gyp/buildbot/commit_queue/cq_config.json‎

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎tools/gyp/codereview.settings‎

Lines changed: 0 additions & 6 deletions
This file was deleted.

‎tools/gyp/gyp_main.py‎

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,44 @@
66

77
importos
88
importsys
9+
importsubprocess
10+
11+
PY3=bytes!=str
12+
13+
# Below IsCygwin() function copied from pylib/gyp/common.py
14+
defIsCygwin():
15+
try:
16+
out=subprocess.Popen("uname",
17+
stdout=subprocess.PIPE,
18+
stderr=subprocess.STDOUT)
19+
stdout, stderr=out.communicate()
20+
ifPY3:
21+
stdout=stdout.decode("utf-8")
22+
return"CYGWIN"instr(stdout)
23+
exceptException:
24+
returnFalse
25+
26+
27+
defUnixifyPath(path):
28+
try:
29+
ifnotIsCygwin():
30+
returnpath
31+
out=subprocess.Popen(["cygpath", "-u", path],
32+
stdout=subprocess.PIPE,
33+
stderr=subprocess.STDOUT)
34+
stdout, _=out.communicate()
35+
ifPY3:
36+
stdout=stdout.decode("utf-8")
37+
returnstr(stdout)
38+
exceptException:
39+
returnpath
40+
941

1042
# Make sure we're using the version of pylib in this repo, not one installed
11-
# elsewhere on the system.
12-
sys.path.insert(0, os.path.join(os.path.dirname(sys.argv[0]), 'pylib'))
43+
# elsewhere on the system. Also convert to Unix style path on Cygwin systems,
44+
# else the 'gyp' library will not be found
45+
path=UnixifyPath(sys.argv[0])
46+
sys.path.insert(0, os.path.join(os.path.dirname(path), 'pylib'))
1347
importgyp
1448

1549
if__name__=='__main__':

0 commit comments

Comments
 (0)