Skip to content

Commit

Permalink
tools: sync gyp code base with node-gyp repo
Browse files Browse the repository at this point in the history
PR-URL: #30563
Reviewed-By: Ujjwal Sharma <[email protected]>
Reviewed-By: Christian Clauss <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
targos committed Feb 21, 2020
1 parent ae41049 commit cf00961
Show file tree
Hide file tree
Showing 28 changed files with 1,354 additions and 821 deletions.
23 changes: 0 additions & 23 deletions tools/gyp/DEPS

This file was deleted.

137 changes: 0 additions & 137 deletions tools/gyp/buildbot/buildbot_run.py

This file was deleted.

6 changes: 0 additions & 6 deletions tools/gyp/buildbot/commit_queue/OWNERS

This file was deleted.

3 changes: 0 additions & 3 deletions tools/gyp/buildbot/commit_queue/README

This file was deleted.

15 changes: 0 additions & 15 deletions tools/gyp/buildbot/commit_queue/cq_config.json

This file was deleted.

6 changes: 0 additions & 6 deletions tools/gyp/codereview.settings

This file was deleted.

38 changes: 36 additions & 2 deletions tools/gyp/gyp_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,44 @@

import os
import sys
import subprocess

PY3 = bytes != str

# Below IsCygwin() function copied from pylib/gyp/common.py
def IsCygwin():
try:
out = subprocess.Popen("uname",
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
stdout, stderr = out.communicate()
if PY3:
stdout = stdout.decode("utf-8")
return "CYGWIN" in str(stdout)
except Exception:
return False


def UnixifyPath(path):
try:
if not IsCygwin():
return path
out = subprocess.Popen(["cygpath", "-u", path],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
stdout, _ = out.communicate()
if PY3:
stdout = stdout.decode("utf-8")
return str(stdout)
except Exception:
return path


# Make sure we're using the version of pylib in this repo, not one installed
# elsewhere on the system.
sys.path.insert(0, os.path.join(os.path.dirname(sys.argv[0]), 'pylib'))
# elsewhere on the system. Also convert to Unix style path on Cygwin systems,
# else the 'gyp' library will not be found
path = UnixifyPath(sys.argv[0])
sys.path.insert(0, os.path.join(os.path.dirname(path), 'pylib'))
import gyp

if __name__ == '__main__':
Expand Down
Loading

0 comments on commit cf00961

Please sign in to comment.