sentry-cocoa icon indicating copy to clipboard operation
sentry-cocoa copied to clipboard

Include sentry-cli as a SwiftPM command plugin

Open klundberg opened this issue 2 years ago • 3 comments

Problem Statement

I want to easily have sentry-cli available to all projects that use sentry, without needing to separately install it with something like homebrew, and so that xcode's build phases can easily access it to upload dsyms without needing to customize environment variables.

Solution Brainstorm

If sentry-cli could be included as a package command plugin, it would be easily available just by resolving packages in xcode for a project that includes sentry, and ostensibly could be run with swift package sentry-cli from the project directory, making it easier to set up a developer's environment and keep all tools needed to develop a project in sync.

Is something like this feasible to do?

klundberg avatar Sep 07 '22 18:09 klundberg

Thanks for opening the issue, @klundberg. I never created an SPM command plugin. Do you know how we can bundle and forward the calls to sentry-cli? Do we need a wrapper around sentry-cli similar to the sentry-fastlane-plugin?

philipphofmann avatar Sep 08 '22 06:09 philipphofmann

I believe so, in a way.

I haven't created command plugins myself, but there's some examples in the swift evolution document I linked, plus some more useful step by step guidance in this article: https://theswiftdev.com/beginners-guide-to-swift-package-manager-command-plugins/

Basically, sentry-cocoa would need to expose a new plugin product type and target, which would have to depend on sentry-cli through swift package manager. I believe swiftpm can include precompiled binary executables somehow, so I don't think figuring out how to build sentry-cli with swiftpm would be necessary. If that can be solved, its just a matter of having the plugin command execute the sentry-cli tool thru the plugin's code and passing along any necessary arguments, similar to how the examples and article above do so.

If the plugin can be included in this repo though, it'll be automatically available to all users of this library without needing a separate installable integration like sentry-fastlane-plugin needs :)

klundberg avatar Sep 09 '22 16:09 klundberg

Thanks for the update, @klundberg. We'll discuss this internally and will update this issue.

philipphofmann avatar Sep 12 '22 13:09 philipphofmann

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

github-actions[bot] avatar Oct 05 '22 00:10 github-actions[bot]

Has this been done since? I am looking for a way to upload dSym files to Sentry after XCode 14 removed its support. I am wondering if this could not help solve this issue.

StevenMasini avatar Mar 24 '23 03:03 StevenMasini

@StevenMasini, no, we didn't ship this feature yet. Here are the docs explaining how to upload dSYMs.

philipphofmann avatar Mar 24 '23 13:03 philipphofmann