Skip to content
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

Drop hard dependency on elfutils 0.188 #40

Merged
merged 1 commit into from
Apr 12, 2023

Conversation

godlygeek
Copy link
Contributor

This version of elfutils isn't available in most distributions yet, which makes a hard dependency on it (for dwfl_frame_reg) annoying. Since we only need such a new version for trying to avoid the infinite loop when gathering stacks for interpreters using musl libc, cheat and avoid performing the check when PyStack itself is built using glibc.

This isn't perfectly correct, but it should work for the overwhelming majority of cases, and lets us continue to be built with the versions of elfutils in most common distributions.

Update the README to call out that Alpine users will likely need to build elfutils from source in order to build PyStack from source, at least for now.

@godlygeek godlygeek self-assigned this Apr 11, 2023
@godlygeek
Copy link
Contributor Author

godlygeek commented Apr 11, 2023

Another option occurs to me here: we could make the check

#if _ELFUTILS_VERSION >= 188 or (defined(__linux__) && !defined(__GLIBC__))

Then, we'd skip this check only if we're being built against an old version of elfutils, and we're being built with glibc. That might be a better set of compromises than this: it would mean that a PyStack built against glibc would still be able to unwind a Python process running with musl libc, as long as elfutils 0.188 or newer was available at build time.

This version of elfutils isn't available in most distributions yet,
which makes a hard dependency on it (for `dwfl_frame_reg`) annoying.
Since we only need such a new version for trying to avoid the infinite
loop when gathering stacks for interpreters using musl libc, cheat and
avoid performing the check when PyStack itself is built using glibc.

This isn't perfectly correct, but it should work for the overwhelming
majority of cases, and lets us continue to be built with the versions of
elfutils in most common distributions.

Update the README to call out that Alpine users will likely need to
build elfutils from source in order to build PyStack from source, at
least for now.

Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
@pablogsal pablogsal force-pushed the break_elfutils_0.188_dependency branch from 96c40b8 to 4b56768 Compare April 12, 2023 09:28
@pablogsal
Copy link
Member

Then, we'd skip this check only if we're being built against an old version of elfutils, and we're being built with glibc. That might be a better set of compromises than this: it would mean that a PyStack built against glibc would still be able to unwind a Python process running with musl libc, as long as elfutils 0.188 or newer was available at build time.

I have pushed a commit implementing this check instead as I am convinced this is a slightly better scenario.

@pablogsal pablogsal merged commit 78a995d into bloomberg:main Apr 12, 2023
@pablogsal pablogsal mentioned this pull request Jul 10, 2023
1 task
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.

None yet

2 participants