Bug 1597701 - samba-4.8.3-1.fc29.2 FTBFS: %requires_eq breaks building in non-English locale
Summary: samba-4.8.3-1.fc29.2 FTBFS: %requires_eq breaks building in non-English locale
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: samba
Version: 29
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Guenther Deschner
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-03 13:05 UTC by Petr Pisar
Modified: 2019-11-27 19:32 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-11-27 19:32:45 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github rpm-software-management rpm issues 541 0 None None None 2018-10-03 08:14:12 UTC

Description Petr Pisar 2018-07-03 13:05:40 UTC
samba-4.8.3-1.fc29.2 fails to build source RPM package in local mock in cs_CZ.UTF-8 locale because of "%requires_eq libldb" use at samba.spec:366:

Executing command: ['/usr/bin/systemd-nspawn', '-q', '-M', '7b63aac4f19b4b1a8af0941929aa35a0', '-D', '/var/lib/mock/fedorarebuild-x86_64-F1gd5jkcHp/root', '-a', '--bind=/tmp/mock-resolv.fkp8si3n:/etc/resolv.conf', '--setenv=TERM=vt100', '--setenv=SHELL=/bin/bash', '--setenv=HOME=/builddir', '--setenv=HOSTNAME=mock', '--setenv=PATH=/usr/bin:/bin:/usr/sbin:/sbin', '--setenv=PROMPT_COMMAND=printf "\\033]0;<mock-chroot>\\007"', '--setenv=PS1=<mock-chroot> \\s-\\v\\$ ', '--setenv=LANG=cs_CZ.UTF-8', '-u', 'mockbuild', 'bash', '--login', '-c', '/usr/bin/rpmbuild -bs --target x86_64 --nodeps /builddir/build/SPECS/samba.spec'] with env {'TERM': 'vt100', 'SHELL': '/bin/bash', 'HOME': '/builddir', 'HOSTNAME': 'mock', 'PATH': '/usr/bin:/bin:/usr/sbin:/sbin', 'PROMPT_COMMAND': 'printf "\\033]0;<mock-chroot>\\007"', 'PS1': '<mock-chroot> \\s-\\v\\$ ', 'LANG': 'cs_CZ.UTF-8'} and shell False
BUILDSTDERR: chyba: řádek 366: Neznámá značka: balíček libldb není nainstalován
Sestavuji cílové platformy: x86_64
Sestavuji pro cíl x86_64
Child return code was: 1
EXCEPTION: [Error()]

The reason is %requires_eq macro is buggy:

# LC_ALL="C" echo 'libldb' | xargs -r rpm -q --qf 'Requires: %{name} = %{epoch}:%{version}\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not"
balíček libldb není nainstalován

While correct command is:

# echo 'libldb' | LC_ALL=C xargs -r rpm -q --qf 'Requires: %{name} = %{epoch}:%{version}\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not"

The LC_ALL redefintion must be moved to the "xargs" command.


But that's not all. According to RPM authors and Fedora Packaging Committee RPM is not reentrant and thus calling rpm from rpmbuild can exhibit undefined behavior and must not be used. This is what %requires_eq does. Please do not use %requires_eq macro at all.

Comment 1 Petr Pisar 2018-07-03 13:12:35 UTC
It even breaks a build submission with fedpkg tool:

$ fedpkg build --target f29-perl
chyba: řádek 366: Neznámá značka: balíček libldb není nainstalován
chyba: dotaz na spec soubor /home/petr/fedora/samba/samba.spec selhal, nemohu parsovat

Could not get n-v-r-e from /home/petr/fedora/samba/samba.spec
Note: You can skip NVR construction & NVR check with --skip-nvr-check. See help for more info.

Comment 2 Jan Kurik 2018-08-14 09:55:55 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 29 development cycle.
Changing version to '29'.

Comment 3 Anoop C S 2018-08-19 15:54:42 UTC
(In reply to Petr Pisar from comment #0)
> The reason is %requires_eq macro is buggy:
> 
> # LC_ALL="C" echo 'libldb' | xargs -r rpm -q --qf 'Requires: %{name} =
> %{epoch}:%{version}\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is
> not"
> balíček libldb není nainstalován
> 
> While correct command is:
> 
> # echo 'libldb' | LC_ALL=C xargs -r rpm -q --qf 'Requires: %{name} =
> %{epoch}:%{version}\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is
> not"
> 
> The LC_ALL redefintion must be moved to the "xargs" command.

Why don't we try fixing the issue in rpm's source?

Please feel free to raise an issue or directly a PR at https://github.com/rpm-software-management/rpm/.

> But that's not all. According to RPM authors and Fedora Packaging Committee
> RPM is not reentrant and thus calling rpm from rpmbuild can exhibit
> undefined behavior and must not be used. This is what %requires_eq does.
> Please do not use %requires_eq macro at all.

bug #1507420 details the underlying story of introducing %requires_eq for libldb into samba's spec file.

Comment 4 Anoop C S 2018-09-19 06:18:30 UTC
(In reply to Anoop C S from comment #3)
> (In reply to Petr Pisar from comment #0)
> > The reason is %requires_eq macro is buggy:
> > 
> > # LC_ALL="C" echo 'libldb' | xargs -r rpm -q --qf 'Requires: %{name} =
> > %{epoch}:%{version}\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is
> > not"
> > balíček libldb není nainstalován
> > 
> > While correct command is:
> > 
> > # echo 'libldb' | LC_ALL=C xargs -r rpm -q --qf 'Requires: %{name} =
> > %{epoch}:%{version}\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is
> > not"
> > 
> > The LC_ALL redefintion must be moved to the "xargs" command.
> 
> Why don't we try fixing the issue in rpm's source?
> 
> Please feel free to raise an issue or directly a PR at
> https://github.com/rpm-software-management/rpm/.

Issue raised: https://github.com/rpm-software-management/rpm/issues/541

Comment 5 Panu Matilainen 2018-09-19 08:54:21 UTC
Better fix is to avoid using %require_eq at all, calling rpm from within rpm was never a particularly good idea.

Comment 6 Ben Cotton 2019-10-31 20:40:01 UTC
This message is a reminder that Fedora 29 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '29'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 29 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 7 Ben Cotton 2019-11-27 19:32:45 UTC
Fedora 29 changed to end-of-life (EOL) status on 2019-11-26. Fedora 29 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.