Skip to content

Commit

Permalink
gitlab: fix helper scripts to support DNF5
Browse files Browse the repository at this point in the history
As Fedora 41 (currently Rawhide) is migrating to DNF5 [1], the
debuginfo-install command is not available anymore according to the
documentation. Instead, the user need to add the package suffix
"-debuginfo" when using the install command.

The implementation of the debuginfo-install plugin is under development
and tracked upstream. [2]

[1] https://fedoraproject.org/wiki/Changes/SwitchToDnf5
[2] rpm-software-management/dnf5#389
  • Loading branch information
ffmancera committed May 27, 2024
1 parent b8061dd commit 23d87f1
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
15 changes: 13 additions & 2 deletions .gitlab-ci/fedora-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set -ex
IS_FEDORA=0
IS_CENTOS=0
CENTOS_VERSION=0
FEDORA_VERSION=0
grep -q '^NAME=.*\(CentOS\)' /etc/os-release && IS_CENTOS=1
grep -q '^NAME=.*\(Fedora\)' /etc/os-release && IS_FEDORA=1
if [ $IS_CENTOS = 1 ]; then
Expand Down Expand Up @@ -45,15 +46,25 @@ yum install -y glibc-langpack-pl ccache clang
# to generate proper documentation.
yum reinstall -y --setopt='tsflags=' glib2-doc

if [ $IS_FEDORA = 1 ]; then
FEDORA_VERSION=$(cat /etc/os-release | grep '^VERSION_ID=' | sed s\/"VERSION_ID="\/\/)
fi

if command -v dnf &>/dev/null; then
dnf install -y python3-dnf-plugins-core
dnf debuginfo-install -y glib2
if [ $FEDORA_VERSION -lt "41" ]; then
dnf debuginfo-install glib2
else
dnf install -y dnf5-plugins
dnf config-manager setopt rawhide-debuginfo.enabled=1
dnf install -y glib2-debuginfo
fi
else
debuginfo-install -y glib2
fi

contrib/scripts/nm-ci-patch-gtkdoc.sh || true

-
if [ -x /usr/bin/ninja ] && ! [ -x /usr/bin/ninja-build ]; then
ln -s /usr/bin/ninja-build /usr/bin/ninja
fi
Expand Down
2 changes: 1 addition & 1 deletion tools/nm-in-container
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ RUN dnf install -y \\
wireguard-tools \\
wireshark-cli
RUN dnf debuginfo-install --skip-broken NetworkManager \$(ldd /usr/sbin/NetworkManager | sed -n 's/.* => \\(.*\\) (0x[0-9A-Fa-f]*)$/\1/p' | xargs -n1 readlink -f) -y
RUN dnf install --skip-broken NetworkManager-debuginfo \$(ldd /usr/sbin/NetworkManager | sed -n 's/.* => \\(.*\\) (0x[0-9A-Fa-f]*)$/\1/p' | xargs -n1 readlink -f) -y
RUN dnf clean all
Expand Down
2 changes: 1 addition & 1 deletion tools/nm-in-vm
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ do_build() {
--run "$BASEDIR_NM/contrib/fedora/REQUIRED_PACKAGES"
--run-command "dnf install -y --skip-broken ${extra_pkgs[*]}"
--run-command "pip3 install --user behave_html_formatter"
--run-command "dnf debuginfo-install -y --skip-broken NetworkManager \
--run-command "dnf install -y --skip-broken NetworkManager-debuginfo \
\$(ldd /usr/sbin/NetworkManager \
| sed -n 's/.* => \(.*\) (0x[0-9A-Fa-f]*)\$/\1/p' \
| xargs -n1 readlink -f)"
Expand Down
2 changes: 1 addition & 1 deletion tools/run-nm-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ if [ $RESULT -ne 0 -a $RESULT -ne 77 ]; then
echo Some addresses could not be resolved into symbols. >&2
echo The errors might get suppressed when you install the debugging symbols. >&2
if [ -x /usr/bin/dnf ]; then
echo Hint: dnf debuginfo-install $UNRESOLVED >&2
echo Hint: dnf install $UNRESOLVED-debuginfo >&2
elif [ -x /usr/bin/debuginfo-install ]; then
echo Hint: debuginfo-install $UNRESOLVED >&2
else
Expand Down
2 changes: 1 addition & 1 deletion valgrind.suppressions
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# are mainly tested.
#
# Make sure to install debug information, otherwise the suppression trace might
# not match. On Fedora, try 'dnf debuginfo-install glib2'.
# not match. On Fedora, try 'dnf install glib2-debuginfo'.
{
NSS_NoDB_Init
Memcheck:Leak
Expand Down

0 comments on commit 23d87f1

Please sign in to comment.