Skip to content

Commit 70fb316

Browse files
committed
Merge branch 'master' into fetch-happen
2 parents cd6d856 + cc1cbce commit 70fb316

File tree

9 files changed

+75
-57
lines changed

9 files changed

+75
-57
lines changed

.github/workflows/tests.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ jobs:
3131
pip install flake8 pytest
3232
- name: Set Windows environment
3333
if: matrix.os == 'windows-latest'
34-
run:
35-
echo '::set-env name=GYP_MSVS_VERSION::2015'
36-
echo '::set-env name=GYP_MSVS_OVERRIDE_PATH::C:\\Dummy'
34+
run: |
35+
echo 'GYP_MSVS_VERSION=2015' >> $Env:GITHUB_ENV
36+
echo 'GYP_MSVS_OVERRIDE_PATH=C:\\Dummy' >> $Env:GITHUB_ENV
3737
- name: Lint Python
3838
if: matrix.os == 'ubuntu-latest'
3939
run: |

README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ etc.), regardless of what version of Node.js is actually installed on your syste
2323
You can install `node-gyp` using `npm`:
2424

2525
``` bash
26-
$ npm install -g node-gyp
26+
npm install -g node-gyp
2727
```
2828

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

7373
``` bash
74-
$ node-gyp <command> --python /path/to/executable/python
74+
node-gyp <command> --python /path/to/executable/python
7575
```
7676

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

8181
``` bash
82-
$ npm config set python /path/to/executable/python
82+
npm config set python /path/to/executable/python
8383
```
8484

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

9797
``` bash
98-
$ cd my_node_addon
98+
cd my_node_addon
9999
```
100100

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

104104
``` bash
105-
$ node-gyp configure
105+
node-gyp configure
106106
```
107107

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

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

120120
``` bash
121-
$ node-gyp build
121+
node-gyp build
122122
```
123123

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

216216
```bash
217-
$ export npm_config_devdir=/tmp/.gyp
217+
export npm_config_devdir=/tmp/.gyp
218218
```
219219

220220
Or this on Windows:
221221

222222
```console
223-
> set npm_config_devdir=c:\temp\.gyp
223+
set npm_config_devdir=c:\temp\.gyp
224224
```
225225

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

232232
```bash
233-
$ npm config set [--global] devdir /tmp/.gyp
233+
npm config set [--global] devdir /tmp/.gyp
234234
```
235235

236236
**Note:** Configuration set via `npm` will only be used when `node-gyp`

gyp/CHANGELOG.md

+19
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Changelog
22

3+
## [0.7.0](https://www.github.com/nodejs/gyp-next/compare/v0.6.2...v0.7.0) (2020-12-17)
4+
5+
6+
### ⚠ BREAKING CHANGES
7+
8+
* **msvs:** On Windows, arguments passed to the "action" commands are no longer transformed to replace slashes with backslashes.
9+
10+
### Features
11+
12+
* **xcode:** --cross-compiling overrides arch-specific settings ([973bae0](https://www.github.com/nodejs/gyp-next/commit/973bae0b7b08be7b680ecae9565fbd04b3e0787d))
13+
14+
15+
### Bug Fixes
16+
17+
* **msvs:** do not fix paths in action command arguments ([fc22f83](https://www.github.com/nodejs/gyp-next/commit/fc22f8335e2016da4aae4f4233074bd651d2faea))
18+
* cmake on python 3 ([fd61f5f](https://www.github.com/nodejs/gyp-next/commit/fd61f5faa5275ec8fc98e3c7868c0dd46f109540))
19+
* ValueError: invalid mode: 'rU' while trying to load binding.gyp ([d0504e6](https://www.github.com/nodejs/gyp-next/commit/d0504e6700ce48f44957a4d5891b142a60be946f))
20+
* xcode cmake parsing ([eefe8d1](https://www.github.com/nodejs/gyp-next/commit/eefe8d10e99863bc4ac7e2ed32facd608d400d4b))
21+
322
### [0.6.2](https://www.github.com/nodejs/gyp-next/compare/v0.6.1...v0.6.2) (2020-10-16)
423

524

gyp/pylib/gyp/generator/cmake.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
try:
4242
# maketrans moved to str in python3.
4343
_maketrans = string.maketrans
44-
except NameError:
44+
except (NameError, AttributeError):
4545
_maketrans = str.maketrans
4646

4747
generator_default_variables = {
@@ -1047,7 +1047,7 @@ def WriteTarget(
10471047

10481048
# XCode settings
10491049
xcode_settings = config.get("xcode_settings", {})
1050-
for xcode_setting, xcode_value in xcode_settings.viewitems():
1050+
for xcode_setting, xcode_value in xcode_settings.items():
10511051
SetTargetProperty(
10521052
output,
10531053
cmake_target_name,

gyp/pylib/gyp/generator/msvs.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -423,13 +423,7 @@ def _BuildCommandLineForRuleRaw(
423423
# file out of the raw command string, and some commands (like python) are
424424
# actually batch files themselves.
425425
command.insert(0, "call")
426-
# Fix the paths
427-
# TODO(quote): This is a really ugly heuristic, and will miss path fixing
428-
# for arguments like "--arg=path" or "/opt:path".
429-
# If the argument starts with a slash or dash, it's probably a command line
430-
# switch
431-
arguments = [i if (i[:1] in "/-") else _FixPath(i) for i in cmd[1:]]
432-
arguments = [i.replace("$(InputDir)", "%INPUTDIR%") for i in arguments]
426+
arguments = [i.replace("$(InputDir)", "%INPUTDIR%") for i in cmd[1:]]
433427
arguments = [MSVSSettings.FixVCMacroSlashes(i) for i in arguments]
434428
if quote_cmd:
435429
# Support a mode for using cmd directly.

gyp/pylib/gyp/input.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def LoadOneBuildFile(build_file_path, data, aux_data, includes, is_target, check
231231
# Open the build file for read ('r') with universal-newlines mode ('U')
232232
# to make sure platform specific newlines ('\r\n' or '\r') are converted to '\n'
233233
# which otherwise will fail eval()
234-
if sys.platform == "zos":
234+
if PY3 or sys.platform == "zos":
235235
# On z/OS, universal-newlines mode treats the file as an ascii file.
236236
# But since node-gyp produces ebcdic files, do not use that mode.
237237
build_file_contents = open(build_file_path, "r").read()

gyp/pylib/gyp/xcode_emulation.py

+37-32
Original file line numberDiff line numberDiff line change
@@ -654,28 +654,32 @@ def GetCflags(self, configname, arch=None):
654654
self._WarnUnimplemented("MACH_O_TYPE")
655655
self._WarnUnimplemented("PRODUCT_TYPE")
656656

657-
if arch is not None:
658-
archs = [arch]
659-
else:
660-
assert self.configname
661-
archs = self.GetActiveArchs(self.configname)
662-
if len(archs) != 1:
663-
# TODO: Supporting fat binaries will be annoying.
664-
self._WarnUnimplemented("ARCHS")
665-
archs = ["i386"]
666-
cflags.append("-arch " + archs[0])
667-
668-
if archs[0] in ("i386", "x86_64"):
669-
if self._Test("GCC_ENABLE_SSE3_EXTENSIONS", "YES", default="NO"):
670-
cflags.append("-msse3")
671-
if self._Test(
672-
"GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS", "YES", default="NO"
673-
):
674-
cflags.append("-mssse3") # Note 3rd 's'.
675-
if self._Test("GCC_ENABLE_SSE41_EXTENSIONS", "YES", default="NO"):
676-
cflags.append("-msse4.1")
677-
if self._Test("GCC_ENABLE_SSE42_EXTENSIONS", "YES", default="NO"):
678-
cflags.append("-msse4.2")
657+
# If GYP_CROSSCOMPILE (--cross-compiling), disable architecture-specific
658+
# additions and assume these will be provided as required via CC_host,
659+
# CXX_host, CC_target and CXX_target.
660+
if not gyp.common.CrossCompileRequested():
661+
if arch is not None:
662+
archs = [arch]
663+
else:
664+
assert self.configname
665+
archs = self.GetActiveArchs(self.configname)
666+
if len(archs) != 1:
667+
# TODO: Supporting fat binaries will be annoying.
668+
self._WarnUnimplemented("ARCHS")
669+
archs = ["i386"]
670+
cflags.append("-arch " + archs[0])
671+
672+
if archs[0] in ("i386", "x86_64"):
673+
if self._Test("GCC_ENABLE_SSE3_EXTENSIONS", "YES", default="NO"):
674+
cflags.append("-msse3")
675+
if self._Test(
676+
"GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS", "YES", default="NO"
677+
):
678+
cflags.append("-mssse3") # Note 3rd 's'.
679+
if self._Test("GCC_ENABLE_SSE41_EXTENSIONS", "YES", default="NO"):
680+
cflags.append("-msse4.1")
681+
if self._Test("GCC_ENABLE_SSE42_EXTENSIONS", "YES", default="NO"):
682+
cflags.append("-msse4.2")
679683

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

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

941-
if arch is not None:
942-
archs = [arch]
943-
else:
944-
assert self.configname
945-
archs = self.GetActiveArchs(self.configname)
946-
if len(archs) != 1:
947-
# TODO: Supporting fat binaries will be annoying.
948-
self._WarnUnimplemented("ARCHS")
949-
archs = ["i386"]
950-
ldflags.append("-arch " + archs[0])
945+
if not gyp.common.CrossCompileRequested():
946+
if arch is not None:
947+
archs = [arch]
948+
else:
949+
assert self.configname
950+
archs = self.GetActiveArchs(self.configname)
951+
if len(archs) != 1:
952+
# TODO: Supporting fat binaries will be annoying.
953+
self._WarnUnimplemented("ARCHS")
954+
archs = ["i386"]
955+
ldflags.append("-arch " + archs[0])
951956

952957
# Xcode adds the product directory by default.
953958
# Rewrite -L. to -L./ to work around http://www.openradar.me/25313838

gyp/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
setup(
1717
name="gyp-next",
18-
version="0.6.2",
18+
version="0.7.0",
1919
description="A fork of the GYP build system for use in the Node.js projects",
2020
long_description=long_description,
2121
long_description_content_type="text/markdown",

macOS_Catalina.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ To see if `Xcode Command Line Tools` is installed in a way that will work with `
4040
curl -sL https://github.com/nodejs/node-gyp/raw/master/macOS_Catalina_acid_test.sh | bash
4141
```
4242

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

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

0 commit comments

Comments
 (0)