2
2
3
3
const BB = require ( 'bluebird' )
4
4
5
+ const figgyPudding = require ( 'figgy-pudding' )
5
6
const stat = BB . promisify ( require ( 'graceful-fs' ) . stat )
6
7
const gentlyRm = BB . promisify ( require ( '../../utils/gently-rm.js' ) )
7
8
const mkdirp = BB . promisify ( require ( 'mkdirp' ) )
8
9
const moduleStagingPath = require ( '../module-staging-path.js' )
9
10
const move = require ( '../../utils/move.js' )
10
11
const npa = require ( 'npm-package-arg' )
11
12
const npm = require ( '../../npm.js' )
13
+ const npmConfig = require ( '../../config/figgy-config.js' )
12
14
const packageId = require ( '../../utils/package-id.js' )
13
- let pacoteOpts
14
15
const path = require ( 'path' )
15
16
const localWorker = require ( './extract-worker.js' )
16
17
const workerFarm = require ( 'worker-farm' )
@@ -19,19 +20,12 @@ const isRegistry = require('../../utils/is-registry.js')
19
20
const WORKER_PATH = require . resolve ( './extract-worker.js' )
20
21
let workers
21
22
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
35
29
36
30
extract . init = ( ) => {
37
31
if ( ENABLE_WORKERS ) {
@@ -53,10 +47,7 @@ module.exports = extract
53
47
function extract ( staging , pkg , log ) {
54
48
log . silly ( 'extract' , packageId ( pkg ) )
55
49
const extractTo = moduleStagingPath ( staging , pkg )
56
- if ( ! pacoteOpts ) {
57
- pacoteOpts = require ( '../../config/pacote' )
58
- }
59
- const opts = pacoteOpts ( {
50
+ let opts = ExtractOpts ( npmConfig ( ) ) . concat ( {
60
51
integrity : pkg . package . _integrity ,
61
52
resolved : pkg . package . _resolved
62
53
} )
@@ -72,9 +63,18 @@ function extract (staging, pkg, log) {
72
63
args [ 0 ] = spec . raw
73
64
if ( ENABLE_WORKERS && ( isRegistry ( spec ) || spec . type === 'remote' ) ) {
74
65
// 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
+ } )
78
78
// workers will run things in parallel!
79
79
launcher = workers
80
80
try {
0 commit comments