-
Notifications
You must be signed in to change notification settings - Fork 171
Fix attach to process on arm64 Mac. #1917
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
Conversation
…4 mac. The primary issue was that we weren't building the attach.dylib for all targets; but even once we did that we had to ensure that we were exiting successfully after injecting into the process. We pulled in the compile changes from JetBrains/intellij-community@2e7109f Co-authored-by: @artemmukhin <Artem.Mukhin@jetbrains.com> Co-authored-by: Cole Miller <cole@zed.dev>
4e2182d
to
ba0bbba
Compare
@microsoft-github-policy-service agree company="Zed Industries" |
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
clang++ -fPIC -D_REENTRANT -std=c++11 -arch arm64 -c -o attach_arm64.o attach.cpp |
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 assume clang supports D_FORTIFY_SOURCE?. We have internal requirements on this flag being set or Microsoft security won't let us ship this binary. Can you try adding it back?
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.
And why use clang instead of g++? Could you continue to use g++ to create the other arch, and then just add the lipo
command?
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.
SRC to attach.cpp is off. Should likely be this: $SRC/linux_and_mac/attach.cpp
. I believe that's what is causing the build failure in the pipeline.
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.
The build script was pulled from JetBrains/intellij-community@2e7109f. I've pushed up a new version that is more like the original.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Thanks for the submission :). Should ship in our next release. Sometime before 3.14 goes GA I think. |
Great, thank you for the super fast turnaround. |
Before this change it was not possible to attach to a process on arm64 mac.
The primary issue was that we weren't building the attach.dylib for all targets; but even once we did that we had to ensure that we were exiting successfully after injecting into the process.
We pulled in the compile changes from JetBrains/intellij-community@2e7109f
Co-authored-by: @artemmukhin Artem.Mukhin@jetbrains.com
Co-authored-by: Cole Miller cole@zed.dev