Skip to content

Commit

Permalink
Update conanfile.py
Browse files Browse the repository at this point in the history
Co-authored-by: Erwan MATHIEU <[email protected]>
  • Loading branch information
jellespijker and wawanbreton authored Jan 15, 2024
1 parent 783bbcc commit feb5978
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,20 @@ def build(self):
sentry_org = self.conf.get("user.curaengine:sentry_org", "", check_type=str)
if sentry_project == "" or sentry_org == "":
raise ConanInvalidConfiguration("sentry_project or sentry_org is not set")

if which("sentry-cli") is None:
self.output.warn("sentry-cli is not installed, skipping uploading debug symbols")
return

if self.settings.os == "Linux":
self.output.info("Stripping debug symbols from binary")
ext = ".so" if self.options.shared else ".a"
self.run(f"objcopy --only-keep-debug --compress-debug-sections=zlib libArcus{ext} libArcus.debug")
self.run(f"objcopy --strip-debug --strip-unneeded libArcus{ext}")
self.run(f"objcopy --add-gnu-debuglink=libArcus.debug libArcus{ext}")

build_source_dir = self.build_path.parent.parent.as_posix()
self.output.info("Uploading debug symbols to sentry")
self.run(f"sentry-cli debug-files upload --include-sources -o {sentry_org} -p {sentry_project} {build_source_dir}")
else:
if self.settings.os == "Linux":
self.output.info("Stripping debug symbols from binary")
ext = ".so" if self.options.shared else ".a"
self.run(f"objcopy --only-keep-debug --compress-debug-sections=zlib libArcus{ext} libArcus.debug")
self.run(f"objcopy --strip-debug --strip-unneeded libArcus{ext}")
self.run(f"objcopy --add-gnu-debuglink=libArcus.debug libArcus{ext}")

build_source_dir = self.build_path.parent.parent.as_posix()
self.output.info("Uploading debug symbols to sentry")
self.run(f"sentry-cli debug-files upload --include-sources -o {sentry_org} -p {sentry_project} {build_source_dir}")


def package(self):
Expand Down

0 comments on commit feb5978

Please sign in to comment.