Skip to content

Commit 813584e

Browse files
authored
fix: support dump_syms on macOS (#40)
2 parents 9d75f18 + f5f9ace commit 813584e

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
npm install minidump
77
```
88

9-
## Building
9+
## Building (for development)
1010

1111
* `git clone --recurse-submodules https://github.com/electron/node-minidump`
1212
* `npm install`

build.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
const fs = require('fs')
22
const path = require('path')
3-
const { spawnSync } = require('child_process')
3+
const childProcess = require('child_process')
4+
5+
function spawnSync (...args) {
6+
const result = childProcess.spawnSync(...args)
7+
if (result.status !== 0) {
8+
process.exit(result.status)
9+
}
10+
}
411

512
const buildDir = path.join(__dirname, 'build')
613
if (!fs.existsSync(buildDir)) {
714
fs.mkdirSync(buildDir, { recursive: true })
815
}
16+
917
spawnSync(path.join(__dirname, 'deps', 'breakpad', 'configure'), [], {
1018
cwd: buildDir,
1119
env: {
@@ -18,6 +26,13 @@ const targets = ['src/processor/minidump_stackwalk', 'src/processor/minidump_dum
1826
if (process.platform === 'linux') {
1927
targets.push('src/tools/linux/dump_syms/dump_syms')
2028
}
29+
2130
spawnSync('make', ['-C', buildDir, '-j', require('os').cpus().length, ...targets], {
2231
stdio: 'inherit'
2332
})
33+
34+
if (process.platform === 'darwin') {
35+
spawnSync('xcodebuild', ['-project', path.join(__dirname, 'deps', 'breakpad', 'src', 'tools', 'mac', 'dump_syms', 'dump_syms.xcodeproj'), 'build'], {
36+
stdio: 'inherit'
37+
})
38+
}

lib/minidump.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const commands = {
99
minidump_dump: path.resolve(__dirname, '..', 'build', 'src', 'processor', 'minidump_dump') + exe,
1010
dump_syms: (() => {
1111
if (process.platform === 'darwin') {
12-
return path.resolve(__dirname, '..', 'build', 'src', 'tools', 'mac', 'dump_syms', 'dump_syms_mac')
12+
return path.resolve(__dirname, '..', 'deps', 'breakpad', 'src', 'tools', 'mac', 'dump_syms', 'build', 'Release', 'dump_syms')
1313
} else if (process.platform === 'linux') {
1414
return path.resolve(__dirname, '..', 'build', 'src', 'tools', 'linux', 'dump_syms', 'dump_syms')
1515
}

test/minidump-test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ describe('minidump', function () {
7474

7575
describe('dumpSymbol()', function () {
7676
it('calls back with a minidump', function (done) {
77-
if (process.platform !== 'linux') return this.skip()
78-
7977
downloadElectron(function (error, binaryPath) {
8078
if (error) return done(error)
8179
minidump.dumpSymbol(binaryPath, function (error, minidump) {

0 commit comments

Comments
 (0)