You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've used sentry quite a bit, and a very common issue is that you end up with two different versions of sentry-core in your application, which results in errors being silently dropped! This issue is really hard to debug because some errors come through just fine - it just depends which crate is reporting the error.
What I have done for our latest application is add a build.rs which reads the project-wide lockfile, and raises an error if multiple versions of sentry-core are found.
I think this functionality would be great to add directly to sentry-core's build script, enabled behind a feature flag, and for use of this feature flag to be recommended to application authors in the documentation.
The text was updated successfully, but these errors were encountered:
Indeed this problem comes up quite often, and I believe one reason is that sentry is split up into multiple crates, which in hindsight was not the best idea as it makes a ton of stuff more complicated than it needs to be.
The idea with using a build.rs script is interesting. I’m not sure it would work though, as I believe cargo tries very hard to sandbox each crate, and I don’t think access to a project-wide Cargo.lock is readily available.
However, this reminds me that there are quite some solutions in the ecosystem that promote better lockfile and dependency hygiene. It may be worth investigating if we can add sentry/-core to any builtin deny-list, so users using such cargo tools will automatically get this flagged.
I've used sentry quite a bit, and a very common issue is that you end up with two different versions of sentry-core in your application, which results in errors being silently dropped! This issue is really hard to debug because some errors come through just fine - it just depends which crate is reporting the error.
What I have done for our latest application is add a
build.rs
which reads the project-wide lockfile, and raises an error if multiple versions ofsentry-core
are found.I think this functionality would be great to add directly to sentry-core's build script, enabled behind a feature flag, and for use of this feature flag to be recommended to application authors in the documentation.
The text was updated successfully, but these errors were encountered: