Skip to content

Commit ee6a837

Browse files
committed
gyp: update gyp to 0.6.1
Closes: #2236 PR-URL: #2238 Reviewed-By: Christian Clauss <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Myles Borins <[email protected]>
1 parent 3e7f8cc commit ee6a837

21 files changed

+210
-243
lines changed

gyp/.flake8

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[flake8]
2-
max-complexity = 10
2+
max-complexity = 101
33
max-line-length = 88
4-
extend-ignore = E203,C901,E501
4+
extend-ignore = E203 # whitespace before ':' to agree with psf/black

gyp/.github/workflows/Python_tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
max-parallel: 15
1313
matrix:
1414
os: [macos-latest, ubuntu-latest] # , windows-latest]
15-
python-version: [2.7, 3.6, 3.7, 3.8] # 3.5,
15+
python-version: [2.7, 3.6, 3.7, 3.8, 3.9]
1616
steps:
1717
- uses: actions/checkout@v2
1818
- name: Set up Python ${{ matrix.python-version }}

gyp/.github/workflows/node-gyp.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: node-gyp integration
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
os: [macos-latest, ubuntu-latest, windows-latest]
11+
runs-on: ${{ matrix.os }}
12+
steps:
13+
- name: Clone gyp-next
14+
uses: actions/checkout@v2
15+
with:
16+
path: gyp-next
17+
- name: Clone nodejs/node-gyp
18+
uses: actions/checkout@v2
19+
with:
20+
repository: nodejs/node-gyp
21+
path: node-gyp
22+
- uses: actions/setup-node@v1
23+
with:
24+
node-version: 14.x
25+
- uses: actions/setup-python@v2
26+
with:
27+
python-version: 3.9
28+
- name: Install dependencies
29+
run: |
30+
cd node-gyp
31+
npm install --no-progress
32+
- name: Replace gyp in node-gyp
33+
shell: bash
34+
run: |
35+
rm -rf node-gyp/gyp
36+
cp -r gyp-next node-gyp/gyp
37+
- name: Run tests
38+
run: |
39+
cd node-gyp
40+
npm test

gyp/.github/workflows/nodejs-windows.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
build-windows:
77
runs-on: windows-latest
88
steps:
9-
- name: Clone node-gyp
9+
- name: Clone gyp-next
1010
uses: actions/checkout@v2
1111
with:
1212
path: gyp-next

gyp/CHANGELOG.md

+27-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,29 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66

77
## [Unreleased]
88

9+
## [0.6.1] - 2020-10-14
10+
11+
### Fixed
12+
- Correctly rename object files for absolute paths in MSVS generator.
13+
14+
## [0.6.0] - 2020-10-13
15+
16+
### Added
17+
- The Makefile generator will now output shared libraries directly to the product
18+
directory on all platforms (previously only macOS).
19+
20+
## [0.5.0] - 2020-09-30
21+
22+
### Added
23+
- Extended compile_commands_json generator to consider more file extensions than
24+
just `c` and `cc`. `cpp` and `cxx` are now supported.
25+
- Source files with duplicate basenames are now supported.
26+
27+
### Removed
28+
- The `--no-duplicate-basename-check` option was removed.
29+
- The `msvs_enable_marmasm` configuration option was removed in favor of
30+
auto-inclusion of the "marmasm" sections for Windows on ARM.
31+
932
## [0.4.0] - 2020-07-14
1033

1134
### Added
@@ -34,7 +57,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
3457
This is the first release of this project, based on https://chromium.googlesource.com/external/gyp
3558
with changes made over the years in Node.js and node-gyp.
3659

37-
[Unreleased]: https://github.com/nodejs/gyp-next/compare/v0.4.0...HEAD
60+
[Unreleased]: https://github.com/nodejs/gyp-next/compare/v0.6.1...HEAD
61+
[0.6.1]: https://github.com/nodejs/gyp-next/compare/v0.6.0...v0.6.1
62+
[0.6.0]: https://github.com/nodejs/gyp-next/compare/v0.5.0...v0.6.0
63+
[0.5.0]: https://github.com/nodejs/gyp-next/compare/v0.4.0...v0.5.0
3864
[0.4.0]: https://github.com/nodejs/gyp-next/compare/v0.3.0...v0.4.0
3965
[0.3.0]: https://github.com/nodejs/gyp-next/compare/v0.2.1...v0.3.0
4066
[0.2.1]: https://github.com/nodejs/gyp-next/compare/v0.2.0...v0.2.1

gyp/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ GYP can Generate Your Projects.
22
===================================
33

44
Documents are available at [gyp.gsrc.io](https://gyp.gsrc.io), or you can check out ```md-pages``` branch to read those documents offline.
5+
6+
__gyp-next__ is [released](https://github.com/nodejs/gyp-next/releases) to the [__Python Packaging Index__](https://pypi.org/project/gyp-next) (PyPI) and can be installed with the command:
7+
* `python3 -m pip install gyp-next`

gyp/pylib/gyp/MSVSSettings_test.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,8 @@ def testConvertToMSBuildSettings_warnings(self):
678678
"MSBuild, index value (21) not in expected range [0, 3)",
679679
"Warning: while converting VCCLCompilerTool/UsePrecompiledHeader to "
680680
"MSBuild, index value (13) not in expected range [0, 3)",
681-
"Warning: while converting VCCLCompilerTool/GeneratePreprocessedFile to "
681+
"Warning: while converting "
682+
"VCCLCompilerTool/GeneratePreprocessedFile to "
682683
"MSBuild, value must be one of [0, 1, 2]; got 14",
683684
"Warning: while converting VCLinkerTool/Driver to "
684685
"MSBuild, index value (10) not in expected range [0, 4)",
@@ -1348,7 +1349,8 @@ def testConvertToMSBuildSettings_actual(self):
13481349
"EmbedManifest": "false",
13491350
"GenerateCatalogFiles": "true",
13501351
"InputResourceManifests": "asfsfdafs",
1351-
"ManifestResourceFile": "$(IntDir)\\$(TargetFileName).embed.manifest.resfdsf",
1352+
"ManifestResourceFile":
1353+
"$(IntDir)\\$(TargetFileName).embed.manifest.resfdsf",
13521354
"OutputManifestFile": "$(TargetPath).manifestdfs",
13531355
"RegistrarScriptFile": "sdfsfd",
13541356
"ReplacementsFile": "sdffsd",
@@ -1532,7 +1534,8 @@ def testConvertToMSBuildSettings_actual(self):
15321534
"LinkIncremental": "",
15331535
},
15341536
"ManifestResourceCompile": {
1535-
"ResourceOutputFileName": "$(IntDir)$(TargetFileName).embed.manifest.resfdsf"
1537+
"ResourceOutputFileName":
1538+
"$(IntDir)$(TargetFileName).embed.manifest.resfdsf"
15361539
},
15371540
}
15381541
self.maxDiff = 9999 # on failure display a long diff

gyp/pylib/gyp/__init__.py

-17
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ def Load(
6868
params=None,
6969
check=False,
7070
circular_check=True,
71-
duplicate_basename_check=True,
7271
):
7372
"""
7473
Loads one or more specified build files.
@@ -156,7 +155,6 @@ def Load(
156155
generator_input_info,
157156
check,
158157
circular_check,
159-
duplicate_basename_check,
160158
params["parallel"],
161159
params["root_targets"],
162160
)
@@ -431,20 +429,6 @@ def gyp_main(args):
431429
regenerate=False,
432430
help="don't check for circular relationships between files",
433431
)
434-
# --no-duplicate-basename-check disables the check for duplicate basenames
435-
# in a static_library/shared_library project. Visual C++ 2008 generator
436-
# doesn't support this configuration. Libtool on Mac also generates warnings
437-
# when duplicate basenames are passed into Make generator on Mac.
438-
# TODO(yukawa): Remove this option when these legacy generators are
439-
# deprecated.
440-
parser.add_argument(
441-
"--no-duplicate-basename-check",
442-
dest="duplicate_basename_check",
443-
action="store_false",
444-
default=True,
445-
regenerate=False,
446-
help="don't check for duplicate basenames",
447-
)
448432
parser.add_argument(
449433
"--no-parallel",
450434
action="store_true",
@@ -651,7 +635,6 @@ def gyp_main(args):
651635
params,
652636
options.check,
653637
options.circular_check,
654-
options.duplicate_basename_check,
655638
)
656639

657640
# TODO(mark): Pass |data| for now because the generator needs a list of

gyp/pylib/gyp/common.py

+15-9
Original file line numberDiff line numberDiff line change
@@ -352,10 +352,14 @@ class Writer(object):
352352
"""Wrapper around file which only covers the target if it differs."""
353353

354354
def __init__(self):
355-
# On Cygwin remove the "dir" argument because `C:` prefixed paths are treated as relative,
356-
# consequently ending up with current dir "/cygdrive/c/..." being prefixed to those, which was
357-
# obviously a non-existent path, for example: "/cygdrive/c/<some folder>/C:\<my win style abs path>".
358-
# See https://docs.python.org/2/library/tempfile.html#tempfile.mkstemp for more details
355+
# On Cygwin remove the "dir" argument
356+
# `C:` prefixed paths are treated as relative,
357+
# consequently ending up with current dir "/cygdrive/c/..."
358+
# being prefixed to those, which was
359+
# obviously a non-existent path,
360+
# for example: "/cygdrive/c/<some folder>/C:\<my win style abs path>".
361+
# For more details see:
362+
# https://docs.python.org/2/library/tempfile.html#tempfile.mkstemp
359363
base_temp_dir = "" if IsCygwin() else os.path.dirname(filename)
360364
# Pick temporary file.
361365
tmp_fd, self.tmp_path = tempfile.mkstemp(
@@ -391,13 +395,15 @@ def close(self):
391395
# one.
392396
os.unlink(self.tmp_path)
393397
else:
394-
# The new file is different from the old one, or there is no old one.
398+
# The new file is different from the old one,
399+
# or there is no old one.
395400
# Rename the new file to the permanent name.
396401
#
397402
# tempfile.mkstemp uses an overly restrictive mode, resulting in a
398403
# file that can only be read by the owner, regardless of the umask.
399-
# There's no reason to not respect the umask here, which means that
400-
# an extra hoop is required to fetch it and reset the new file's mode.
404+
# There's no reason to not respect the umask here,
405+
# which means that an extra hoop is required
406+
# to fetch it and reset the new file's mode.
401407
#
402408
# No way to get the umask without setting a new one? Set a safe one
403409
# and then set it back to the old value.
@@ -406,8 +412,8 @@ def close(self):
406412
os.chmod(self.tmp_path, 0o666 & ~umask)
407413
if sys.platform == "win32" and os.path.exists(filename):
408414
# NOTE: on windows (but not cygwin) rename will not replace an
409-
# existing file, so it must be preceded with a remove. Sadly there
410-
# is no way to make the switch atomic.
415+
# existing file, so it must be preceded with a remove.
416+
# Sadly there is no way to make the switch atomic.
411417
os.remove(filename)
412418
os.rename(self.tmp_path, filename)
413419
except Exception:

gyp/pylib/gyp/generator/android.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ def WriteSources(self, spec, configs, extra_sources):
557557
These are source files necessary to build the current target.
558558
We need to handle shared_intermediate directory source files as
559559
a special case by copying them to the intermediate directory and
560-
treating them as a genereated sources. Otherwise the Android build
560+
treating them as a generated sources. Otherwise the Android build
561561
rules won't pick them up.
562562
563563
Args:

gyp/pylib/gyp/generator/compile_commands_json.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ def AddCommandsForTarget(cwd, target, params, per_config_commands):
6161
defines = ["-D" + s for s in defines]
6262

6363
# TODO(bnoordhuis) Handle generated source files.
64-
sources = target.get("sources", [])
65-
sources = [s for s in sources if s.endswith(".c") or s.endswith(".cc")]
64+
extensions = (".c", ".cc", ".cpp", ".cxx")
65+
sources = [s for s in target.get("sources", []) if s.endswith(extensions)]
6666

6767
def resolve(filename):
6868
return os.path.abspath(os.path.join(cwd, filename))

0 commit comments

Comments
 (0)