Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools: sync gyp code base with node-gyp repo #30563

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
targos marked this conversation as resolved.
Show resolved Hide resolved
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)
targos marked this conversation as resolved.
Show resolved Hide resolved
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