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

Fix Sentry initialization on Amazon Linux #657

Merged
merged 10 commits into from
Oct 21, 2024
Merged

Conversation

tustanivsky
Copy link
Collaborator

@tustanivsky tustanivsky commented Oct 14, 2024

Currently sentry-native is built using clang and libc++ to make the corresponding static libs included in sentry-unreal plugin compatible with UE. This introduces additional overhead for using Sentry on Linux since libc++ as one of the Crashpad dependencies has to be installed separately and for some distros this package is not available (i.e. AL 2/2023).

This PR suggests to build sentry-native in CI twice: once to obtain static libs using the current configuration and once to get the Crashpad executable not dependent on libc++ using gcc which then replaces binary obtained during the first build.

Related #431

Closes #635

@tustanivsky tustanivsky marked this pull request as ready for review October 15, 2024 09:44
Copy link
Contributor

@bitsandfoxes bitsandfoxes left a comment

Choose a reason for hiding this comment

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

I think I'm still stuck on the problem conceptually: We can build sentry-native statically using clang & libc++. But the crashpad handler that gets build alongside it has the libc++ dependency?

scripts/build-linux.sh Show resolved Hide resolved
@tustanivsky
Copy link
Collaborator Author

I think I'm still stuck on the problem conceptually: We can build sentry-native statically using clang & libc++. But the crashpad handler that gets build alongside it has the libc++ dependency?

@bitsandfoxes Yes, the crashpad_handler as it's currently built for Unreal has a dependency on libc++. To my understanding the existing sentry-native build scripts do not allow building crashpad executable separately with a configuration (compiler, standard library) that's different from the remaining SDK. So we came up with this "hack" when building things twice and combining the resulting artifacts allow us to avoid potential issues with additional deployment environment setup.

cc @supervacuus

@supervacuus
Copy link

I think I'm still stuck on the problem conceptually: We can build sentry-native statically using clang & libc++. But the crashpad handler that gets build alongside it has the libc++ dependency?

Everything you're building in this script has the libc++ dependency since you switched to clang, including libsentry.[a|so].

Building any library statically does not mean the libc++ dependency is gone; it is not linked statically to a standard library (and it is also unclear how much sense it would make in such a situation).

The difference is that this dependency is resolved for libsentry as part of the Unreal executable, whereas the crashpad_handler is a separate executable and gets the standard library the OS loader looks up for it.

Copy link
Contributor

@bitsandfoxes bitsandfoxes left a comment

Choose a reason for hiding this comment

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

I would really like to see this covered by some smoke test. I.e. run that amazon docker image in CI?

@tustanivsky
Copy link
Collaborator Author

We should be able to add smoke tests once #658 is resolved.

@tustanivsky tustanivsky merged commit 1a2df26 into main Oct 21, 2024
14 checks passed
@tustanivsky tustanivsky deleted the fix/amazon-linux-crashpad branch October 21, 2024 11:11
@tustanivsky tustanivsky mentioned this pull request Oct 23, 2024
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.

Sentry does not work on dedicated server based on Amazon_Linux_2023 and Amazon_Linux_2
3 participants