Bug 18599

Summary: RPM now generates filedeps, apparently breaking mock chroots
Product: Mageia Reporter: Rémi Verschelde <rverschelde>
Component: RPM PackagesAssignee: Mageia Bug Squad <bugsquad>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: Normal CC: lmenut, ngompa13, pkg-bugs
Version: Cauldron   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: CVE:
Status comment:

Description Rémi Verschelde 2016-06-01 16:45:45 CEST
As mentioned by Neal Gompa on the dev@ mailing list [0], RPM seems to be generating new filedeps that used not to exist a couple of months ago, and it breaks at least mock chroots.

This issue was hinted by this new mock failure (it worked fine as of May 8th, 2016):

--------------

# dnf --installroot=/tmp/mgaroot6 install basesystem-minimal rpm-build
rpm-mageia-setup-build rpm-mageia-setup

[...]
Running transaction check
Error: transaction check vs depsolve:
/bin/sh is needed by iputils-20160308-1.mga6.x86_64
To diagnose the problem, try running: 'rpm -Va --nofiles --nodigest'.
You probably have corrupted RPMDB, running 'rpm --rebuilddb' might fix
the issue.
The downloaded packages were saved in cache until the next successful
transaction.

--------------

/bin/sh is indeed a filedep of iputils, though it wasn't a dependency for the previous version of iputils [1]; the package was updated 3 weeks ago [2], so we think it might be a RPM issue introduced before that.

See also this comparison of RPM metadata between iputils 20150508 [3] and 20160308 [4].

Further input from other packagers is very welcome to help understand this bug better, assess its impact and see how we can fix it.


[0] https://ml.mageia.org/l/arc/dev/2016-06/msg00011.html
[1] https://paste.fedoraproject.org/373343/78765414/
[2] http://svnweb.mageia.org/packages/cauldron/iputils/current/SPECS/iputils.spec?view=log
[3] https://paste.fedoraproject.org/373348/64788438/
[4] https://paste.fedoraproject.org/373349/47884821/
Rémi Verschelde 2016-06-01 16:46:14 CEST

CC: (none) => ngompa13, pkg-bugs

Comment 1 Luc Menut 2016-06-01 18:06:00 CEST
(In reply to Rémi Verschelde from comment #0)
> As mentioned by Neal Gompa on the dev@ mailing list [0], RPM seems to be
> generating new filedeps that used not to exist a couple of months ago, and
> it breaks at least mock chroots.
> 
...
> 
> /bin/sh is indeed a filedep of iputils, though it wasn't a dependency for
> the previous version of iputils [1]; the package was updated 3 weeks ago
> [2], so we think it might be a RPM issue introduced before that.
> 

I don't think that this is a RPM issue.

rpm -qpv --requires iputils-20160308-1.mga6.x86_64.rpm 
interp,pretrans: /bin/sh
pre: filesystem >= 2.1.9-18
...

rpm -qp --scripts iputils-20160308-1.mga6.x86_64.rpm 
pretrans scriptlet (using /bin/sh):
if [ -e /usr/bin/ping6 -a ! -L %{bindir}/ping6 ]; then
  rm -f /usr/bin/ping6
fi

iputils 20160308-1.mga6 requires /bin/sh because of pretrans script added in svn rev. 1011621
http://svnweb.mageia.org/packages/cauldron/iputils/current/SPECS/iputils.spec?r1=1011424&r2=1011621

If iputils can be in the first transaction at install, this pretrans scriptlet should be written in lua instead of shell.


with mga5, iputils 20140620-3.mga5 /bin/sh was required by posttrans script (posttrans script for apparmor dropped in svn rev. 913365)
rpm -qv --requires iputils
interp,posttrans: /bin/sh
config: config(iputils) = 20140620-3.mga5
pre: filesystem >= 2.1.9-18
...

rpm -qv --scripts iputils
posttrans scriptlet (using /bin/sh):
# if we have apparmor installed, reload if it's being used
if [ -x /sbin/apparmor_parser ]; then
        /sbin/service apparmor condreload
fi

CC: (none) => lmenut

Comment 2 Thierry Vignaud 2016-06-01 21:38:14 CEST
Also /bin/sh filedeps works fine with urpmi and always was.
We've a cople comme fildeps exceptions for gendistrib

Status: NEW => RESOLVED
Resolution: (none) => INVALID
Assignee: thierry.vignaud => bugsquad
Source RPM: rpm-4.13.0-0.rc1.33.mga6 => (none)

Comment 3 Neal Gompa 2016-06-01 21:40:12 CEST
So then it might simply be an issue with pretrans scriptlets not being written in Lua, because it is happening before the shell exists?
Comment 4 Rémi Verschelde 2016-06-02 00:27:12 CEST
Glad we were wrong in our analysis then :D
Comment 5 Neal Gompa 2016-06-02 04:19:01 CEST
Per Ãyvind Karlsen (proyvind) converted the %pretrans scriptlet to Lua, which I applied and submitted to the BS to hopefully fix the issue.
Comment 6 David Walser 2016-06-03 23:11:36 CEST
Even still, with the autoreq dep generators, if there's a dep on an interpreter, it's resolved to the package providing that interpreter as long as that package is installed during the build.  Why is it not doing the same with /bin/sh on the scriplet and resolving it to bash?  (Granted, with iputils being a basesystem package, it probably still needed to be rewritten in lua)
Comment 7 Neal Gompa 2016-06-03 23:27:18 CEST
Because if it is pre transaction, it has to run before anything is installed. There's no way to satisfy that dependency on a chroot bootstrap.