summaryrefslogtreecommitdiff
path: root/lib/internal/v8_prof_polyfill.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/internal/v8_prof_polyfill.js')
-rw-r--r--lib/internal/v8_prof_polyfill.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/internal/v8_prof_polyfill.js b/lib/internal/v8_prof_polyfill.js
index 59e1b8947e..7d8d3ff020 100644
--- a/lib/internal/v8_prof_polyfill.js
+++ b/lib/internal/v8_prof_polyfill.js
@@ -48,8 +48,15 @@ const os = {
}
let out = cp.spawnSync(name, args).stdout.toString();
// Auto c++filt names, but not [iItT]
- if (process.platform === 'darwin' && name === 'nm')
+ if (process.platform === 'darwin' && name === 'nm') {
+ // nm prints an error along the lines of "Run xcodebuild -license" and
+ // exits when Xcode hasn't been properly installed or when its license
+ // hasn't been accepted yet. Basically any mention of xcodebuild in
+ // the output means the nm command is non-functional.
+ const match = out.match(/(?:^|\n)([^\n]*xcodebuild[^\n]*)(?:\n|$)/);
+ if (match) throw new Error(match[1]);
out = macCppfiltNm(out);
+ }
return out;
}
};