public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rocm-smi] rawhide: Define NDEBUG so release builds drop assert()
@ 2026-09-24 19:07 Igor Giamoniano
  0 siblings, 0 replies; only message in thread
From: Igor Giamoniano @ 2026-09-24 19:07 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/rocm-smi
            Branch : rawhide
            Commit : 065fe8fed812f7e72b718b98eca5b91f5377360a
            Author : Igor Giamoniano <igorgphotoarte@gmail.com>
            Date   : 2026-09-24T12:08:30-03:00
            Stats  : +5/-1 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/rocm-smi/c/065fe8fed812f7e72b718b98eca5b91f5377360a?branch=rawhide

            Log:
            Define NDEBUG so release builds drop assert()

Nothing in the spec or in %cmake sets CMAKE_BUILD_TYPE, so
CMAKE_CXX_FLAGS_RELEASE ("-DNDEBUG") never applies and the shipped
library keeps its assert() calls alive. On unexpected sysfs data that
aborts the calling process (btop, SIGABRT) instead of returning
RSMI_STATUS_UNEXPECTED_DATA, which is what the throw right after the
assert is there for.

Setting CMAKE_BUILD_TYPE=Release would also turn on upstream's
Release-only post-build strip, which empties debugsourcefiles.list and
fails the build, so NDEBUG goes in through CXXFLAGS instead.

Verified in mock on rawhide: -DNDEBUG on every compile line, debuginfo
and debugsource intact.

Resolves: rhbz#2417737
Assisted-by: Claude (Anthropic)

---
diff --git a/rocm-smi.spec b/rocm-smi.spec
index 174b6de..3a47ff6 100644
--- a/rocm-smi.spec
+++ b/rocm-smi.spec
@@ -70,7 +70,7 @@ Version:    %{rocm_version}
 %if %{with preview}
 Release:    0%{?dist}
 %else
-Release:    1%{?dist}
+Release:    2%{?dist}
 %endif
 Summary:    ROCm System Management Interface Library
 
@@ -201,6 +201,7 @@ rm -rf tests
 %endif
 
 %build
+export CXXFLAGS="%{build_cxxflags} -DNDEBUG"
 %cmake \
     -DBUILD_TESTS=%{build_test} \
     -DCMAKE_INSTALL_LIBDIR=%{pkg_libdir} \
@@ -251,6 +252,9 @@ rm -f %{buildroot}%{pkg_prefix}/share/doc/rocm-smi-lib/LICENSE.md
 %endif
 
 %changelog
+* Thu Sep 24 2026 Igor Giamoniano <igorgphotoarte@gmail.com> - 10.0.0-2
+- Define NDEBUG so release builds drop assert() (rhbz#2417737)
+
 * Sun Sep 20 2026 Tom Rix <Tom.Rix@amd.com> - 10.0.0-1
 - Update to 10.0
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-24 19:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-24 19:07 [rpms/rocm-smi] rawhide: Define NDEBUG so release builds drop assert() Igor Giamoniano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox