Skip to content

Commit

Permalink
Merge branch 'master' into fetch-happen
Browse files Browse the repository at this point in the history
  • Loading branch information
imatlopez committed Jan 24, 2021
2 parents cd6d856 + cc1cbce commit 70fb316
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 57 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
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'
run: |
echo 'GYP_MSVS_VERSION=2015' >> $Env:GITHUB_ENV
echo 'GYP_MSVS_OVERRIDE_PATH=C:\\Dummy' >> $Env:GITHUB_ENV
- name: Lint Python
if: matrix.os == 'ubuntu-latest'
run: |
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ etc.), regardless of what version of Node.js is actually installed on your syste
You can install `node-gyp` using `npm`:

``` bash
$ npm install -g node-gyp
npm install -g node-gyp
```

Depending on your operating system, you will need to install:
Expand Down Expand Up @@ -71,15 +71,15 @@ version `node-gyp` should use in one of the following ways:
1. by setting the `--python` command-line option, e.g.:

``` bash
$ node-gyp <command> --python /path/to/executable/python
node-gyp <command> --python /path/to/executable/python
```

2. If `node-gyp` is called by way of `npm`, *and* you have multiple versions of
Python installed, then you can set `npm`'s 'python' config key to the appropriate
value:

``` bash
$ npm config set python /path/to/executable/python
npm config set python /path/to/executable/python
```

3. If the `PYTHON` environment variable is set to the path of a Python executable,
Expand All @@ -95,20 +95,20 @@ searching will be done.
To compile your native addon, first go to its root directory:

``` bash
$ cd my_node_addon
cd my_node_addon
```

The next step is to generate the appropriate project build files for the current
platform. Use `configure` for that:

``` bash
$ node-gyp configure
node-gyp configure
```

Auto-detection fails for Visual C++ Build Tools 2015, so `--msvs_version=2015`
needs to be added (not needed when run by npm as configured above):
``` bash
$ node-gyp configure --msvs_version=2015
node-gyp configure --msvs_version=2015
```

__Note__: The `configure` step looks for a `binding.gyp` file in the current
Expand All @@ -118,7 +118,7 @@ Now you will have either a `Makefile` (on Unix platforms) or a `vcxproj` file
(on Windows) in the `build/` directory. Next, invoke the `build` command:

``` bash
$ node-gyp build
node-gyp build
```

Now you have your compiled `.node` bindings file! The compiled bindings end up
Expand Down Expand Up @@ -214,13 +214,13 @@ For example, to set `devdir` equal to `/tmp/.gyp`, you would:
Run this on Unix:

```bash
$ export npm_config_devdir=/tmp/.gyp
export npm_config_devdir=/tmp/.gyp
```

Or this on Windows:

```console
> set npm_config_devdir=c:\temp\.gyp
set npm_config_devdir=c:\temp\.gyp
```

### `npm` configuration
Expand All @@ -230,7 +230,7 @@ Use the form `OPTION_NAME` for any of the command options listed above.
For example, to set `devdir` equal to `/tmp/.gyp`, you would run:

```bash
$ npm config set [--global] devdir /tmp/.gyp
npm config set [--global] devdir /tmp/.gyp
```

**Note:** Configuration set via `npm` will only be used when `node-gyp`
Expand Down
19 changes: 19 additions & 0 deletions gyp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## [0.7.0](https://www.github.com/nodejs/gyp-next/compare/v0.6.2...v0.7.0) (2020-12-17)


### ⚠ BREAKING CHANGES

* **msvs:** On Windows, arguments passed to the "action" commands are no longer transformed to replace slashes with backslashes.

### Features

* **xcode:** --cross-compiling overrides arch-specific settings ([973bae0](https://www.github.com/nodejs/gyp-next/commit/973bae0b7b08be7b680ecae9565fbd04b3e0787d))


### Bug Fixes

* **msvs:** do not fix paths in action command arguments ([fc22f83](https://www.github.com/nodejs/gyp-next/commit/fc22f8335e2016da4aae4f4233074bd651d2faea))
* cmake on python 3 ([fd61f5f](https://www.github.com/nodejs/gyp-next/commit/fd61f5faa5275ec8fc98e3c7868c0dd46f109540))
* ValueError: invalid mode: 'rU' while trying to load binding.gyp ([d0504e6](https://www.github.com/nodejs/gyp-next/commit/d0504e6700ce48f44957a4d5891b142a60be946f))
* xcode cmake parsing ([eefe8d1](https://www.github.com/nodejs/gyp-next/commit/eefe8d10e99863bc4ac7e2ed32facd608d400d4b))

### [0.6.2](https://www.github.com/nodejs/gyp-next/compare/v0.6.1...v0.6.2) (2020-10-16)


Expand Down
4 changes: 2 additions & 2 deletions gyp/pylib/gyp/generator/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
try:
# maketrans moved to str in python3.
_maketrans = string.maketrans
except NameError:
except (NameError, AttributeError):
_maketrans = str.maketrans

generator_default_variables = {
Expand Down Expand Up @@ -1047,7 +1047,7 @@ def WriteTarget(

# XCode settings
xcode_settings = config.get("xcode_settings", {})
for xcode_setting, xcode_value in xcode_settings.viewitems():
for xcode_setting, xcode_value in xcode_settings.items():
SetTargetProperty(
output,
cmake_target_name,
Expand Down
8 changes: 1 addition & 7 deletions gyp/pylib/gyp/generator/msvs.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,13 +423,7 @@ def _BuildCommandLineForRuleRaw(
# file out of the raw command string, and some commands (like python) are
# actually batch files themselves.
command.insert(0, "call")
# Fix the paths
# TODO(quote): This is a really ugly heuristic, and will miss path fixing
# for arguments like "--arg=path" or "/opt:path".
# If the argument starts with a slash or dash, it's probably a command line
# switch
arguments = [i if (i[:1] in "/-") else _FixPath(i) for i in cmd[1:]]
arguments = [i.replace("$(InputDir)", "%INPUTDIR%") for i in arguments]
arguments = [i.replace("$(InputDir)", "%INPUTDIR%") for i in cmd[1:]]
arguments = [MSVSSettings.FixVCMacroSlashes(i) for i in arguments]
if quote_cmd:
# Support a mode for using cmd directly.
Expand Down
2 changes: 1 addition & 1 deletion gyp/pylib/gyp/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def LoadOneBuildFile(build_file_path, data, aux_data, includes, is_target, check
# Open the build file for read ('r') with universal-newlines mode ('U')
# to make sure platform specific newlines ('\r\n' or '\r') are converted to '\n'
# which otherwise will fail eval()
if sys.platform == "zos":
if PY3 or sys.platform == "zos":
# On z/OS, universal-newlines mode treats the file as an ascii file.
# But since node-gyp produces ebcdic files, do not use that mode.
build_file_contents = open(build_file_path, "r").read()
Expand Down
69 changes: 37 additions & 32 deletions gyp/pylib/gyp/xcode_emulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,28 +654,32 @@ def GetCflags(self, configname, arch=None):
self._WarnUnimplemented("MACH_O_TYPE")
self._WarnUnimplemented("PRODUCT_TYPE")

if arch is not None:
archs = [arch]
else:
assert self.configname
archs = self.GetActiveArchs(self.configname)
if len(archs) != 1:
# TODO: Supporting fat binaries will be annoying.
self._WarnUnimplemented("ARCHS")
archs = ["i386"]
cflags.append("-arch " + archs[0])

if archs[0] in ("i386", "x86_64"):
if self._Test("GCC_ENABLE_SSE3_EXTENSIONS", "YES", default="NO"):
cflags.append("-msse3")
if self._Test(
"GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS", "YES", default="NO"
):
cflags.append("-mssse3") # Note 3rd 's'.
if self._Test("GCC_ENABLE_SSE41_EXTENSIONS", "YES", default="NO"):
cflags.append("-msse4.1")
if self._Test("GCC_ENABLE_SSE42_EXTENSIONS", "YES", default="NO"):
cflags.append("-msse4.2")
# If GYP_CROSSCOMPILE (--cross-compiling), disable architecture-specific
# additions and assume these will be provided as required via CC_host,
# CXX_host, CC_target and CXX_target.
if not gyp.common.CrossCompileRequested():
if arch is not None:
archs = [arch]
else:
assert self.configname
archs = self.GetActiveArchs(self.configname)
if len(archs) != 1:
# TODO: Supporting fat binaries will be annoying.
self._WarnUnimplemented("ARCHS")
archs = ["i386"]
cflags.append("-arch " + archs[0])

if archs[0] in ("i386", "x86_64"):
if self._Test("GCC_ENABLE_SSE3_EXTENSIONS", "YES", default="NO"):
cflags.append("-msse3")
if self._Test(
"GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS", "YES", default="NO"
):
cflags.append("-mssse3") # Note 3rd 's'.
if self._Test("GCC_ENABLE_SSE41_EXTENSIONS", "YES", default="NO"):
cflags.append("-msse4.1")
if self._Test("GCC_ENABLE_SSE42_EXTENSIONS", "YES", default="NO"):
cflags.append("-msse4.2")

cflags += self._Settings().get("WARNING_CFLAGS", [])

Expand Down Expand Up @@ -938,16 +942,17 @@ def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None):
+ gyp_to_build_path(self._Settings()["ORDER_FILE"])
)

if arch is not None:
archs = [arch]
else:
assert self.configname
archs = self.GetActiveArchs(self.configname)
if len(archs) != 1:
# TODO: Supporting fat binaries will be annoying.
self._WarnUnimplemented("ARCHS")
archs = ["i386"]
ldflags.append("-arch " + archs[0])
if not gyp.common.CrossCompileRequested():
if arch is not None:
archs = [arch]
else:
assert self.configname
archs = self.GetActiveArchs(self.configname)
if len(archs) != 1:
# TODO: Supporting fat binaries will be annoying.
self._WarnUnimplemented("ARCHS")
archs = ["i386"]
ldflags.append("-arch " + archs[0])

# Xcode adds the product directory by default.
# Rewrite -L. to -L./ to work around http://www.openradar.me/25313838
Expand Down
2 changes: 1 addition & 1 deletion gyp/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

setup(
name="gyp-next",
version="0.6.2",
version="0.7.0",
description="A fork of the GYP build system for use in the Node.js projects",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down
2 changes: 1 addition & 1 deletion macOS_Catalina.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ To see if `Xcode Command Line Tools` is installed in a way that will work with `
curl -sL https://github.com/nodejs/node-gyp/raw/master/macOS_Catalina_acid_test.sh | bash
```

If test succeeded, _you are done_! You should be ready to install `node-gyp`.
If test succeeded, _you are done_! You should be ready to [install](https://github.com/nodejs/node-gyp#installation) `node-gyp`.

If test failed, there is a problem with your Xcode Command Line Tools installation. [Continue to Solutions](#Solutions).

Expand Down

0 comments on commit 70fb316

Please sign in to comment.