Skip to content

Commit

Permalink
Use Arcus with published Sentry debug-files
Browse files Browse the repository at this point in the history
Contribute to CURA-11482
  • Loading branch information
jellespijker committed Jan 12, 2024
1 parent a315a1c commit 3f9c4fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion conandata.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: "5.7.0-alpha.0"
requirements:
- "arcus/5.3.0"
- "arcus/(latest)@ultimaker/cura_11482"
- "curaengine_grpc_definitions/(latest)@ultimaker/testing"
- "scripta/0.1.0@ultimaker/testing"
17 changes: 7 additions & 10 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ def configure(self):
self.options["openssl"].shared = True
if self.options.get_safe("enable_sentry", False):
self.options["sentry-native"].backend = "breakpad"
self.options["arcus"].enable_sentry = True

def validate(self):
if self.settings.compiler.get_safe("cppstd"):
Expand Down Expand Up @@ -166,31 +167,27 @@ def build(self):
if self.options.get_safe("enable_sentry", False):
# Upload debug symbols to sentry
sentry_project = self.conf.get("user.curaengine:sentry_project", "", check_type=str)
if sentry_project == "":
sentry_org = self.conf.get("user.curaengine:sentry_org", "", check_type=str)
if sentry_project == "" or sentry_org == "":
raise ConanInvalidConfiguration("sentry_project is not set")
output = StringIO()
self.run(f"sentry-cli -V", output=output)
if "sentry-cli" not in output.getvalue():
raise ConanInvalidSystemRequirements("sentry-cli is not installed")
self.output.info("Uploading debug symbols to sentry")
ext = ".exe" if self.settings.os == "Windows" else ""
self.run(f"sentry-cli debug-files upload --include-sources -o {sentry_project} -p curaengine CuraEngine{ext}")
if self.settings.os == "Windows" and self.settings.build_type == "RelWithDebInfo":
self.run(f"sentry-cli upload-dif --include-sources -o {sentry_project} -p curaengine CuraEngine.pdb")
self.run(f"sentry-cli debug-files upload --include-sources -o {sentry_org} -p {sentry_project} .")

# create a sentry release and link it to the commit this is based upon
self.output.info(f"Creating a new release {self.version} in Sentry and linking it to the current commit {self.conan_data['commit']}")
self.run(f"sentry-cli releases new -o {sentry_project} -p curaengine {self.version}")
self.run(f"sentry-cli releases set-commits -o {sentry_project} -p curaengine --commit \"Ultimaker/CuraEngine@{self.conan_data['commit']}\" {self.version}")
self.run(f"sentry-cli releases finalize -o {sentry_project} -p curaengine {self.version}")
self.run(f"sentry-cli releases new -o {sentry_org} -p {sentry_project} {self.version}")
self.run(f"sentry-cli releases set-commits -o {sentry_org} -p {sentry_project} --commit \"Ultimaker/CuraEngine@{self.conan_data['commit']}\" {self.version}")
self.run(f"sentry-cli releases finalize -o {sentry_org} -p {sentry_project} {self.version}")

def package(self):
ext = ".exe" if self.settings.os == "Windows" else ""
copy(self, f"CuraEngine{ext}", src=self.build_folder, dst=path.join(self.package_folder, "bin"))
copy(self, f"_CuraEngine.*", src=self.build_folder, dst=path.join(self.package_folder, "lib"))
copy(self, "LICENSE*", src=self.source_folder, dst=path.join(self.package_folder, "license"))
if self.settings.os == "Windows" and self.settings.build_type == "RelWithDebInfo":
copy(self, "CuraEngine.pdb", src=self.build_folder, dst=path.join(self.package_folder, "bin"))

def package_info(self):
ext = ".exe" if self.settings.os == "Windows" else ""
Expand Down

0 comments on commit 3f9c4fc

Please sign in to comment.