@@ -3,7 +3,6 @@ import _, { compact, extend, find } from 'lodash'
33import os from 'os'
44import { browsers } from './browsers'
55import * as darwinHelper from './darwin'
6- import { needsDarwinWorkaround , darwinDetectionWorkaround } from './darwin/util'
76import { notDetectedAtPathErr } from './errors'
87import * as linuxHelper from './linux'
98import { log } from './log'
@@ -141,44 +140,13 @@ function checkOneBrowser (browser: Browser): Promise<boolean | HasVersion> {
141140}
142141
143142/** returns list of detected browsers */
144- export const detect = ( goalBrowsers ?: Browser [ ] , useDarwinWorkaround = true ) : Bluebird < FoundBrowser [ ] > => {
143+ export const detect = ( goalBrowsers ?: Browser [ ] ) : Bluebird < FoundBrowser [ ] > => {
145144 // we can detect same browser under different aliases
146145 // tell them apart by the name and the version property
147146 if ( ! goalBrowsers ) {
148147 goalBrowsers = browsers
149148 }
150149
151- // BigSur (darwin 20.x) and Electron 12+ cause huge performance issues when
152- // spawning child processes, which is the way we find browsers via execa.
153- // The performance cost is multiplied by the number of binary variants of
154- // each browser plus any fallback lookups we do.
155- // The workaround gets around this by breaking out of the bundled Electron
156- // Node.js and using the user's Node.js if possible. It only pays the cost
157- // of spawning a single child process instead of multiple. If this fails,
158- // we fall back to to the slower, default method
159- // https://github.com/cypress-io/cypress/issues/17773
160- if ( useDarwinWorkaround && needsDarwinWorkaround ( ) ) {
161- log ( 'using darwin detection workaround' )
162- if ( log . enabled ) {
163- // eslint-disable-next-line no-console
164- console . time ( 'time taken detecting browsers (darwin workaround)' )
165- }
166-
167- return Bluebird . resolve ( darwinDetectionWorkaround ( ) )
168- . catch ( ( err ) => {
169- log ( 'darwin workaround failed, falling back to normal detection' )
170- log ( err . stack )
171-
172- return detect ( goalBrowsers , false )
173- } )
174- . finally ( ( ) => {
175- if ( log . enabled ) {
176- // eslint-disable-next-line no-console
177- console . timeEnd ( 'time taken detecting browsers (darwin workaround)' )
178- }
179- } )
180- }
181-
182150 const removeDuplicates = ( val ) => {
183151 return _ . uniqBy ( val , ( browser : FoundBrowser ) => {
184152 return `${ browser . name } -${ browser . version } `
0 commit comments