DNF vs YUM, $pkg, $pkg-mpi, $pkg-openmpi having same provides

Sandro Mani manisandro at gmail.com
Mon Jun 22 21:27:21 UTC 2015


On 19.06.2015 01:26, Sandro Mani wrote:
>
>
> On 19.06.2015 01:10, T.C. Hollingsworth wrote:
>> You should instead use the new depdendency generator hooks, which are
>> also quite a bit nicer to work with. All you have to do is create a
>> file %{_rpmconfigdir}/fileattrs/openmpi.attrs with something like:
>>
>> # the path to your provides generating script
>> %__openmpi_provides %{_rpmconfigdir}/openmpi.prov
>> # the path to your requires generating script
>> %__openmpi_requires %{_rpmconfigdir}/openmpi.req
>> # a regular expression that paths in an RPM
>> # must match to trigger the generator
>> %__openmpi_path ^%{_prefix}/lib(64)/(openmpi|mpich)/.*$
>>
>> When this file is present and any file is packaged during rpmbuild
>> that matches the regular expression in the last entry, the scripts
>> listed in the first two entries are executed.  Just as with
>> find-(provides|requires) a newline-seperated list of files in the
>> package is provided on the standard input (but in this case only those
>> which match the regular expression!) and you provide the Requires or
>> Provides to add on the standard output.
>>
>> You can look in your /usr/lib/rpm/fileattrs directory for some 
>> hints.  :-)
>>
>> Once you've got it working, you could propose a patch to
>> redhat-rpm-config to add it universally for all packages.  Or, if you
>> don't want to block on rpm changes and have more freedom to update it
>> in the future, you could create a new package for it and add it as a
>> dependency of both openmpi and mpich.
>
> Thanks a lot for this explanation, very informative! I'll proceed as 
> you outlined.
>
So I've been trying to get this to work, but the only thing I get is an 
exploding forkbomb, and this with the most simple test case I could set up:

$ cat /usr/lib/rpm/fileattrs/mpi.attrs
# the path to your provides generating script
%__mpi_provides %{_rpmconfigdir}/mpi.prov
# the path to your requires generating script
%__mpi_requires %{_rpmconfigdir}/mpi.req
# a regular expression that paths in an RPM
# must match to trigger the generator
%__mpi_path ^%{_prefix}/lib(64)/(openmpi|mpich)/.*$

$ cat /usr/lib/rpm/mpi.prov
#!/bin/sh
/usr/lib/rpm/rpmdeps --provides

$ cat /usr/lib/rpm/mpi.req
#!/bin/sh
/usr/lib/rpm/rpmdeps --requires


The result of adding this [1] package (which contains the files above) 
as a BuildRequires to a trivial test package [2] results in

[...]
error: Couldn't fork /usr/lib/rpm/mpi.req: Resource temporarily unavailable
error: Couldn't fork /usr/lib/rpm/mpi.prov: Resource temporarily unavailable
error: Couldn't fork /usr/lib/rpm/mpi.req: Resource temporarily unavailable
error: Couldn't fork /usr/lib/rpm/mpi.prov: Resource temporarily unavailable
error: Couldn't fork /usr/lib/rpm/mpi.req: Resource temporarily unavailable
error: Couldn't fork /usr/lib/rpm/mpi.prov: Resource temporarily unavailable
[...]

and the process table full of rpmdeps and mpi.prov instances.

Before firing up gdb and looking at what rpmdeps is doing, is there 
something obviously wrong with what I'm doing?

Thanks,
Sandro


[1] https://smani.fedorapeople.org/rpm-mpi-hooks-1.0-1.fc23.src.rpm
[2] https://smani.fedorapeople.org/mpihooktest-1.0-1.fc23.src.rpm


More information about the devel mailing list