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

            A new commit has been pushed.

            Repo   : rpms/rocm-smi
            Branch : f45
            Commit : bf73f8ec1941847292bae0a4146d353164e270e9
            Author : Igor Giamoniano <igorgphotoarte@gmail.com>
            Date   : 2026-09-26T13:54:02-07:00
            Stats  : +5/-1 in 1 file(s)
            URL    : https://src.fedoraproject.org/rpms/rocm-smi/c/bf73f8ec1941847292bae0a4146d353164e270e9?branch=f45

            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 3b4700f..5e5a92c 100644
--- a/rocm-smi.spec
+++ b/rocm-smi.spec
@@ -70,7 +70,7 @@ Version:    %{rocm_version}
 %if %{with preview}
 Release:    1%{?dist}
 %else
-Release:    3%{?dist}
+Release:    4%{?dist}
 %endif
 Summary:    ROCm System Management Interface Library
 
@@ -205,6 +205,7 @@ rm -rf tests
 %endif
 
 %build
+export CXXFLAGS="%{build_cxxflags} -DNDEBUG"
 %cmake \
     -DBUILD_TESTS=%{build_test} \
     -DCMAKE_INSTALL_LIBDIR=%{pkg_libdir} \
@@ -255,6 +256,9 @@ rm -f %{buildroot}%{pkg_prefix}/share/doc/rocm-smi-lib/LICENSE.md
 %endif
 
 %changelog
+* Thu Sep 24 2026 Igor Giamoniano <igorgphotoarte@gmail.com> - 7.2.1-4
+- Define NDEBUG so release builds drop assert() (rhbz#2417737)
+
 * Thu Jul 16 2026 Fedora Release Engineering <releng@fedoraproject.org> - 7.2.1-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
 

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

only message in thread, other threads:[~2026-09-26 21:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-26 21:02 [rpms/rocm-smi] f45: 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