22
33const BB = require ( 'bluebird' )
44
5+ const figgyPudding = require ( 'figgy-pudding' )
56const stat = BB . promisify ( require ( 'graceful-fs' ) . stat )
67const gentlyRm = BB . promisify ( require ( '../../utils/gently-rm.js' ) )
78const mkdirp = BB . promisify ( require ( 'mkdirp' ) )
89const moduleStagingPath = require ( '../module-staging-path.js' )
910const move = require ( '../../utils/move.js' )
1011const npa = require ( 'npm-package-arg' )
1112const npm = require ( '../../npm.js' )
13+ const npmConfig = require ( '../../config/figgy-config.js' )
1214const packageId = require ( '../../utils/package-id.js' )
13- let pacoteOpts
1415const path = require ( 'path' )
1516const localWorker = require ( './extract-worker.js' )
1617const workerFarm = require ( 'worker-farm' )
@@ -19,19 +20,12 @@ const isRegistry = require('../../utils/is-registry.js')
1920const WORKER_PATH = require . resolve ( './extract-worker.js' )
2021let workers
2122
22- // NOTE: temporarily disabled on non-OSX due to ongoing issues:
23- //
24- // * Seems to make Windows antivirus issues much more common
25- // * Messes with Docker (I think)
26- //
27- // There are other issues that should be fixed that affect OSX too:
28- //
29- // * Logging is messed up right now because pacote does its own thing
30- // * Global deduplication in pacote breaks due to multiple procs
31- //
32- // As these get fixed, we can start experimenting with re-enabling it
33- // at least on some platforms.
34- const ENABLE_WORKERS = process . platform === 'darwin'
23+ const ExtractOpts = figgyPudding ( {
24+ log : { }
25+ } , { other ( ) { return true } } )
26+
27+ // Disabled for now. Re-enable someday. Just not today.
28+ const ENABLE_WORKERS = false
3529
3630extract . init = ( ) => {
3731 if ( ENABLE_WORKERS ) {
@@ -53,10 +47,7 @@ module.exports = extract
5347function extract ( staging , pkg , log ) {
5448 log . silly ( 'extract' , packageId ( pkg ) )
5549 const extractTo = moduleStagingPath ( staging , pkg )
56- if ( ! pacoteOpts ) {
57- pacoteOpts = require ( '../../config/pacote' )
58- }
59- const opts = pacoteOpts ( {
50+ let opts = ExtractOpts ( npmConfig ( ) ) . concat ( {
6051 integrity : pkg . package . _integrity ,
6152 resolved : pkg . package . _resolved
6253 } )
@@ -72,9 +63,18 @@ function extract (staging, pkg, log) {
7263 args [ 0 ] = spec . raw
7364 if ( ENABLE_WORKERS && ( isRegistry ( spec ) || spec . type === 'remote' ) ) {
7465 // We can't serialize these options
75- opts . loglevel = opts . log . level
76- opts . log = null
77- opts . dirPacker = null
66+ opts = opts . concat ( {
67+ loglevel : opts . log . level ,
68+ log : null ,
69+ dirPacker : null ,
70+ Promise : null ,
71+ _events : null ,
72+ _eventsCount : null ,
73+ list : null ,
74+ sources : null ,
75+ _maxListeners : null ,
76+ root : null
77+ } )
7878 // workers will run things in parallel!
7979 launcher = workers
8080 try {
0 commit comments