Commit graph

80 commits

Author SHA1 Message Date
Luke Karrys
d52997e975 feat: convert internal classes from util.inherits to classes
BREAKING CHANGE: the `Gyp` class exported is now created using
ECMAScript classes and therefore might have small differences to classes
that were previously created with `util.inherits`.
2023-10-28 09:29:04 -07:00
Luke Karrys
355622f4aa feat: convert all internal functions to async/await
BREAKING CHANGE: All internal functions have been coverted to return
promises and no longer accept callbacks. This is not a breaking change
for users but may be breaking to consumers of `node-gyp` if you are
requiring internal functions directly.
2023-10-28 08:59:57 -07:00
James Cook
53c99ae573
Fix reading msvs version on Windows (#2644)
* fix: fix reading msvs version on windows
2023-06-25 17:35:41 +02:00
Luke Karrys
192eec2aca
Sync deps and engines with npm (#2770)
* feat!: update `engines.node` to `^14.17.0 || ^16.13.0 || >=18.0.0`

* deps: nopt@^7.0.0

* feat: replace npmlog with proc-log

* deps: standard@17.0.0 and fix linting errors

* deps: which@3.0.0
- this also promiisifies the build command

* deps: glob@8.0.3

* feat: drop rimraf dependency

* fix: use fs/promises in favor of fs.promises
2023-06-20 15:44:18 +02:00
Cheng Zhao
eef4eefccb fix: _ in npm_config_ env variables 2022-02-16 10:48:47 +11:00
Cheng Zhao
a27dc08696 feat: build with config.gypi from node headers 2021-11-05 20:08:28 +11:00
Matias Lopez
3bcba2a01a
lib: noproxy support, match proxy detection to request
PR-URL: https://github.com/nodejs/node-gyp/pull/1978
Reviewed-By: Rod Vagg <rod@vagg.org>
2019-12-16 10:53:03 +11:00
Rod Vagg
ab2a4cc209
src: update to standard@14
PR-URL: https://github.com/nodejs/node-gyp/pull/1899
Reviewed-By: João Reis <reis@janeasystems.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-10-02 13:57:30 +10:00
Rod Vagg
e40c99e283
src: implement standard.js linting
In addition:

* moved module.exports to the bottom
* no single-line if statements
* no if statements without a {
* const for requires
* array declarations get spaces inside [ ]
* 'use strict' in all .js files

PR-URL: https://github.com/nodejs/node-gyp/pull/1794
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: João Reis <reis@janeasystems.com>
2019-07-06 14:36:37 +10:00
Rod Vagg
611bc3c89f
lib: add .json suffix for explicit require
Multiple reports of this failing, seems to be due to node wrapping tools
that mess with the require extensions. So let's be explicit about it.

PR-URL: https://github.com/nodejs/node-gyp/pull/1787
Reviewed-By: Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-06-21 12:24:21 +10:00
Jon Moss
a5b7410497
Add ESLint no-unused-vars rule
- Uses `.eslintrc.yaml` for configuration
- `npm run lint` is part of `npm test`

PR-URL: https://github.com/nodejs/node-gyp/pull/1497
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: João Reis <reis@janeasystems.com>
2019-04-24 10:27:29 +10:00
Jon Moss
9e46872ea3
bin,lib: remove extra comments/lines/spaces
- Removes "module dependencies" comments and things that, IMHO, don't add
too much value. Happy to add back if helps some people when reading
through `node-gyp`.
- DRY up `lib/process-release.js`.
- Removes a bunch of extra blank lines, as well as random spaces.

PR-URL: https://github.com/nodejs/node-gyp/pull/1508
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2019-04-24 10:27:29 +10:00
Ben Noordhuis
9c8d275526 Add --devdir flag.
Overrides the location where node-gyp will look for (and download to)
the node.js SDK.

For harmonization with the --nodedir flag, `osenv.home()` is now used
instead of `process.env.HOME || process.env.USERPROFILE`.

`osenv.home()` defaults to the built-in `os.homedir()` when available
and falls back to sane defaults based on the platform.

`%USERPROFILE%` is now preferred on Windows and `%HOME%` is ignored;
similarly, UNIX systems ignore `$USERPROFILE` from now on.  Neither
behavior made much sense, IMO.

Fixes: https://github.com/nodejs/node-gyp/issues/21
PR-URL: https://github.com/nodejs/node-gyp/pull/916
Reviewed-By: Rod Vagg <rod@vagg.org>
2016-10-07 10:34:53 +02:00
Gibson Fahnestock
c8c7ca86b9 Add --silent option for zero output.
Passing --silent is equivalent to passing --loglevel=silent.

PR-URL: https://github.com/nodejs/node-gyp/pull/937
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-05-31 11:34:37 +02:00
Ben Noordhuis
8c4b0ffa50 Add --cafile command line option.
Add an option for overriding the default CA chain that is used when
downloading the tarball.  This matches the npm option of the same
name and gets implicitly passed through the `npm_config_cafile`
environment variable.

Fixes: https://github.com/nodejs/node-gyp/issues/695
PR-URL: https://github.com/nodejs/node-gyp/pull/837
Reviewed-By: Rod Vagg <rod@vagg.org>
2015-12-10 14:08:19 +01:00
Ben Noordhuis
2ac7de02c4 Fix infinite loop with zero-length options.
The bundled copy of GYP enters an infinite loop when it encounters a
zero-length option so ensure those don't get through.

The root cause is a bad guard in gyp/pylib/gyp/input.py that doesn't
take into account that `'' in 'whatever'` evaluates to True.

Upstream fix at https://codereview.chromium.org/1364373004/.

Fixes: https://github.com/nodejs/node-gyp/issues/744
PR-URL: https://github.com/nodejs/node-gyp/pull/745
Reviewed-By: Nathan Rajlich <nathan@tootallnate.net>
2015-09-25 21:40:49 +02:00
Ben Noordhuis
0fbc387b35 Update repository URLs.
The project was moved from https://github.com/TooTallNate/node-gyp to
https://github.com/nodejs/node-gyp.  Update a handful of links that
still pointed to the old location.

PR-URL: https://github.com/nodejs/node-gyp/pull/715
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
2015-09-06 06:41:01 +02:00
Dane Springmeyer
b9cbe70155 use stdio instead of customFds - refs joyent/node#8492 2014-11-11 13:36:01 -08:00
Nathan Rajlich
e82e4387be node-gyp: remove lie in --help output
Sub-command --help does not work, at this time.
2014-03-11 15:53:17 -03:00
vinayr
0cc243e459 install: add --tarball option
Squashed commit of the following:

commit f6d0838f1ddbf09ad91633a7bafa06bbbe7e8365
Author: vinayr <vinay.rv@gmail.com>
Date:   Sun Oct 20 18:09:47 2013 +0900

    changed tarball-url to tarball

commit 080bf66fb27586033f79657d91463232976fde8a
Merge: a06f16f f28088a
Author: vin <vin@vin-VirtualBox.(none)>
Date:   Sun Oct 20 18:03:56 2013 +0900

    Merge remote-tracking branch 'upstream/master'

commit a06f16f645922bfae491cd1b6bb12ca55619bd5b
Author: vinayr <vinay.rv@gmail.com>
Date:   Wed Sep 4 15:08:53 2013 +0900

    set tarball url

commit 003ec4ade5803e3fca397acbf5b303fa7291056e
Author: vinayr <vinay.rv@gmail.com>
Date:   Wed Sep 4 14:17:19 2013 +0900

    set tarball url

Closes #321.
2013-10-20 11:28:11 -07:00
Nathan Rajlich
b4302a3db2 node-gyp: fix lint 2013-06-24 14:24:24 -07:00
Nathan Rajlich
c4bb689abb node-gyp: add "module exports" header comment 2013-06-24 14:12:00 -07:00
Magnus Hoff
b00c81e041 Added diagnostic error message when missing HOME environmental variable 2013-06-19 17:54:43 +03:00
Elan Ruusamäe
be288a75fc add -j N alias for build
this way one could add short jobs alias, similar to make(1):
$ node-gyp build -j 1

unfortunately it's not exactly the same as make, as -j1 is not
understood by nopt i guess
2013-04-07 23:01:00 +03:00
Nathan Rajlich
078ab27480 disable "thin" static libraries by default
Older linkers don't have the -T flag.

This is a somewhat experimental feature, so if user's want "thin"
archives, they can specify `--thin` to revert to the original behavior.
2013-03-08 15:42:19 -08:00
Nathan Rajlich
6667bffd18 build: make "--jobs=8" work (as opposed to only env variable) 2012-10-02 11:32:15 -07:00
Maciej Małecki
ab8e4b4291 install: allow for configuring dist url
Closes #141.
2012-10-01 17:28:45 -07:00
Nathan Rajlich
3265b12295 configure: add "python" to the nopt config definition
Makes "node-gyp rebuild --python /usr/bin/python26`
(with " " instead of "=") work properly. Fixes #123.
2012-08-17 08:40:52 -07:00
Nathan Rajlich
6d8d7b1d32 make node-gyp -v and node-gyp --version work as expected 2012-07-31 10:44:26 -07:00
Nathan Rajlich
0ecebad23c inherit *all* config values from npm
This could be potentially dangerous to gyp scripts... but it seems to work for me.
2012-07-25 17:04:05 -07:00
Nathan Rajlich
4b9097a5d3 bin: better args handling for chained commands
Now this works:

 $ node-gyp rm 0.8.0 rm 0.8.2 rm 0.8.3
2012-07-16 16:14:05 -07:00
Nathan Rajlich
981bc54666 build: allow for the make command to be overwritten with --make=gmake or MAKE=gmake 2012-07-04 16:46:07 -07:00
isaacs
e3d0a0fa4f Add 'gyp' log heading 2012-06-15 09:15:37 -07:00
Nathan Rajlich
633e62362e make aliased commands act more like their counterpart 2012-06-06 18:24:11 -07:00
Nathan Rajlich
eca4f00a9f better "spawn" logging 2012-06-06 18:24:01 -07:00
Nathan Rajlich
c3a16a1c84 log the spawn() commands 2012-06-06 18:17:45 -07:00
Nathan Rajlich
47de81f963 initial take at using 'npmlog' for logging
* adds a '--loglevel' switch to node-gyp which accepts the same values as npm
 * now the '--verbose' flag is simply an alias to '--loglevel=verbose'
 * this simplifies the code a bit, since any logging logic is now removed
 * more log levels! it's mostly verbose() and info() being used
   * still need to go back and move some of logging calls to a better level
2012-06-06 18:01:08 -07:00
Nathan Rajlich
16a54b69de me -> self 2012-06-06 15:47:51 -07:00
Nathan Rajlich
470f04efeb added support for inheriting config env variable from npm
So you can pass node-gyp-specific flags to npm, and node-gyp will
automatically use them:

  $ npm install weak --nodedir=`pwd` --prefix=`pwd`

Part of #70.
2012-05-27 00:43:00 -07:00
Nathan Rajlich
a89c9069bb --nodedir is only for "configure" 2012-05-14 17:06:13 -07:00
Jeroen Janssen
d314430f8c workaround for ~ homedir expansion 2012-05-14 23:48:51 +02:00
Jeroen Janssen
f64a7af819 rework based on review 2012-05-14 23:24:19 +02:00
Nathan Rajlich
c8904f9fb5 make node-gyp -d build work for a Debug build 2012-04-14 13:20:09 -07:00
Nathan Rajlich
f014cec5a8 Support multiple commands that execute serially.
Fixes #30.
2012-04-08 17:07:17 -07:00
Nathan Rajlich
b40ecaba78 Add a "-C/--directory" switch.
Fixes #50.
2012-04-08 16:16:50 -07:00
Nathan Rajlich
fb18a81a32 Add "warn" log setting 2012-04-08 16:15:47 -07:00
Nathan Rajlich
f1082e5773 use graceful-fs everywhere 2012-04-05 17:19:29 -07:00
Nathan Rajlich
a1855361d8 core: fix the HOME dir detection on Windows 7 2012-03-30 20:03:23 -07:00
Nathan Rajlich
ae39e1adb3 core: centralize the dev dir logic into node-gyp.js 2012-03-30 20:02:27 -07:00
Nathan Rajlich
62e5851e54 core: comments 2012-03-30 19:53:15 -07:00