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

gyp: update gyp-next to v0.6.0 #2236

Closed
wants to merge 5 commits 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
40 changes: 0 additions & 40 deletions .github/workflows/Python_tests.yml

This file was deleted.

51 changes: 51 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# TODO: Line 47, enable pytest --doctest-modules

name: Tests
on: [push, pull_request]
jobs:
Tests:
strategy:
fail-fast: false
max-parallel: 15
matrix:
node: [10.x, 12.x, 14.x]
python: [3.6, 3.8, 3.9]
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Use Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
env:
PYTHON_VERSION: ${{ matrix.python }}
- name: Install Dependencies
run: |
npm install --no-progress
pip install flake8 pytest
- name: Set Windows environment
if: matrix.os == 'windows-latest'
run:
echo '::set-env name=GYP_MSVS_VERSION::2015'
echo '::set-env name=GYP_MSVS_OVERRIDE_PATH::C:\\Dummy'
- name: Lint Python
if: matrix.os == 'ubuntu-latest'
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run Python tests
run: |
python -m pytest
# - name: Run doctests with pytest
# run: python -m pytest --doctest-modules
- name: Run Node tests
run: |
npm test
93 changes: 0 additions & 93 deletions .travis.yml

This file was deleted.

5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# `node-gyp` - Node.js native addon build tool

[![Travis CI](https://travis-ci.com/nodejs/node-gyp.svg?branch=master)](https://travis-ci.com/nodejs/node-gyp)
[![Build Status](https://github.com/nodejs/node-gyp/workflows/Python_tests/badge.svg)](https://github.com/nodejs/node-gyp/actions?workflow=Python_tests)
[![Build Status](https://github.com/nodejs/node-gyp/workflows/Tests/badge.svg?branch=master)](https://github.com/nodejs/node-gyp/actions?query=workflow%3ATests+branch%3Amaster)

`node-gyp` is a cross-platform command-line tool written in Node.js for
compiling native addon modules for Node.js. It contains a vendored copy of the
Expand Down Expand Up @@ -49,7 +48,7 @@ Install the current version of Python from the [Microsoft Store package](https:/

#### Option 1

Install all the required tools and configurations using Microsoft's [windows-build-tools](https://github.com/felixrieseberg/windows-build-tools) using `npm install --global --production windows-build-tools` from an elevated PowerShell or CMD.exe (run as Administrator).
Install all the required tools and configurations using Microsoft's [windows-build-tools](https://github.com/felixrieseberg/windows-build-tools) using `npm install --global windows-build-tools` from an elevated PowerShell or CMD.exe (run as Administrator).

#### Option 2

Expand Down
4 changes: 2 additions & 2 deletions gyp/.flake8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[flake8]
max-complexity = 10
max-complexity = 101
max-line-length = 88
extend-ignore = E203,C901,E501
extend-ignore = E203 # whitespace before ':' to agree with psf/black
2 changes: 1 addition & 1 deletion gyp/.github/workflows/Python_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
max-parallel: 15
matrix:
os: [macos-latest, ubuntu-latest] # , windows-latest]
python-version: [2.7, 3.6, 3.7, 3.8] # 3.5,
python-version: [2.7, 3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down
22 changes: 21 additions & 1 deletion gyp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

## [0.6.0] - 2020-10-13

### Added
- The Makefile generator will now output shared libraries directly to the product
directory on all platforms (previously only macOS).

## [0.5.0] - 2020-09-30

### Added
- Extended compile_commands_json generator to consider more file extensions than
just `c` and `cc`. `cpp` and `cxx` are now supported.
- Source files with duplicate basenames are now supported.

### Removed
- The `--no-duplicate-basename-check` option was removed.
- The `msvs_enable_marmasm` configuration option was removed in favor of
auto-inclusion of the "marmasm" sections for Windows on ARM.

## [0.4.0] - 2020-07-14

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

[Unreleased]: https://github.com/nodejs/gyp-next/compare/v0.4.0...HEAD
[Unreleased]: https://github.com/nodejs/gyp-next/compare/v0.6.0...HEAD
[0.6.0]: https://github.com/nodejs/gyp-next/compare/v0.5.0...v0.6.0
[0.5.0]: https://github.com/nodejs/gyp-next/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/nodejs/gyp-next/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/nodejs/gyp-next/compare/v0.2.1...v0.3.0
[0.2.1]: https://github.com/nodejs/gyp-next/compare/v0.2.0...v0.2.1
Expand Down
3 changes: 3 additions & 0 deletions gyp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ GYP can Generate Your Projects.
===================================

Documents are available at [gyp.gsrc.io](https://gyp.gsrc.io), or you can check out ```md-pages``` branch to read those documents offline.

__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:
* `python3 -m pip install gyp-next`
9 changes: 6 additions & 3 deletions gyp/pylib/gyp/MSVSSettings_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,8 @@ def testConvertToMSBuildSettings_warnings(self):
"MSBuild, index value (21) not in expected range [0, 3)",
"Warning: while converting VCCLCompilerTool/UsePrecompiledHeader to "
"MSBuild, index value (13) not in expected range [0, 3)",
"Warning: while converting VCCLCompilerTool/GeneratePreprocessedFile to "
"Warning: while converting "
"VCCLCompilerTool/GeneratePreprocessedFile to "
"MSBuild, value must be one of [0, 1, 2]; got 14",
"Warning: while converting VCLinkerTool/Driver to "
"MSBuild, index value (10) not in expected range [0, 4)",
Expand Down Expand Up @@ -1348,7 +1349,8 @@ def testConvertToMSBuildSettings_actual(self):
"EmbedManifest": "false",
"GenerateCatalogFiles": "true",
"InputResourceManifests": "asfsfdafs",
"ManifestResourceFile": "$(IntDir)\\$(TargetFileName).embed.manifest.resfdsf",
"ManifestResourceFile":
"$(IntDir)\\$(TargetFileName).embed.manifest.resfdsf",
"OutputManifestFile": "$(TargetPath).manifestdfs",
"RegistrarScriptFile": "sdfsfd",
"ReplacementsFile": "sdffsd",
Expand Down Expand Up @@ -1532,7 +1534,8 @@ def testConvertToMSBuildSettings_actual(self):
"LinkIncremental": "",
},
"ManifestResourceCompile": {
"ResourceOutputFileName": "$(IntDir)$(TargetFileName).embed.manifest.resfdsf"
"ResourceOutputFileName":
"$(IntDir)$(TargetFileName).embed.manifest.resfdsf"
},
}
self.maxDiff = 9999 # on failure display a long diff
Expand Down
17 changes: 0 additions & 17 deletions gyp/pylib/gyp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ def Load(
params=None,
check=False,
circular_check=True,
duplicate_basename_check=True,
):
"""
Loads one or more specified build files.
Expand Down Expand Up @@ -156,7 +155,6 @@ def Load(
generator_input_info,
check,
circular_check,
duplicate_basename_check,
params["parallel"],
params["root_targets"],
)
Expand Down Expand Up @@ -431,20 +429,6 @@ def gyp_main(args):
regenerate=False,
help="don't check for circular relationships between files",
)
# --no-duplicate-basename-check disables the check for duplicate basenames
# in a static_library/shared_library project. Visual C++ 2008 generator
# doesn't support this configuration. Libtool on Mac also generates warnings
# when duplicate basenames are passed into Make generator on Mac.
# TODO(yukawa): Remove this option when these legacy generators are
# deprecated.
parser.add_argument(
"--no-duplicate-basename-check",
dest="duplicate_basename_check",
action="store_false",
default=True,
regenerate=False,
help="don't check for duplicate basenames",
)
parser.add_argument(
"--no-parallel",
action="store_true",
Expand Down Expand Up @@ -651,7 +635,6 @@ def gyp_main(args):
params,
options.check,
options.circular_check,
options.duplicate_basename_check,
)

# TODO(mark): Pass |data| for now because the generator needs a list of
Expand Down
24 changes: 15 additions & 9 deletions gyp/pylib/gyp/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,14 @@ class Writer(object):
"""Wrapper around file which only covers the target if it differs."""

def __init__(self):
# On Cygwin remove the "dir" argument because `C:` prefixed paths are treated as relative,
# consequently ending up with current dir "/cygdrive/c/..." being prefixed to those, which was
# obviously a non-existent path, for example: "/cygdrive/c/<some folder>/C:\<my win style abs path>".
# See https://docs.python.org/2/library/tempfile.html#tempfile.mkstemp for more details
# On Cygwin remove the "dir" argument
# `C:` prefixed paths are treated as relative,
# consequently ending up with current dir "/cygdrive/c/..."
# being prefixed to those, which was
# obviously a non-existent path,
# for example: "/cygdrive/c/<some folder>/C:\<my win style abs path>".
# For more details see:
# https://docs.python.org/2/library/tempfile.html#tempfile.mkstemp
base_temp_dir = "" if IsCygwin() else os.path.dirname(filename)
# Pick temporary file.
tmp_fd, self.tmp_path = tempfile.mkstemp(
Expand Down Expand Up @@ -391,13 +395,15 @@ def close(self):
# one.
os.unlink(self.tmp_path)
else:
# The new file is different from the old one, or there is no old one.
# The new file is different from the old one,
# or there is no old one.
# Rename the new file to the permanent name.
#
# tempfile.mkstemp uses an overly restrictive mode, resulting in a
# file that can only be read by the owner, regardless of the umask.
# There's no reason to not respect the umask here, which means that
# an extra hoop is required to fetch it and reset the new file's mode.
# There's no reason to not respect the umask here,
# which means that an extra hoop is required
# to fetch it and reset the new file's mode.
#
# No way to get the umask without setting a new one? Set a safe one
# and then set it back to the old value.
Expand All @@ -406,8 +412,8 @@ def close(self):
os.chmod(self.tmp_path, 0o666 & ~umask)
if sys.platform == "win32" and os.path.exists(filename):
# NOTE: on windows (but not cygwin) rename will not replace an
# existing file, so it must be preceded with a remove. Sadly there
# is no way to make the switch atomic.
# existing file, so it must be preceded with a remove.
# Sadly there is no way to make the switch atomic.
os.remove(filename)
os.rename(self.tmp_path, filename)
except Exception:
Expand Down
2 changes: 1 addition & 1 deletion gyp/pylib/gyp/generator/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ def WriteSources(self, spec, configs, extra_sources):
These are source files necessary to build the current target.
We need to handle shared_intermediate directory source files as
a special case by copying them to the intermediate directory and
treating them as a genereated sources. Otherwise the Android build
treating them as a generated sources. Otherwise the Android build
rules won't pick them up.

Args:
Expand Down
Loading