Skip to content

Commit

Permalink
deps: update gyp to 25ed9ac
Browse files Browse the repository at this point in the history
Gyp update to be able to generate VS2015 projects.

PR-URL: nodejs/node-v0.x-archive#25857
Reviewed-By: Alexis Campailla <[email protected]>
  • Loading branch information
joaocgreis committed Aug 24, 2015
1 parent 841a6dd commit a525c72
Show file tree
Hide file tree
Showing 40 changed files with 3,480 additions and 2,593 deletions.
26 changes: 22 additions & 4 deletions tools/gyp/PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,17 @@
'test/lib/TestCmd.py',
'test/lib/TestCommon.py',
'test/lib/TestGyp.py',
# Needs style fix.
'pylib/gyp/generator/xcode.py',
]


PYLINT_DISABLED_WARNINGS = [
# TODO: fix me.
# Many tests include modules they don't use.
'W0611',
# Possible unbalanced tuple unpacking with sequence.
'W0632',
# Attempting to unpack a non-sequence.
'W0633',
# Include order doesn't properly include local files?
'F0401',
# Some use of built-in names.
Expand All @@ -40,6 +42,10 @@
'W0613',
# String has no effect (docstring in wrong place).
'W0105',
# map/filter on lambda could be replaced by comprehension.
'W0110',
# Use of eval.
'W0123',
# Comma not followed by space.
'C0324',
# Access to a protected member.
Expand All @@ -56,6 +62,8 @@
'E1101',
# Dangerous default {}.
'W0102',
# Cyclic import.
'R0401',
# Others, too many to sort.
'W0201', 'W0232', 'E1103', 'W0621', 'W0108', 'W0223', 'W0231',
'R0201', 'E0101', 'C0321',
Expand Down Expand Up @@ -116,5 +124,15 @@ def CheckChangeOnCommit(input_api, output_api):
return report


def GetPreferredTrySlaves():
return ['gyp-win32', 'gyp-win64', 'gyp-linux', 'gyp-mac', 'gyp-android']
TRYBOTS = [
'gyp-win32',
'gyp-win64',
'gyp-linux',
'gyp-mac',
]


def GetPreferredTryMasters(_, change):
return {
'tryserver.nacl': { t: set(['defaulttests']) for t in TRYBOTS },
}
82 changes: 14 additions & 68 deletions tools/gyp/buildbot/buildbot_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,26 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.


"""Argument-less script to select what to run on the buildbots."""


import os
import shutil
import subprocess
import sys


if sys.platform in ['win32', 'cygwin']:
EXE_SUFFIX = '.exe'
else:
EXE_SUFFIX = ''


BUILDBOT_DIR = os.path.dirname(os.path.abspath(__file__))
TRUNK_DIR = os.path.dirname(BUILDBOT_DIR)
ROOT_DIR = os.path.dirname(TRUNK_DIR)
ANDROID_DIR = os.path.join(ROOT_DIR, 'android')
CMAKE_DIR = os.path.join(ROOT_DIR, 'cmake')
CMAKE_BIN_DIR = os.path.join(CMAKE_DIR, 'bin')
OUT_DIR = os.path.join(TRUNK_DIR, 'out')


def CallSubProcess(*args, **kwargs):
"""Wrapper around subprocess.call which treats errors as build exceptions."""
retcode = subprocess.call(*args, **kwargs)
with open(os.devnull) as devnull_fd:
retcode = subprocess.call(stdin=devnull_fd, *args, **kwargs)
if retcode != 0:
print '@@@STEP_EXCEPTION@@@'
sys.exit(1)
Expand All @@ -49,10 +41,6 @@ def PrepareCmake():

print '@@@BUILD_STEP Initialize CMake checkout@@@'
os.mkdir(CMAKE_DIR)
CallSubProcess(['git', 'config', '--global', 'user.name', 'trybot'])
CallSubProcess(['git', 'config', '--global',
'user.email', '[email protected]'])
CallSubProcess(['git', 'config', '--global', 'color.ui', 'false'])

print '@@@BUILD_STEP Sync CMake@@@'
CallSubProcess(
Expand All @@ -73,41 +61,7 @@ def PrepareCmake():
CallSubProcess( ['make', 'cmake'], cwd=CMAKE_DIR)


def PrepareAndroidTree():
"""Prepare an Android tree to run 'android' format tests."""
if os.environ['BUILDBOT_CLOBBER'] == '1':
print '@@@BUILD_STEP Clobber Android checkout@@@'
shutil.rmtree(ANDROID_DIR)

# The release of Android we use is static, so there's no need to do anything
# if the directory already exists.
if os.path.isdir(ANDROID_DIR):
return

print '@@@BUILD_STEP Initialize Android checkout@@@'
os.mkdir(ANDROID_DIR)
CallSubProcess(['git', 'config', '--global', 'user.name', 'trybot'])
CallSubProcess(['git', 'config', '--global',
'user.email', '[email protected]'])
CallSubProcess(['git', 'config', '--global', 'color.ui', 'false'])
CallSubProcess(
['repo', 'init',
'-u', 'https://android.googlesource.com/platform/manifest',
'-b', 'android-4.2.1_r1',
'-g', 'all,-notdefault,-device,-darwin,-mips,-x86'],
cwd=ANDROID_DIR)

print '@@@BUILD_STEP Sync Android@@@'
CallSubProcess(['repo', 'sync', '-j4'], cwd=ANDROID_DIR)

print '@@@BUILD_STEP Build Android@@@'
CallSubProcess(
['/bin/bash',
'-c', 'source build/envsetup.sh && lunch full-eng && make -j4'],
cwd=ANDROID_DIR)


def GypTestFormat(title, format=None, msvs_version=None):
def GypTestFormat(title, format=None, msvs_version=None, tests=[]):
"""Run the gyp tests for a given format, emitting annotator tags.
See annotator docs at:
Expand All @@ -126,22 +80,13 @@ def GypTestFormat(title, format=None, msvs_version=None):
if msvs_version:
env['GYP_MSVS_VERSION'] = msvs_version
command = ' '.join(
[sys.executable, 'trunk/gyptest.py',
[sys.executable, 'gyp/gyptest.py',
'--all',
'--passed',
'--format', format,
'--path', CMAKE_BIN_DIR,
'--chdir', 'trunk'])
if format == 'android':
# gyptest needs the environment setup from envsetup/lunch in order to build
# using the 'android' backend, so this is done in a single shell.
retcode = subprocess.call(
['/bin/bash',
'-c', 'source build/envsetup.sh && lunch full-eng && cd %s && %s'
% (ROOT_DIR, command)],
cwd=ANDROID_DIR, env=env)
else:
retcode = subprocess.call(command, cwd=ROOT_DIR, env=env, shell=True)
'--chdir', 'gyp'] + tests)
retcode = subprocess.call(command, cwd=ROOT_DIR, env=env, shell=True)
if retcode:
# Emit failure tag, and keep going.
print '@@@STEP_FAILURE@@@'
Expand All @@ -157,11 +102,7 @@ def GypBuild():
print 'Done.'

retcode = 0
# The Android gyp bot runs on linux so this must be tested first.
if os.environ['BUILDBOT_BUILDERNAME'] == 'gyp-android':
PrepareAndroidTree()
retcode += GypTestFormat('android')
elif sys.platform.startswith('linux'):
if sys.platform.startswith('linux'):
retcode += GypTestFormat('ninja')
retcode += GypTestFormat('make')
PrepareCmake()
Expand All @@ -173,8 +114,13 @@ def GypBuild():
elif sys.platform == 'win32':
retcode += GypTestFormat('ninja')
if os.environ['BUILDBOT_BUILDERNAME'] == 'gyp-win64':
retcode += GypTestFormat('msvs-2010', format='msvs', msvs_version='2010')
retcode += GypTestFormat('msvs-2012', format='msvs', msvs_version='2012')
retcode += GypTestFormat('msvs-ninja-2013', format='msvs-ninja',
msvs_version='2013',
tests=[
r'test\generator-output\gyptest-actions.py',
r'test\generator-output\gyptest-relocate.py',
r'test\generator-output\gyptest-rules.py'])
retcode += GypTestFormat('msvs-2013', format='msvs', msvs_version='2013')
else:
raise Exception('Unknown platform')
if retcode:
Expand Down
6 changes: 6 additions & 0 deletions tools/gyp/buildbot/commit_queue/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
set noparent
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
3 changes: 3 additions & 0 deletions tools/gyp/buildbot/commit_queue/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cq_config.json describes the trybots that must pass in order
to land a change through the commit queue.
Comments are here as the file is strictly JSON.
15 changes: 15 additions & 0 deletions tools/gyp/buildbot/commit_queue/cq_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"trybots": {
"launched": {
"tryserver.nacl": {
"gyp-presubmit": ["defaulttests"],
"gyp-linux": ["defaulttests"],
"gyp-mac": ["defaulttests"],
"gyp-win32": ["defaulttests"],
"gyp-win64": ["defaulttests"]
}
},
"triggered": {
}
}
}
10 changes: 5 additions & 5 deletions tools/gyp/codereview.settings
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# This file is used by gcl to get repository specific information.
CODE_REVIEW_SERVER: codereview.chromium.org
CC_LIST: [email protected]
VIEW_VC: http://code.google.com/p/gyp/source/detail?r=
TRY_ON_UPLOAD: True
VIEW_VC: https://chromium.googlesource.com/external/gyp/+/
TRY_ON_UPLOAD: False
TRYSERVER_PROJECT: gyp
TRYSERVER_PATCHLEVEL: 0
TRYSERVER_ROOT: trunk
TRYSERVER_PATCHLEVEL: 1
TRYSERVER_ROOT: gyp
TRYSERVER_SVN_URL: svn://svn.chromium.org/chrome-try/try-nacl

PROJECT: gyp
2 changes: 1 addition & 1 deletion tools/gyp/gyp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
Expand Down
7 changes: 0 additions & 7 deletions tools/gyp/gyp_dummy.c

This file was deleted.

6 changes: 3 additions & 3 deletions tools/gyp/gyptest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import subprocess
import sys

class CommandRunner:
class CommandRunner(object):
"""
Executor class for commands, including "commands" implemented by
Python functions.
Expand Down Expand Up @@ -117,7 +117,7 @@ def run(self, command, display=None, stdout=None, stderr=None):
return self.execute(command, stdout, stderr)


class Unbuffered:
class Unbuffered(object):
def __init__(self, fp):
self.fp = fp
def write(self, arg):
Expand Down Expand Up @@ -224,7 +224,7 @@ def main(argv=None):
'win32': ['msvs', 'ninja'],
'linux2': ['make', 'ninja'],
'linux3': ['make', 'ninja'],
'darwin': ['make', 'ninja', 'xcode'],
'darwin': ['make', 'ninja', 'xcode', 'xcode-ninja'],
}[sys.platform]

for format in format_list:
Expand Down
2 changes: 1 addition & 1 deletion tools/gyp/pylib/gyp/MSVSNew.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def set_msbuild_toolset(self, msbuild_toolset):
#------------------------------------------------------------------------------


class MSVSSolution:
class MSVSSolution(object):
"""Visual Studio solution."""

def __init__(self, path, version, entries=None, variants=None,
Expand Down
Loading

0 comments on commit a525c72

Please sign in to comment.