summaryrefslogtreecommitdiff
path: root/deps/npm/lib/install/action/extract.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/lib/install/action/extract.js')
-rw-r--r--deps/npm/lib/install/action/extract.js43
1 files changed, 23 insertions, 20 deletions
diff --git a/deps/npm/lib/install/action/extract.js b/deps/npm/lib/install/action/extract.js
index e8d7a6c4f6..c1c17cdf6c 100644
--- a/deps/npm/lib/install/action/extract.js
+++ b/deps/npm/lib/install/action/extract.js
@@ -2,6 +2,7 @@
const BB = require('bluebird')
+const figgyPudding = require('figgy-pudding')
const stat = BB.promisify(require('graceful-fs').stat)
const gentlyRm = BB.promisify(require('../../utils/gently-rm.js'))
const mkdirp = BB.promisify(require('mkdirp'))
@@ -9,8 +10,8 @@ const moduleStagingPath = require('../module-staging-path.js')
const move = require('../../utils/move.js')
const npa = require('npm-package-arg')
const npm = require('../../npm.js')
+let npmConfig
const packageId = require('../../utils/package-id.js')
-let pacoteOpts
const path = require('path')
const localWorker = require('./extract-worker.js')
const workerFarm = require('worker-farm')
@@ -19,19 +20,12 @@ const isRegistry = require('../../utils/is-registry.js')
const WORKER_PATH = require.resolve('./extract-worker.js')
let workers
-// NOTE: temporarily disabled on non-OSX due to ongoing issues:
-//
-// * Seems to make Windows antivirus issues much more common
-// * Messes with Docker (I think)
-//
-// There are other issues that should be fixed that affect OSX too:
-//
-// * Logging is messed up right now because pacote does its own thing
-// * Global deduplication in pacote breaks due to multiple procs
-//
-// As these get fixed, we can start experimenting with re-enabling it
-// at least on some platforms.
-const ENABLE_WORKERS = process.platform === 'darwin'
+const ExtractOpts = figgyPudding({
+ log: {}
+}, { other () { return true } })
+
+// Disabled for now. Re-enable someday. Just not today.
+const ENABLE_WORKERS = false
extract.init = () => {
if (ENABLE_WORKERS) {
@@ -53,10 +47,10 @@ module.exports = extract
function extract (staging, pkg, log) {
log.silly('extract', packageId(pkg))
const extractTo = moduleStagingPath(staging, pkg)
- if (!pacoteOpts) {
- pacoteOpts = require('../../config/pacote')
+ if (!npmConfig) {
+ npmConfig = require('../../config/figgy-config.js')
}
- const opts = pacoteOpts({
+ let opts = ExtractOpts(npmConfig()).concat({
integrity: pkg.package._integrity,
resolved: pkg.package._resolved
})
@@ -72,9 +66,18 @@ function extract (staging, pkg, log) {
args[0] = spec.raw
if (ENABLE_WORKERS && (isRegistry(spec) || spec.type === 'remote')) {
// We can't serialize these options
- opts.loglevel = opts.log.level
- opts.log = null
- opts.dirPacker = null
+ opts = opts.concat({
+ loglevel: opts.log.level,
+ log: null,
+ dirPacker: null,
+ Promise: null,
+ _events: null,
+ _eventsCount: null,
+ list: null,
+ sources: null,
+ _maxListeners: null,
+ root: null
+ })
// workers will run things in parallel!
launcher = workers
try {