Socket
Socket
Sign inDemoInstall

node-gyp

Package Overview
Dependencies
Maintainers
4
Versions
145
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-gyp - npm Package Compare versions

Comparing version 6.0.1 to 6.1.0

.github/workflows/Python_tests.yml

44

CHANGELOG.md

@@ -0,1 +1,23 @@

v6.1.0 2019-01-08
=================
* [[`9a7dd16b76`](https://github.com/nodejs/node-gyp/commit/9a7dd16b76)] - **doc**: remove backticks from Python version list (Rod Vagg) [#2011](https://github.com/nodejs/node-gyp/pull/2011)
* [[`26cd6eaea6`](https://github.com/nodejs/node-gyp/commit/26cd6eaea6)] - **doc**: add GitHub Actions badge (#1994) (Rod Vagg) [#1994](https://github.com/nodejs/node-gyp/pull/1994)
* [[`312c12ef4f`](https://github.com/nodejs/node-gyp/commit/312c12ef4f)] - **doc**: update macOS\_Catalina.md (#1992) (James Home) [#1992](https://github.com/nodejs/node-gyp/pull/1992)
* [[`f7b6b6b77b`](https://github.com/nodejs/node-gyp/commit/f7b6b6b77b)] - **doc**: fix typo in README.md (#1985) (Suraneti Rodsuwan) [#1985](https://github.com/nodejs/node-gyp/pull/1985)
* [[`6b8f2652dd`](https://github.com/nodejs/node-gyp/commit/6b8f2652dd)] - **doc**: add travis badge (Rod Vagg) [#1971](https://github.com/nodejs/node-gyp/pull/1971)
* [[`20aa0b44f7`](https://github.com/nodejs/node-gyp/commit/20aa0b44f7)] - **doc**: macOS Catalina add two commands (Christian Clauss) [#1962](https://github.com/nodejs/node-gyp/pull/1962)
* [[`14f2a07a39`](https://github.com/nodejs/node-gyp/commit/14f2a07a39)] - **gyp**: list(dict) so we can del dict(key) while iterating (Christian Clauss) [#2009](https://github.com/nodejs/node-gyp/pull/2009)
* [[`f242ce4d2c`](https://github.com/nodejs/node-gyp/commit/f242ce4d2c)] - **lib**: compatibility with semver ≥ 7 (`new` for semver.Range) (Xavier Guimard) [#2006](https://github.com/nodejs/node-gyp/pull/2006)
* [[`3bcba2a01a`](https://github.com/nodejs/node-gyp/commit/3bcba2a01a)] - **(SEMVER-MINOR)** **lib**: noproxy support, match proxy detection to `request` (Matias Lopez) [#1978](https://github.com/nodejs/node-gyp/pull/1978)
* [[`470cc2178e`](https://github.com/nodejs/node-gyp/commit/470cc2178e)] - **test**: remove old docker test harness (#1993) (Rod Vagg) [#1993](https://github.com/nodejs/node-gyp/pull/1993)
* [[`31ecc8421d`](https://github.com/nodejs/node-gyp/commit/31ecc8421d)] - **test**: add Windows to GitHub Actions testing (#1996) (Christian Clauss) [#1996](https://github.com/nodejs/node-gyp/pull/1996)
* [[`5a729e86ee`](https://github.com/nodejs/node-gyp/commit/5a729e86ee)] - **test**: fix typo in header download test (#2001) (Richard Lau) [#2001](https://github.com/nodejs/node-gyp/pull/2001)
* [[`345c70e56d`](https://github.com/nodejs/node-gyp/commit/345c70e56d)] - **test**: direct python invocation & simpler pyenv (Matias Lopez) [#1979](https://github.com/nodejs/node-gyp/pull/1979)
* [[`d6a7e0e1fb`](https://github.com/nodejs/node-gyp/commit/d6a7e0e1fb)] - **test**: fix macOS Travis on Python 2.7 & 3.7 (Christian Clauss) [#1979](https://github.com/nodejs/node-gyp/pull/1979)
* [[`5a64e9bd32`](https://github.com/nodejs/node-gyp/commit/5a64e9bd32)] - **test**: initial Github Actions with Ubuntu & macOS (Christian Clauss) [#1985](https://github.com/nodejs/node-gyp/pull/1985)
* [[`04da736d38`](https://github.com/nodejs/node-gyp/commit/04da736d38)] - **test**: fix Python unittests (cclauss) [#1961](https://github.com/nodejs/node-gyp/pull/1961)
* [[`0670e5189d`](https://github.com/nodejs/node-gyp/commit/0670e5189d)] - **test**: add header download test (Rod Vagg) [#1796](https://github.com/nodejs/node-gyp/pull/1796)
* [[`c506a6a150`](https://github.com/nodejs/node-gyp/commit/c506a6a150)] - **test**: configure proper devDir for invoking configure() (Rod Vagg) [#1796](https://github.com/nodejs/node-gyp/pull/1796)
v6.0.1 2019-11-01

@@ -28,2 +50,24 @@ =================

v5.0.6 2019-12-16
=================
* [[`cdec00286f`](https://github.com/nodejs/node-gyp/commit/cdec00286f)] - **doc**: adjustments to the README.md for new users (Dan Pike) [#1919](https://github.com/nodejs/node-gyp/pull/1919)
* [[`b7c8233ef2`](https://github.com/nodejs/node-gyp/commit/b7c8233ef2)] - **test**: fix Python unittests (cclauss) [#1961](https://github.com/nodejs/node-gyp/pull/1961)
* [[`e12b00ab0a`](https://github.com/nodejs/node-gyp/commit/e12b00ab0a)] - **doc**: macOS Catalina add two commands (Christian Clauss) [#1962](https://github.com/nodejs/node-gyp/pull/1962)
* [[`70b9890c0d`](https://github.com/nodejs/node-gyp/commit/70b9890c0d)] - **test**: add header download test (Rod Vagg) [#1796](https://github.com/nodejs/node-gyp/pull/1796)
* [[`4029fa8629`](https://github.com/nodejs/node-gyp/commit/4029fa8629)] - **test**: configure proper devDir for invoking configure() (Rod Vagg) [#1796](https://github.com/nodejs/node-gyp/pull/1796)
* [[`fe8b02cc8b`](https://github.com/nodejs/node-gyp/commit/fe8b02cc8b)] - **doc**: add macOS\_Catalina.md document (cclauss) [#1940](https://github.com/nodejs/node-gyp/pull/1940)
* [[`8ea47ce365`](https://github.com/nodejs/node-gyp/commit/8ea47ce365)] - **gyp**: python3 fixes: utf8 decode, use of 'None' in eval (Wilfried Goesgens) [#1925](https://github.com/nodejs/node-gyp/pull/1925)
* [[`c7229716ba`](https://github.com/nodejs/node-gyp/commit/c7229716ba)] - **gyp**: iteritems() -\> items() in compile\_commands\_json.py (cclauss) [#1947](https://github.com/nodejs/node-gyp/pull/1947)
* [[`2a18b2a0f8`](https://github.com/nodejs/node-gyp/commit/2a18b2a0f8)] - **gyp**: make cmake python3 compatible (gengjiawen) [#1944](https://github.com/nodejs/node-gyp/pull/1944)
* [[`70f391e844`](https://github.com/nodejs/node-gyp/commit/70f391e844)] - **gyp**: fix TypeError in XcodeVersion() (Christian Clauss) [#1939](https://github.com/nodejs/node-gyp/pull/1939)
* [[`9f4f0fa34e`](https://github.com/nodejs/node-gyp/commit/9f4f0fa34e)] - **gyp**: finish decode stdout on Python 3 (Christian Clauss) [#1937](https://github.com/nodejs/node-gyp/pull/1937)
* [[`7cf507906d`](https://github.com/nodejs/node-gyp/commit/7cf507906d)] - **src,win**: allow 403 errors for arm64 node.lib (Richard Lau) [#1934](https://github.com/nodejs/node-gyp/pull/1934)
* [[`ad0d182c01`](https://github.com/nodejs/node-gyp/commit/ad0d182c01)] - **deps**: update deps to roughly match current npm@6 (Rod Vagg) [#1920](https://github.com/nodejs/node-gyp/pull/1920)
* [[`1553081ed6`](https://github.com/nodejs/node-gyp/commit/1553081ed6)] - **test**: upgrade Linux Travis CI to Python 3.8 (Christian Clauss) [#1923](https://github.com/nodejs/node-gyp/pull/1923)
* [[`0705cae9aa`](https://github.com/nodejs/node-gyp/commit/0705cae9aa)] - **travis**: ignore failed `brew upgrade npm`, update xcode (Christian Clauss) [#1932](https://github.com/nodejs/node-gyp/pull/1932)
* [[`7bfdb6f5bf`](https://github.com/nodejs/node-gyp/commit/7bfdb6f5bf)] - **build**: avoid bare exceptions in xcode\_emulation.py (Christian Clauss) [#1932](https://github.com/nodejs/node-gyp/pull/1932)
* [[`7edf7658fa`](https://github.com/nodejs/node-gyp/commit/7edf7658fa)] - **lib,install**: always download SHA sums on Windows (Sam Hughes) [#1926](https://github.com/nodejs/node-gyp/pull/1926)
* [[`69056d04fe`](https://github.com/nodejs/node-gyp/commit/69056d04fe)] - **travis**: add Windows + Python 3.8 to the mix (Rod Vagg) [#1921](https://github.com/nodejs/node-gyp/pull/1921)
v5.0.5 2019-10-04

@@ -30,0 +74,0 @@ =================

2

lib/find-python.js

@@ -229,3 +229,3 @@ 'use strict'

const range = semver.Range(this.semverRange)
const range = new semver.Range(this.semverRange)
var valid = false

@@ -232,0 +232,0 @@ try {

@@ -14,2 +14,3 @@ 'use strict'

const win = process.platform === 'win32'
const getProxyFromURI = require('./proxy')

@@ -414,6 +415,3 @@ function install (fs, gyp, argv, callback) {

// basic support for a proxy server
var proxyUrl = gyp.opts.proxy ||
env.http_proxy ||
env.HTTP_PROXY ||
env.npm_config_proxy
var proxyUrl = getProxyFromURI(gyp, env, url)
if (proxyUrl) {

@@ -420,0 +418,0 @@ if (/^https?:\/\//i.test(proxyUrl)) {

@@ -70,2 +70,3 @@ 'use strict'

proxy: String, // 'install'
noproxy: String, // 'install'
devdir: String, // everywhere

@@ -72,0 +73,0 @@ nodedir: String, // 'configure'

# Installation notes for macOS Catalina (v10.15)
_This document specifically refers to upgrades from previous versions of macOS to Catalina (10.15). It should be removed from the source repository when Catalina ceases to be the latest macOS version or updated to deal with challenges involved in upgrades to the next version of macOS._
_This document specifically refers to upgrades from previous versions of macOS to Catalina (10.15). It should be removed from the source repository when Catalina ceases to be the latest macOS version or when future Catalina versions no longer raise these issues._
Lessons learned from:
* https://github.com/nodejs/node-gyp/issues/1779
* https://github.com/nodejs/node-gyp/issues/1861
* https://github.com/nodejs/node-gyp/issues/1927 and elsewhere
**Upgrading to macOS Catalina may cause normal `node-gyp` installations to fail.**
Installing `node-gyp` on macOS can be found at https://github.com/nodejs/node-gyp#on-macos
However, upgrading to macOS Catalina changes some settings that may cause normal `node-gyp` installations to fail.
### Is my Mac running macOS Catalina?
Let's make first make sure that your Mac is currently running Catalina:
% `sw_vers`
Let's first make sure that your Mac is running Catalina:
```
% sw_vers
ProductName: Mac OS X
ProductVersion: 10.15
BuildVersion: 19A602
```
If `ProductVersion` is less then `10.15` then this document is not for you. Normal install docs for `node-gyp` on macOS can be found at https://github.com/nodejs/node-gyp#on-macos
If `ProductVersion` is less then `10.15` then this document is not really for you.
### The acid test
Next, lets see if `Xcode Command Line Tools` are installed:
To see if `Xcode Command Line Tools` is installed in a way that will work with `node-gyp`, run:
1. `/usr/sbin/pkgutil --packages | grep CL`
* If nothing is listed, then [skip to the next section](#Two-roads).
* If `com.apple.pkg.CLTools_Executables` is listed then try:
* `com.apple.pkg.CLTools_Executables` should be listed. If it isn't, this test failed.
2. `/usr/sbin/pkgutil --pkg-info com.apple.pkg.CLTools_Executables`
* If `version: 11.0.0` or later is listed then _you are done_! Your Mac should be ready to install `node-gyp`. Doing `clang -v` should show `Apple clang version 11.0.0` or later.
* `version: 11.0.0` (or later) should be listed. If it isn't, this test failed.
If both tests succeeded, _you are done_! You should be ready to install `node-gyp`.
As you go through the remainder of this document, at anytime you can try these `acid test` commands. If they pass then your Mac should be ready to install `node-gyp`.
If either test failed, there is a problem with your Xcode Command Line Tools installation. [Continue to Solutions](#Solutions).
### Two roads
There are two main ways to install `node-gyp` on macOS:
### Solutions
There are three ways to install the Xcode libraries `node-gyp` needs on macOS. People running Catalina have had success with some but not others in a way that has been unpredictable.
1. With the full Xcode (~7.6 GB download) from the `App Store` app.
2. With the _much_ smaller Xcode Command Line Tools via `xcode-select --install`
3. With the _much_ smaller Xcode Command Line Tools via manual download. **For people running the latest version of Catalina (10.15.2 at the time of this writing), this has worked when the other two solutions haven't.**

@@ -41,3 +39,5 @@ ### Installing `node-gyp` using the full Xcode

* If not, then install/upgrade Xcode from the App Store app.
2. Open the Xcode app and allow it to do an essential install of the most recent compiler tools.
2. Open the Xcode app and...
* Under __Preferences > Locations__ select the tools if their location is empty.
* Allow Xcode app to do an essential install of the most recent compiler tools.
3. Once all installations are _complete_, quit out of Xcode.

@@ -54,3 +54,3 @@ 4. `sudo xcodebuild -license accept` # If you agree with the licensing terms.

### Installing `node-gyp` using the Xcode Command Line Tools
### Installing `node-gyp` using the Xcode Command Line Tools via `xcode-select --install`
1. If the _acid test_ has not succeeded, then try `xcode-select --install`

@@ -67,2 +67,7 @@ 2. Wait until the install process is _complete_.

### Installing `node-gyp` using the Xcode Command Line Tools via manual download
1. Download the appropriate version of the "Command Line Tools for Xcode" for your version of Catalina from developer.apple.com/download. As of MacOS 10.15.2, that's Command_Line_Tools_for_Xcode_11.3.dmg
2. Install the package.
3. Run the _acid test_.
### I did all that and the acid test still does not pass :-(

@@ -72,2 +77,11 @@ 1. `sudo rm -rf $(xcode-select -print-path)` # Enter root password. No output is normal.

3. If the [_acid test_](#The-acid-test) still does _not_ pass then...
4. Add a comment to https://github.com/nodejs/node-gyp/issues/1927 so we can improve.
4. `npm explore npm -g -- npm install node-gyp@latest`
5. `npm explore npm -g -- npm explore npm-lifecycle -- npm install node-gyp@latest`
6. If the _acid test_ still does _not_ pass then...
7. Add a comment to https://github.com/nodejs/node-gyp/issues/1927 so we can improve.
Lessons learned from:
* https://github.com/nodejs/node-gyp/issues/1779
* https://github.com/nodejs/node-gyp/issues/1861
* https://github.com/nodejs/node-gyp/issues/1927 and elsewhere
* Thanks to @rrrix for discovering Solution 3

@@ -14,3 +14,3 @@ {

],
"version": "6.0.1",
"version": "6.1.0",
"installVersion": 9,

@@ -17,0 +17,0 @@ "author": "Nathan Rajlich <nathan@tootallnate.net> (http://tootallnate.net)",

# `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)
`node-gyp` is a cross-platform command-line tool written in Node.js for

@@ -17,3 +20,3 @@ compiling native addon modules for Node.js. It contains a fork of the

* The same build commands work on any of the supported platforms
* Supports the targetting of different versions of Node.js
* Supports the targeting of different versions of Node.js

@@ -32,3 +35,3 @@ ## Installation

* `Python v2.7, v3.5, v3.6, or v3.7`
* Python v2.7, v3.5, v3.6, or v3.7
* `make`

@@ -39,3 +42,3 @@ * A proper C/C++ compiler toolchain, like [GCC](https://gcc.gnu.org)

* `Python v2.7, v3.5, v3.6, or v3.7`
* Python v2.7, v3.5, v3.6, or v3.7
* [Xcode](https://developer.apple.com/xcode/download/)

@@ -197,3 +200,4 @@ * You also need to install the `XCode Command Line Tools` by running `xcode-select --install`. Alternatively, if you already have the full Xcode installed, you can find them under the menu `Xcode -> Open Developer Tool -> More Developer Tools...`. This step will install `clang`, `clang++`, and `make`.

| `--dist-url=$url` | Download header tarball from custom URL
| `--proxy=$url` | Set HTTP proxy for downloading header tarball
| `--proxy=$url` | Set HTTP(S) proxy for downloading header tarball
| `--noproxy=$urls` | Set urls to ignore proxies when downloading header tarball
| `--cafile=$cafile` | Override default CA chain (to download tarball)

@@ -200,0 +204,0 @@ | `--nodedir=$path` | Set the path to the node source code

@@ -5,2 +5,3 @@ 'use strict'

const path = require('path')
const devDir = require('./common').devDir()
const gyp = require('../lib/node-gyp')

@@ -34,2 +35,3 @@ const requireInject = require('require-inject')

}
prog.devDir = devDir
configure(prog, [], t.fail)

@@ -54,2 +56,3 @@ })

}
prog.devDir = devDir
configure(prog, [], t.fail)

@@ -76,3 +79,4 @@ })

}
prog.devDir = devDir
configure(prog, [], t.fail)
})

@@ -9,4 +9,9 @@ 'use strict'

const install = require('../lib/install')
const semver = require('semver')
const devDir = require('./common').devDir()
const rimraf = require('rimraf')
const gyp = require('../lib/node-gyp')
const log = require('npmlog')
require('npmlog').level = 'warn'
log.level = 'warn'

@@ -89,2 +94,97 @@ test('download over http', function (t) {

test('download over http with proxy', function (t) {
t.plan(2)
var server = http.createServer(function (req, res) {
t.strictEqual(req.headers['user-agent'],
'node-gyp v42 (node ' + process.version + ')')
res.end('ok')
pserver.close(function () {
server.close()
})
})
var pserver = http.createServer(function (req, res) {
t.strictEqual(req.headers['user-agent'],
'node-gyp v42 (node ' + process.version + ')')
res.end('proxy ok')
server.close(function () {
pserver.close()
})
})
var host = 'localhost'
server.listen(0, host, function () {
var port = this.address().port
pserver.listen(port + 1, host, function () {
var gyp = {
opts: {
proxy: 'http://' + host + ':' + (port + 1)
},
version: '42'
}
var url = 'http://' + host + ':' + port
var req = install.test.download(gyp, {}, url)
req.on('response', function (res) {
var body = ''
res.setEncoding('utf8')
res.on('data', function (data) {
body += data
})
res.on('end', function () {
t.strictEqual(body, 'proxy ok')
})
})
})
})
})
test('download over http with noproxy', function (t) {
t.plan(2)
var server = http.createServer(function (req, res) {
t.strictEqual(req.headers['user-agent'],
'node-gyp v42 (node ' + process.version + ')')
res.end('ok')
pserver.close(function () {
server.close()
})
})
var pserver = http.createServer(function (req, res) {
t.strictEqual(req.headers['user-agent'],
'node-gyp v42 (node ' + process.version + ')')
res.end('proxy ok')
server.close(function () {
pserver.close()
})
})
var host = 'localhost'
server.listen(0, host, function () {
var port = this.address().port
pserver.listen(port + 1, host, function () {
var gyp = {
opts: {
proxy: 'http://' + host + ':' + (port + 1),
noproxy: 'localhost'
},
version: '42'
}
var url = 'http://' + host + ':' + port
var req = install.test.download(gyp, {}, url)
req.on('response', function (res) {
var body = ''
res.setEncoding('utf8')
res.on('data', function (data) {
body += data
})
res.on('end', function () {
t.strictEqual(body, 'ok')
})
})
})
})
})
test('download with missing cafile', function (t) {

@@ -108,1 +208,64 @@ t.plan(1)

})
// only run this test if we are running a version of Node with predictable version path behavior
test('download headers (actual)', function (t) {
if (process.env.FAST_TEST ||
process.release.name !== 'node' ||
semver.prerelease(process.version) !== null ||
semver.satisfies(process.version, '<10')) {
return t.skip('Skipping actual download of headers due to test environment configuration')
}
t.plan(17)
const expectedDir = path.join(devDir, process.version.replace(/^v/, ''))
rimraf(expectedDir, (err) => {
t.ifError(err)
const prog = gyp()
prog.parseArgv([])
prog.devDir = devDir
log.level = 'warn'
install(prog, [], (err) => {
t.ifError(err)
fs.readFile(path.join(expectedDir, 'installVersion'), 'utf8', (err, data) => {
t.ifError(err)
t.strictEqual(data, '9\n', 'correct installVersion')
})
fs.readdir(path.join(expectedDir, 'include/node'), (err, list) => {
t.ifError(err)
t.ok(list.includes('common.gypi'))
t.ok(list.includes('config.gypi'))
t.ok(list.includes('node.h'))
t.ok(list.includes('node_version.h'))
t.ok(list.includes('openssl'))
t.ok(list.includes('uv'))
t.ok(list.includes('uv.h'))
t.ok(list.includes('v8-platform.h'))
t.ok(list.includes('v8.h'))
t.ok(list.includes('zlib.h'))
})
fs.readFile(path.join(expectedDir, 'include/node/node_version.h'), 'utf8', (err, contents) => {
t.ifError(err)
const lines = contents.split('\n')
// extract the 3 version parts from the defines to build a valid version string and
// and check them against our current env version
const version = ['major', 'minor', 'patch'].reduce((version, type) => {
const re = new RegExp(`^#define\\sNODE_${type.toUpperCase()}_VERSION`)
const line = lines.find((l) => re.test(l))
const i = line ? parseInt(line.replace(/^[^0-9]+([0-9]+).*$/, '$1'), 10) : 'ERROR'
return `${version}${type !== 'major' ? '.' : 'v'}${i}`
}, '')
t.strictEqual(version, process.version)
})
})
})
})

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc