Skip to content

Commit b3392bc

Browse files
committed
chore: wip
1 parent 0eed87d commit b3392bc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/build-php.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,16 +1103,16 @@ exec "$@"
11031103
log('Building PHP...')
11041104
const jobs = execSync('nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2', { encoding: 'utf8' }).trim()
11051105

1106-
// Limit parallel jobs on macOS to prevent compilation hangs
1107-
const maxJobs = config.platform === 'darwin' ? Math.min(parseInt(jobs), 2) : parseInt(jobs)
1108-
log(`Using ${maxJobs} parallel jobs for compilation`)
1106+
// Disable parallel compilation on macOS to prevent hangs on mbstring and other extensions
1107+
const maxJobs = config.platform === 'darwin' ? 1 : parseInt(jobs)
1108+
log(`Using ${maxJobs} parallel jobs for compilation (${config.platform === 'darwin' ? 'sequential build for macOS stability' : 'parallel build'})`)
11091109

11101110
execSync(`make -j${maxJobs}`, {
11111111
stdio: 'inherit',
11121112
cwd: phpSourceDir,
11131113
env: buildEnv,
1114-
// Add timeout to prevent infinite hangs
1115-
timeout: 45 * 60 * 1000 // 45 minutes
1114+
// Add timeout to prevent infinite hangs - longer for sequential macOS builds
1115+
timeout: config.platform === 'darwin' ? 90 * 60 * 1000 : 45 * 60 * 1000 // 90 min for macOS, 45 min for others
11161116
})
11171117

11181118
log('Installing PHP...')

0 commit comments

Comments
 (0)