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

Make libbacktrace an optional dependency #434

Merged
merged 1 commit into from
Jul 6, 2023

Conversation

Leo3418
Copy link
Contributor

@Leo3418 Leo3418 commented Jun 30, 2023

libbacktrace is not available in some distributions where Extension Manager is available as a native package, e.g. Gentoo, Debian. Yet the backtraces that libbacktrace helps to collect are vital information for a crash report.

To help both these distributions continue shipping Extension Manager as a native package and users who install this app via Flathub report crashes with backtraces, I have created this patch to make libbacktrace an optional dependency. It introduces a new backtrace Meson boolean option, which controls whether Extension Manager is to be built with libbacktrace. It is set to true by default, so existing build pipelines, e.g. this repo's GitHub Action workflow, behave the same as before. Folks who wish to build Extension Manager without libbacktrace can do it by setting -Dbacktrace=false in Meson command-line options.

I have tested this patch through the Gentoo GURU package for Extension Manager, which I maintain, for about a month now without any observation of issues.

If better names and string descriptions should be used for the Meson option (backtrace), the preprocessor macro (WITH_BACKTRACE), or the log messages, please feel free to suggest, and I am willing to update this patch using them.

Copy link
Owner

@mjakeman mjakeman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for working on this!

I think it makes sense that backtraces should be optional; it's only really to help debug issues, and it's hardly a required dependency, so this keeps the dependency footprint light.

Could you address the one comment below?

Otherwise, very happy to merge.

src/exm-backtrace.c Outdated Show resolved Hide resolved
libbacktrace is not available in some distributions where Extension
Manager is available as a native package, e.g. Gentoo [1], Debian [2].
On Debian, the native package maintainers have had to apply a downstream
patch [2] that removes and masks all code interfacing with libbacktrace.

However, when libbacktrace is available, the backtraces it helps to
collect in the event of an app crash might still be useful, so removing
the libbacktrace dependency completely is not the best solution for all
cases, i.e. not a good change to be submitted to the Extension Manager
upstream.

Making Extension Manager's dependency on libbacktrace optional is
better: it allows both these distributions to continue shipping this app
without downstream patching, and users who install this app via Flathub
or other distributions that support libbacktrace to report crashes with
helpful backtraces.

This commit introduces a new 'backtrace' Meson boolean option, which
controls whether Extension Manager is to be built with libbacktrace.  It
is set to 'true' by default, so existing build pipelines, e.g. the
first-party Flatpak builds for Flathub, behave the same as before.
Folks who wish to build Extension Manager without libbacktrace can do it
by setting '-Dbacktrace=false' in Meson command-line options.

[1]: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c99e8159e6cb8705227aab759359c158f52b64bd
[2]: https://salsa.debian.org/gnome-team/gnome-shell-extension-manager/-/commit/a7cccc5486ebeca2597aeab2ea5d6c74b17488b0

Signed-off-by: Yuan Liao <liaoyuan@gmail.com>
@mjakeman mjakeman self-requested a review July 6, 2023 02:33
Copy link
Owner

@mjakeman mjakeman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for the update

@mjakeman mjakeman merged commit 1cb8d92 into mjakeman:master Jul 6, 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.

2 participants