diff options
Diffstat (limited to 'deps/npm/node_modules/node-gyp/lib')
-rw-r--r-- | deps/npm/node_modules/node-gyp/lib/build.js | 4 | ||||
-rw-r--r-- | deps/npm/node_modules/node-gyp/lib/configure.js | 43 | ||||
-rw-r--r-- | deps/npm/node_modules/node-gyp/lib/find-vs2017.js | 6 | ||||
-rw-r--r-- | deps/npm/node_modules/node-gyp/lib/install.js | 28 |
4 files changed, 50 insertions, 31 deletions
diff --git a/deps/npm/node_modules/node-gyp/lib/build.js b/deps/npm/node_modules/node-gyp/lib/build.js index 0445fb6452..2f8e14c374 100644 --- a/deps/npm/node_modules/node-gyp/lib/build.js +++ b/deps/npm/node_modules/node-gyp/lib/build.js @@ -23,6 +23,10 @@ function build (gyp, argv, callback) { platformMake = 'gmake' } else if (process.platform.indexOf('bsd') !== -1) { platformMake = 'gmake' + } else if (win && argv.length > 0) { + argv = argv.map(function(target) { + return '/t:' + target + }) } var release = processRelease(argv, gyp, process.version, process.release) diff --git a/deps/npm/node_modules/node-gyp/lib/configure.js b/deps/npm/node_modules/node-gyp/lib/configure.js index 1351576d12..f141959bca 100644 --- a/deps/npm/node_modules/node-gyp/lib/configure.js +++ b/deps/npm/node_modules/node-gyp/lib/configure.js @@ -72,8 +72,10 @@ function configure (gyp, argv, callback) { return callback(new Error('Invalid version number: ' + release.version)) } - // ensure that the target node version's dev files are installed - gyp.opts.ensure = true + // If the tarball option is set, always remove and reinstall the headers + // into devdir. Otherwise only install if they're not already there. + gyp.opts.ensure = gyp.opts.tarball ? false : true + gyp.commands.install([ release.version ], function (err, version) { if (err) return callback(err) log.verbose('get node dir', 'target node version installed:', release.versionDir) @@ -242,28 +244,35 @@ function configure (gyp, argv, callback) { argv.push('-I', config) }) - // for AIX we need to set up the path to the exp file + // For AIX and z/OS we need to set up the path to the exports file // which contains the symbols needed for linking. - // The file will either be in one of the following - // depending on whether it is an installed or - // development environment: - // - the include/node directory - // - the out/Release directory - // - the out/Debug directory - // - the root directory var node_exp_file = undefined - if (process.platform === 'aix') { + if (process.platform === 'aix' || process.platform === 'os390') { + var ext = process.platform === 'aix' ? 'exp' : 'x' var node_root_dir = findNodeDirectory() - var candidates = ['include/node/node.exp', - 'out/Release/node.exp', - 'out/Debug/node.exp', - 'node.exp'] + var candidates = undefined + if (process.platform === 'aix') { + candidates = ['include/node/node', + 'out/Release/node', + 'out/Debug/node', + 'node' + ].map(function(file) { + return file + '.' + ext + }) + } else { + candidates = ['out/Release/obj.target/libnode', + 'out/Debug/obj.target/libnode', + 'lib/libnode' + ].map(function(file) { + return file + '.' + ext + }) + } var logprefix = 'find exports file' node_exp_file = findAccessibleSync(logprefix, node_root_dir, candidates) if (node_exp_file !== undefined) { log.verbose(logprefix, 'Found exports file: %s', node_exp_file) } else { - var msg = msgFormat('Could not find node.exp file in %s', node_root_dir) + var msg = msgFormat('Could not find node.%s file in %s', ext, node_root_dir) log.error(logprefix, 'Could not find exports file') return callback(new Error(msg)) } @@ -292,7 +301,7 @@ function configure (gyp, argv, callback) { argv.push('-Dlibrary=shared_library') argv.push('-Dvisibility=default') argv.push('-Dnode_root_dir=' + nodeDir) - if (process.platform === 'aix') { + if (process.platform === 'aix' || process.platform === 'os390') { argv.push('-Dnode_exp_file=' + node_exp_file) } argv.push('-Dnode_gyp_dir=' + nodeGypDir) diff --git a/deps/npm/node_modules/node-gyp/lib/find-vs2017.js b/deps/npm/node_modules/node-gyp/lib/find-vs2017.js index 8c79e9ec9b..ad46ceaf88 100644 --- a/deps/npm/node_modules/node-gyp/lib/find-vs2017.js +++ b/deps/npm/node_modules/node-gyp/lib/find-vs2017.js @@ -6,9 +6,9 @@ function findVS2017(callback) { var ps = path.join(process.env.SystemRoot, 'System32', 'WindowsPowerShell', 'v1.0', 'powershell.exe') var csFile = path.join(__dirname, 'Find-VS2017.cs') - var psArgs = ['-ExecutionPolicy', 'Unrestricted', '-Command', - '&{Add-Type -Path \'' + csFile + - '\'; [VisualStudioConfiguration.Main]::Query()}'] + var psArgs = ['-ExecutionPolicy', 'Unrestricted', '-NoProfile', + '-Command', '&{Add-Type -Path \'' + csFile + '\';' + + '[VisualStudioConfiguration.Main]::Query()}'] log.silly('find vs2017', 'Running', ps, psArgs) var child = execFile(ps, psArgs, { encoding: 'utf8' }, diff --git a/deps/npm/node_modules/node-gyp/lib/install.js b/deps/npm/node_modules/node-gyp/lib/install.js index fa2e1c5430..cb84972e18 100644 --- a/deps/npm/node_modules/node-gyp/lib/install.js +++ b/deps/npm/node_modules/node-gyp/lib/install.js @@ -1,7 +1,12 @@ +module.exports = exports = function (gyp, argv, callback) { + return install(fs, gyp, argv, callback) +} -module.exports = exports = install - -module.exports.test = { download: download, readCAFile: readCAFile } +module.exports.test = { + download: download, + install: install, + readCAFile: readCAFile, +} exports.usage = 'Install node development files for the specified node version.' @@ -20,12 +25,11 @@ var fs = require('graceful-fs') , semver = require('semver') , fstream = require('fstream') , request = require('request') - , minimatch = require('minimatch') , mkdir = require('mkdirp') , processRelease = require('./process-release') , win = process.platform == 'win32' -function install (gyp, argv, callback) { +function install (fs, gyp, argv, callback) { var release = processRelease(argv, gyp, process.version, process.release) @@ -84,7 +88,7 @@ function install (gyp, argv, callback) { log.verbose('install', 'version not already installed, continuing with install', release.version) go() } else if (err.code == 'EACCES') { - eaccesFallback() + eaccesFallback(err) } else { cb(err) } @@ -129,7 +133,7 @@ function install (gyp, argv, callback) { mkdir(devDir, function (err, created) { if (err) { if (err.code == 'EACCES') { - eaccesFallback() + eaccesFallback(err) } else { cb(err) } @@ -396,8 +400,8 @@ function install (gyp, argv, callback) { function valid (file) { // header files - return minimatch(file, '*.h', { matchBase: true }) || - minimatch(file, '*.gypi', { matchBase: true }) + var extname = path.extname(file); + return extname === '.h' || extname === '.gypi'; } /** @@ -409,7 +413,9 @@ function install (gyp, argv, callback) { * the compilation will succeed... */ - function eaccesFallback () { + function eaccesFallback (err) { + var noretry = '--node_gyp_internal_noretry' + if (-1 !== argv.indexOf(noretry)) return cb(err) var tmpdir = osenv.tmpdir() gyp.devDir = path.resolve(tmpdir, '.node-gyp') log.warn('EACCES', 'user "%s" does not have permission to access the dev dir "%s"', osenv.user(), devDir) @@ -418,7 +424,7 @@ function install (gyp, argv, callback) { log.verbose('tmpdir == cwd', 'automatically will remove dev files after to save disk space') gyp.todo.push({ name: 'remove', args: argv }) } - gyp.commands.install(argv, cb) + gyp.commands.install([noretry].concat(argv), cb) } } |