-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: support dump_syms on macOS #40
Conversation
59766ed
to
49a2fda
Compare
038a912
to
03fefd3
Compare
@nornagon This fixes the build for Linux. But for some reason, MacOS does not build. Could you look into this? I don't have a Mac. |
I'm confused, this already works on macOS.
builds just fine on my macOS machine. What support is this adding for macOS? |
@nornagon How does it build when the target is not added to build.js, and how do you use the package when the executable does not exist. Line 12 in 9d75f18
|
@aminya oh, i see, this specifically adds |
Yes. That's what Atom uses minidump for. The dump_syms support of Mac was dropped at some point. It was working in the old versions of node-minidump. Anyways, I don't have a Mac machine, and I was trying to fix this by live chatting with one of my friends and asking back and forth to try my branch. We have gone this far, but it is really hard for me to fix the problem fully. This is the latest log I have got from them. From the log, it seems that it is building. cc: @utkarshgupta137 |
The |
Whichever method that works would be great! |
On my machine when I check this out and run |
We can remove |
I think it's fine to just document in the README that this repo should be cloned with |
By the way, I noticed that breakpad already ships with Windows binaries. We can just add Windows support by adding this line: Line 15 in 9d75f18
|
hmm, i'm not sure how i feel about using a random binary from the repo instead of building from source. how often is that binary updated? is it 32-bit or 64-bit? perhaps better to support that than nothing though... also, it's a shame to have just |
For now, if you don't mind let's just include this commit for Windows. Building other features from the source can be done later. I can confirm that dump_syms.exe test passes now on Windows. |
@aminya CI doesn't currently run on a Windows configuration—happy to use the current test without modification, but it's not useful unless we run it! You'll need to edit As for it being "official binaries" and "trustable", that doesn't cover the full spectrum of my concerns around shipping binary blobs. But, some support is better than no support, I think, so I'm OK going with this direction for now. |
Other tests on Windows fail, so running CI on Windows will result in red arrows. So, currently the dump_syms test pass but other ones require more work. I am afraid I can't do this in a near future. So, if you just accept this minor change for Windows, it would be good, otherwise, I will just revert the commit. > [email protected] test C:\Users\aminy\Documents\GitHub\JavaScript\@atom\node-minidump
> mocha test && standard
minidump
walkStack()
macOS dump
1) calls back with a report
Windows dump
2) calls back with a report
Linux dump
3) calls back with a report
dumpSymbol()
4) calls back with a minidump
dump()
5) calls back with minidump info
moduleList()
on a Linux dump
√ calls back with a module list
on a Windows dump
√ calls back with a module list
on a macOS dump
√ calls back with a module list
3 passing (7s)
5 failing
1) minidump walkStack() macOS dump calls back with a report:
Uncaught Error: spawn C:\Users\aminy\Documents\GitHub\JavaScript\@atom\node-minidump\build\src\processor\minidump_stackwalk.exe ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:276:19)
at onErrorNT (node:internal/child_process:476:16)
at processTicksAndRejections (node:internal/process/task_queues:80:21)
2) minidump walkStack() Windows dump calls back with a report:
Uncaught Error: spawn C:\Users\aminy\Documents\GitHub\JavaScript\@atom\node-minidump\build\src\processor\minidump_stackwalk.exe ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:276:19)
at onErrorNT (node:internal/child_process:476:16)
at processTicksAndRejections (node:internal/process/task_queues:80:21)
3) minidump walkStack() Linux dump calls back with a report:
Uncaught Error: spawn C:\Users\aminy\Documents\GitHub\JavaScript\@atom\node-minidump\build\src\processor\minidump_stackwalk.exe ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:276:19)
at onErrorNT (node:internal/child_process:476:16)
at processTicksAndRejections (node:internal/process/task_queues:80:21)
4) minidump dumpSymbol() calls back with a minidump:
Error: CoCreateInstance CLSID_DiaSource {E6756135-1E65-4D17-8576-610761398C3C} failed (msdia*.dll unregistered?)
Open failed
at ChildProcess.<anonymous> (lib\minidump.js:33:25)
at ChildProcess.emit (node:events:376:20)
at maybeClose (node:internal/child_process:1063:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:295:5)
5) minidump dump() calls back with minidump info:
Uncaught Error: spawn C:\Users\aminy\Documents\GitHub\JavaScript\@atom\node-minidump\build\src\processor\minidump_dump.exe ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:276:19)
at onErrorNT (node:internal/child_process:476:16)
at processTicksAndRejections (node:internal/process/task_queues:80:21) |
This reverts commit 8bddbe7.
Sorry, the test does not actually pass, it fails with another error rather the spawn error. |
Travis has become very slow lately. It failed to download Electron. Could you reset the failed job. |
@nornagon Could you merge this? I reverted the Windows changes. |
package.json
Outdated
"build": "node build.js", | ||
"submodule": "git submodule update --recursive --init", | ||
"prepublishOnly": "npm run submodule && npm run build", | ||
"postinstall": "npm run build" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still not convinced this is correct, preinstall
scripts run when the package is a dependency. I checked this with the following steps:
$ mkdir test && cd test
$ cat > package.json
{
"dependencies": {
"minidump": "*"
}
}
^D
$ npm install
The preinstall
script ran and the module was compiled.
"build": "node build.js", | |
"submodule": "git submodule update --recursive --init", | |
"prepublishOnly": "npm run submodule && npm run build", | |
"postinstall": "npm run build" | |
"preinstall": "node build.js" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll commit the dump_syms on macOS code for now and we can come back to the submodule/install stuff later if we need to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
At the minimum, you should not remove prepublishOnly! That way, you or someone else may forgot to instantiate submodules, and they publish the package without instantiating the submodules that are the required files
-
preinstall works but it does not make sense here. It works because minidump does not use any dependency in build.js. postinstall is more general. It allows bootstrapping the dependencies, and then running the build. -> Using preinstall also makes it impossible to use prepublishOnly.
Hi folks... I get this error on my machine with this PR landed. It's because I don't have a full Xcode install, just the command line tools.
That raises the requirements for building this package beyond the usual "Xcode OR command line tools" to strictly requiring a full Xcode install, unlike most of the Node ecosystem. I understand that the third-party (Edit: Or even better, magically make it buildable with just the command line tools? If someone knows how, that would be great.) Thanks. |
@nornagon @aminya can you try this with newer There are several commits since the submodule was last synced that claim to "fix the mac build" in various ways. Including supposedly fixing the non-Xcode build. (I'm hopeful this would negate the need for calling Here's some links to review those commits: log of If updating the submodule, please sync with breakpad's How to properly update a submodule: https://stackoverflow.com/a/5828396 Edit: I'm not very familiar with building C/C++ projects, but I'm trying to build this myself without Xcode. No luck so far. Edit: There's more mac fixes in the review queue for upstream |
Updating the breakpad submodule is a separate issue. You should have xcode to build Mac apps. If you want to write a manual make file, go ahead. But I don't think |
Xcode is the full graphical IDE app. You can get all the basic stuff (like Regarding this PR: I'm only missing the I can open a separate issue about this, I guess... But my point is: it's inconvenient to need full Xcode just for this feature no-one has needed yet. (I noticed that Atom doesn't need this feature to fix its CI issue; |
Before this PR the dump_syms executable simply "did not exist".
Instead of banning everyone else that has xcodebuld from using dump_syms on MacOs, you'd better set up a multi-os CI that builds the binaries and includes them in the package. breakpad already includes Windows binaries, so there is no need for rebuilding them in the CI. Something like this that I do for the native build addons: The build script needs to change once the binaries are included:
After this PR, that fswin error popped up. So, I recommended sadick to ignore that error. We can wrap dump_syms function in a try-catch as it is an optional operation. |
This would be a good solution for folks like me, if the electron team is interested in it. (Or make it configurable: look for an environment variable such as |
@nornagon When can we expect a release with this fix? |
In addition to the prebuilt binaries, I'd love to have a build that works without |
Thanks for the ping, but I'm only slightly acquainted with C/C++, so the chances I can fix this any time soon seem kind of slim at the moment. (I'm not sure exactly how to fully read the build scripts at the moment, so fixing them seems beyond reach.) For what it's worth, I tried (in my own not-acquainted-with-C way) building things in the latest |
I can reproduce that (Tested and confirmed installable with And Atom's CI appears to validate that his fork ( |
This fixes the scripts:
This is blocking electron upgrade of Atom
atom/atom#21777