From 98419cedde7513091af23b6b08bd6c52bb262b0f Mon Sep 17 00:00:00 2001 From: Damon Barry Date: Wed, 7 Feb 2024 13:46:04 -0800 Subject: [PATCH] Add debug symbols to packages (#587) Currently, we provide symbol packages for all the distros we build, with the exception of Mariner (disabled due to a rust issue, then never reverted). However, the packages don't contain our symbols because we instruct rustc to build the release configuration, which doesn't emit debug information by default. This change updates Cargo.toml to enable full debug information in release builds. It also reverts the config that was supressing symbol packages in Mariner. The deb/rpm packaging tools already strip symbols from release binaries and generate symbol packages, so no further changes are needed. --- Cargo.toml | 3 +++ ci/package.sh | 1 + contrib/mariner/aziot-identity-service.spec.in | 6 ------ 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1893ed6cf..b7200b1bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,3 +59,6 @@ panic = "abort" [profile.release] panic = "abort" +# Release builds will have full symbols. The packaging phase will strip symbols from binaries and +# make them available in a separate package. +debug = 2 diff --git a/ci/package.sh b/ci/package.sh index 6a7b1d0a9..efc395924 100755 --- a/ci/package.sh +++ b/ci/package.sh @@ -220,6 +220,7 @@ EOF mkdir -p "/src/packages/$TARGET_DIR" cp \ "$MarinerRPMBUILDDIR/out/RPMS/$MarinerArch/aziot-identity-service-$PACKAGE_VERSION-$PACKAGE_RELEASE.$PackageExtension.$MarinerArch.rpm" \ + "$MarinerRPMBUILDDIR/out/RPMS/$MarinerArch/aziot-identity-service-debuginfo-$PACKAGE_VERSION-$PACKAGE_RELEASE.$PackageExtension.$MarinerArch.rpm" \ "$MarinerRPMBUILDDIR/out/RPMS/$MarinerArch/aziot-identity-service-devel-$PACKAGE_VERSION-$PACKAGE_RELEASE.$PackageExtension.$MarinerArch.rpm" \ "/src/packages/$TARGET_DIR" ;; diff --git a/contrib/mariner/aziot-identity-service.spec.in b/contrib/mariner/aziot-identity-service.spec.in index 29980d898..7f71b7d0b 100644 --- a/contrib/mariner/aziot-identity-service.spec.in +++ b/contrib/mariner/aziot-identity-service.spec.in @@ -3,12 +3,6 @@ # Copyright (c) Microsoft. All rights reserved. -# TODO: -# Building debuginfo package fails due to https://github.com/rust-lang/rust/issues/82006 -# Remove this once that's fixed. -%define debug_package %{nil} - - Name: aziot-identity-service Version: @@VERSION@@ Release: @@RELEASE@@%{?dist}