-
-
Notifications
You must be signed in to change notification settings - Fork 32k
gh-95973: Add a new --with-dsymutil option to link debug information in macOS #95974
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
Note to self: add |
The easy solution is to add this option unconditionally. It should be harmless for non-lto builds. That said, I haven't checked if the linker will complain/warn if the option is used with a non-lto build. |
e93fbb8
to
28c1209
Compare
It doesn't as long as you also pass --lto. The most difficult part was generate unique names per linkage target. I have opted to place a templated expansion so the makefile inserts the rule name. The actual name of the file is not important as long as is unique per linked object but this helps identify what files belong to what linked objects. |
@ronaldoussoren If you have some time available, could you review and approve the PR? |
0d464d2
to
f589747
Compare
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.
One thing I noticed while playing with the PR is that it doesn't run dsymutil on the shared library when building --enable-framework
. Given the makefile stanza I expect the same problem with --enable-shared
.
Both should be easy enough to fix, but I don't have a proposed fixed at this time. I should have some more time to look into this after work.
Ah, we are also missing installing the dLYB files when running |
Ok I fixed this, but it still doesn't handle |
I am handling |
That should be enough to handle a framework installation as well. The PR looks fine now, although I haven't tested yet if this is enough to see debug information when using an installed copy of python. |
Awesome. Give it a go and if everything looks good we can land it 👍 |
Here is a backtrace from a installed Python with a
|
The latest version of the PR doesn't work for me with a framework install, I get an error during installation due to the invocation of dsymutil in the altbininstall target. I've configured with End of the regular build looks ok:
But installing fails with:
The error is expected here because The solution is to change LIBDIR to PYTHONFRAMEWORKPREFIX in the last command in that block. That is, to:
Although that likely breaks a regular shared installation... That appears to be enough, I get this backtrace after moving the source directory aside:
And do get a source listing when I keep the source directory as-is, but remove the build directory. |
Ah, I think we need to make that conditional to the framework vs --enable-shared installation |
@ronaldoussoren can you check if commit f544cfa does the trick? |
I'll review and test this in the next couple of days. |
This version works for me. One minor issue: The makefile in One thing I haven't looked into yet, and could be looked at later: Debugging the x86_64 fork of a Universal2 build of the framework doesn't work for me (error from LLDB and SIGABRT from the launched executable). That feels like a different issue though, esp. given that my development laptop is using an Xcode 14 beta. |
I plan to land this at the end of the week if possible to avoid merge conflicts. If you need more time to review, please indicate this in the comments :) |
On it |
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 change looks good (with the macOS
change) and I've tested it with a number of different build configurations, certainly not exhaustive but enough to be satisfied that the changes do not obviously break anything and, in fact, provide a very useful enhancement. Thanks for doing this!
(Since my comment on the earlier resolution is hard to see after the additional commit, I'll also note here that Mac OS
refers to the old legacy "classic" MacOS that was retired 20+ years ago. The current Mac operating system that Apple (and we) support has had three names so far over its lifetime: Mac OS X
, OS X
, and, since 2016, macOS
. While there are still inconsistent references in our code base, we should be using the correct term in new code.)
…ation in MacOS Signed-off-by: Pablo Galindo <[email protected]>
Signed-off-by: Pablo Galindo <[email protected]>
Status check is done, and it's a success ✅ . |
Automerge-Triggered-By: GH:pablogsal