Skip to content

[Backtracing] Add support for looking up paths for auxiliary executables #63964

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

Merged
merged 8 commits into from
Mar 3, 2023

Conversation

al45tair
Copy link
Contributor

@al45tair al45tair commented Feb 28, 2023

We need to be able to locate swift-backtrace relative to the current location of the runtime library.

This needs to work:

In a Swift build directory.
On Darwin, where we're installed in /usr/lib/swift and /usr/libexec/swift.
On Linux, where we're in /usr/lib/swift/linux and /usr/libexec/swift/linux.
On Windows, where we may be in a flat directory layout (because of limitations of Windows DLL lookups).

rdar://103071801

@al45tair
Copy link
Contributor Author

I had to duplicate the original PR from al45tair#8, which was reviewed by @mikeash and @grynspan, as I couldn't get that PR to point at apple:main.

al45tair added 4 commits March 1, 2023 13:43
…les.

We need to be able to locate `swift-backtrace` relative to the current
location of the runtime library.

This needs to work:

* In a Swift build directory.
* On Darwin, where we're installed in /usr/lib/swift and /usr/libexec/swift.
* On Linux, where we're in /usr/lib/swift/linux and /usr/libexec/swift/linux.
* On Windows, where we may be in a flat directory layout (because of limitations
  of Windows DLL lookups).

rdar://103071801
This should have said how to release the string.

rdar://103071801
Renamed a couple of functions following review feedback.  Also added some
extra words to the comments.

rdar://103071801
We need to cast in order to call `free()`.

rdar://103071801
@al45tair al45tair force-pushed the backtracing/path-lookup branch from 8f6cb44 to 35a2f17 Compare March 1, 2023 13:43
al45tair added 4 commits March 1, 2023 15:36
This must have ended up in the wrong PR in the stack.  It is needed in
this one so that we can locate libswiftCore.

rdar://103071801
Since it's copying, it may as well return `char *` instead of
`const char *`.

rdar://103071801
@al45tair
Copy link
Contributor Author

al45tair commented Mar 2, 2023

@swift-ci Please test

@al45tair
Copy link
Contributor Author

al45tair commented Mar 2, 2023

@swift-ci Please test macOS platform

@al45tair al45tair merged commit 95b8a48 into swiftlang:main Mar 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant