Ticket 8296 - slurm-devel conflicting with pkgconfig
Summary: slurm-devel conflicting with pkgconfig
Status: RESOLVED FIXED
Alias: None
Product: Slurm
Classification: Unclassified
Component: Other (show other tickets)
Version: 20.11.8
Hardware: Linux Linux
: 4 - Minor Issue
Assignee: Tim McMullan
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2020-01-07 03:53 MST by Marc Caubet Serrabou
Modified: 2022-02-10 06:15 MST (History)
1 user (show)

See Also:
Site: Paul Scherrer
Slinky Site: ---
Alineos Sites: ---
Atos/Eviden Sites: ---
Confidential Site: ---
Coreweave sites: ---
Cray Sites: ---
DS9 clusters: ---
Google sites: ---
HPCnow Sites: ---
HPE Sites: ---
IBM Sites: ---
NOAA SIte: ---
NoveTech Sites: ---
Nvidia HWinf-CS Sites: ---
OCF Sites: ---
Recursion Pharma Sites: ---
SFW Sites: ---
SNIC sites: ---
Tzag Elita Sites: ---
Linux Distro: ---
Machine Name:
CLE Version:
Version Fixed: 22.05pre1
Target Release: ---
DevPrio: ---
Emory-Cloud Sites: ---


Attachments
Install slurm-devel from fresh Centos7 image (61.44 KB, text/x-log)
2022-02-09 04:08 MST, Marc Caubet Serrabou
Details

Note You need to log in before you can comment on or make changes to this ticket.
Description Marc Caubet Serrabou 2020-01-07 03:53:21 MST
When installing the slurm-devel package it conflicts with pkgconfig.

Proposed change:

(base) [caubet_m@merlin-l-001 Compile]$ diff slurm-19.05.5/slurm.spec.orig slurm-19.05.5/slurm.spec
196c196
< Requires: %{name}%{?_isa} = %{version}-%{release}
---
> Requires: %{name}%{?_isa} = %{version}-%{release} pkgconfig
524d523
< %dir %{_libdir}/pkgconfig

It forces the slurm-devel to depend on pkgconfig (so it ensures that the proper directory exists) and remove the existing line '%dir %{_libdir}/pkgconfig'.

Cheers,
Marc
Comment 1 Marc Caubet Serrabou 2021-05-14 01:06:30 MDT
Hi,

any news about it? Looks like the conflict with pkgconfig is still present for the slurm-devel package, even in the latest 20.11 releases (I tested 20.11.7).

Just a comment, the below workaround does not contain all proper changes needed (in example, probably SPEC needs to be adapted also for Cray), but is clear that "%dir %{_libdir}/pkgconfig" should not be there as it will always conflict with pkgconfig.

Cheers,
Marc
Comment 2 Marc Caubet Serrabou 2022-02-03 10:18:52 MST
Hi,

any news about this? I opened this ticket 2 years ago already but it seems it was never checked. This still happens in version 20.11.8 and I just checked and it seems to be present also in 21.08. That's really a small change, but really helps when deploying Slurm through RPMs, otherwise installing slurm-devel packages breaks due to a senseless dependency, and can not be installed i.e. normally through "yum".

Cheers,
Marc
Comment 3 Jason Booth 2022-02-03 11:37:14 MST
Marc - I do apologize for the miss-routing of this issue. When it was filed originally, the bug was treated as a contribution rather than a bug. I will have our support team look over this and get back to you. As a side note, this issue better fits as a sev 4, so I have adjusted this bug to match. This change will not impact us looking into this issue in a timely manner.
Comment 4 Tim McMullan 2022-02-03 12:56:27 MST
Hi Marc,

I'm sorry about the long delay in this getting looked at!

My quick test of building and installing the slurm rpms on centos7 and 8 (stream)  appear to be installing just fine with yum. I can certainly see how it might conflict though, so I'm curious if there is something I'm missing when trying to replicate. Is yum yelling about it for you? If so, at what point does it yell? What OS are you running?

Ignoring that it hasn't failed for me yet, I am looking to see if depending on pkgconfig is just the better solution anyway.

Thanks
-Tim
Comment 6 Marc Caubet Serrabou 2022-02-07 09:27:27 MST
Hi Tim,

thanks a lot for taking a look to it.

The O.S. is RHEL7, however we compile it directly from the Slurm sources and provide Slurm the RPMs through our own yum repository. In order to fix the conflict problem, every time we compile a new Slurm release we need to patch the slurm.spec file coming from the source packages.

I understand that if installing RPMs from the official Centos7 repositories is not causing problems is because they probably also patch or provide their own spec file.

And answering your question: yes, yum is complaining. In example (I am using a non-patched compiled version here):

[root@merlin-l-001 ~]# yum install slurm-devel
Loaded plugins: nvidia, search-disabled-repos
Resolving Dependencies
--> Running transaction check
---> Package slurm-devel.x86_64 0:20.11.8-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================================================================================
 Package                                   Arch                                 Version                                        Repository                           Size
=========================================================================================================================================================================
Installing:
 slurm-devel                               x86_64                               20.11.8-1.el7                                  slurm                                78 k

Transaction Summary
=========================================================================================================================================================================
Install  1 Package

Total size: 78 k
Installed size: 363 k
Is this ok [y/d/N]: y
Downloading packages:
Running transaction check
Running transaction test


Transaction check error:
  file /usr/lib64/pkgconfig from install of slurm-devel-20.11.8-1.el7.x86_64 conflicts with file from package pkgconfig-1:0.27.1-4.el7.x86_64

Error Summary
-------------

[root@merlin-l-001 ~]# rpm -iv http://linux.web.psi.ch/ext/slurm/20.11.8/slurm-devel-20.11.8-1.el7.x86_64.rpm
Retrieving http://linux.web.psi.ch/ext/slurm/20.11.8/slurm-devel-20.11.8-1.el7.x86_64.rpm
Preparing packages...
	file /usr/lib64/pkgconfig from install of slurm-devel-20.11.8-1.el7.x86_64 conflicts with file from package pkgconfig-1:0.27.1-4.el7.x86_64

So the only way for installing it:

[root@merlin-l-001 ~]# rpm -iv --force http://linux.web.psi.ch/ext/slurm/20.11.8/slurm-devel-20.11.8-1.el7.x86_64.rpm
Retrieving http://linux.web.psi.ch/ext/slurm/20.11.8/slurm-devel-20.11.8-1.el7.x86_64.rpm
Preparing packages...
slurm-devel-20.11.8-1.el7.x86_64
Comment 7 Tim McMullan 2022-02-07 10:59:00 MST
(In reply to Marc Caubet Serrabou from comment #6)
> Hi Tim,
> 
> thanks a lot for taking a look to it.
> 
> The O.S. is RHEL7, however we compile it directly from the Slurm sources and
> provide Slurm the RPMs through our own yum repository. In order to fix the
> conflict problem, every time we compile a new Slurm release we need to patch
> the slurm.spec file coming from the source packages.
> 
> I understand that if installing RPMs from the official Centos7 repositories
> is not causing problems is because they probably also patch or provide their
> own spec file.

I was doing my testing on a centos 7 host, built the RPMs with "rpmbuild -ta", added the rpms to a local rpm repo (literally just made the rpms directory a repo), then yum insalled the slurm packages and yum did not complain the same way it is for you.  I'm not sure how what seem to be very similar processes are resulting in such different results.

Interestingly enough, the epel slurm packages don't seem to provide the pkgconfig file at all which would certainly avoid the issue.

> And answering your question: yes, yum is complaining. In example (I am using
> a non-patched compiled version here)

Thank you for the further clarification on what you are seeing!
--Tim
Comment 8 Marc Caubet Serrabou 2022-02-08 02:00:12 MST
What do you see when unpacking your RPM?

[root@merlin-l-001 ~]# rpm2cpio http://linux.web.psi.ch/ext/slurm/20.11.8/slurm-devel-20.11.8-1.el7.x86_64.rpm | cpio -idmv
./usr/include/slurm
./usr/include/slurm/pmi.h
./usr/include/slurm/pmi2.h
./usr/include/slurm/slurm.h
./usr/include/slurm/slurm_errno.h
./usr/include/slurm/slurmdb.h
./usr/include/slurm/smd_ns.h
./usr/include/slurm/spank.h
./usr/lib64/pkgconfig
./usr/lib64/pkgconfig/slurm.pc
729 blocks

Is strange that you don't see that, at the end the problem is clearly present, in example at line 556 for the 20.11 branch (https://github.com/SchedMD/slurm/blob/slurm-20.11/slurm.spec) and line 561 for the branch 21.08 (https://github.com/SchedMD/slurm/blob/slurm-21.08/slurm.spec). 

The solution should be removing that line and adding a Requires dependency in the "%package devel" section (line 202 for v20.11, line 205 for v21.08). In example:

%package devel
Summary: Development package for Slurm
Group: Development/System
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: pkgconfig
%description devel
Development package for Slurm.  This package includes the header files
and static libraries for the Slurm API

Other sections already contain this (in example, when "with cray" / "with cray_network" is enabled, lines 99 and 113 for v20.11).

Cheers,
Marc
Comment 10 Tim McMullan 2022-02-08 08:34:07 MST
(In reply to Marc Caubet Serrabou from comment #8)
> What do you see when unpacking your RPM?
> 
> [root@merlin-l-001 ~]# rpm2cpio
> http://linux.web.psi.ch/ext/slurm/20.11.8/slurm-devel-20.11.8-1.el7.x86_64.
> rpm | cpio -idmv
> ./usr/include/slurm
> ./usr/include/slurm/pmi.h
> ./usr/include/slurm/pmi2.h
> ./usr/include/slurm/slurm.h
> ./usr/include/slurm/slurm_errno.h
> ./usr/include/slurm/slurmdb.h
> ./usr/include/slurm/smd_ns.h
> ./usr/include/slurm/spank.h
> ./usr/lib64/pkgconfig
> ./usr/lib64/pkgconfig/slurm.pc
> 729 blocks

[root@el7slurm-master x86_64]# rpm2cpio ./slurm-devel-20.11.8-1.el7.x86_64.rpm | cpio -idmv
./usr/include/slurm
./usr/include/slurm/pmi.h
./usr/include/slurm/pmi2.h
./usr/include/slurm/slurm.h
./usr/include/slurm/slurm_errno.h
./usr/include/slurm/slurmdb.h
./usr/include/slurm/smd_ns.h
./usr/include/slurm/spank.h
./usr/lib64/pkgconfig
./usr/lib64/pkgconfig/slurm.pc
729 blocks

Same exact output.  The best guess I've got right now is some sort of permissions conflict?  Do you have anything exciting in your rpmmacros file maybe? Mine is totally empty (apart from when I was testing setting a prefix for the slurm install).  Just trying to understand the difference at this point.

I'm proposing a patch that will remove the "%dir %{_libdir}/pkgconfig" line and should avoid that conflict.

Thanks!
--Tim
Comment 11 Marc Caubet Serrabou 2022-02-09 04:08:39 MST
Created attachment 23376 [details]
Install slurm-devel from fresh Centos7 image
Comment 12 Marc Caubet Serrabou 2022-02-09 04:15:11 MST
Hi Tim,

my rpmmacros is pretty simple, I just set a different topdir:

(base) ❄ [caubet_m@merlin-l-001:/data/user/caubet_m]# cat ~/.rpmmacros 
%_topdir %(echo /data/user/caubet_m)/rpmbuild

I have setup a fresh container image based on Centos7 and installed the package to see whether it had something to with Centos7 vs RHEL7. As I was expecting, it has the same behavior (see attached singularity.log).

Since your slurm-devel file contains the affected line (./usr/lib64/pkgconfig), as long as you have pkgconfig package installed I understand that the error should pop up. For curiosity, did you fully installed slurm-devel? The error only appears when installation starts (alias one needs to press [y] in yum or just "rpm -i" with rpm).

Thanks for proposing that change, that would help a lot and is an easy fix. I would strongly recommend adding a "Requires: pkgconfig" for slurm-devel, since slurm-devel contains a file which has to be placed in /usr/lib64/pkgconfig. However, I would expect that in general such systems will contain pkgconfig in general, but I do not have the full overview of all distros and O.S. supported by Slurm.

Thanks a lot for your help,
Marc
Comment 14 Tim McMullan 2022-02-09 14:54:44 MST
(In reply to Marc Caubet Serrabou from comment #12)
> Hi Tim,
> 
> my rpmmacros is pretty simple, I just set a different topdir:
> 
> (base) ❄ [caubet_m@merlin-l-001:/data/user/caubet_m]# cat ~/.rpmmacros 
> %_topdir %(echo /data/user/caubet_m)/rpmbuild
> 
> I have setup a fresh container image based on Centos7 and installed the
> package to see whether it had something to with Centos7 vs RHEL7. As I was
> expecting, it has the same behavior (see attached singularity.log).

Thank you for the additional information!

> Since your slurm-devel file contains the affected line
> (./usr/lib64/pkgconfig), as long as you have pkgconfig package installed I
> understand that the error should pop up. For curiosity, did you fully
> installed slurm-devel? The error only appears when installation starts
> (alias one needs to press [y] in yum or just "rpm -i" with rpm).

pkgconfig is definitely installed, I fully installed slurm and slurm-devel, and double checked that the files appeared where they should.  I might just blow this VM away and try again.

> Thanks for proposing that change, that would help a lot and is an easy fix.
> I would strongly recommend adding a "Requires: pkgconfig" for slurm-devel,
> since slurm-devel contains a file which has to be placed in
> /usr/lib64/pkgconfig. However, I would expect that in general such systems
> will contain pkgconfig in general, but I do not have the full overview of
> all distros and O.S. supported by Slurm.

Some good news: that change has been pushed into master, so starting with 22.05 this shouldn't be an issue for you (https://github.com/SchedMD/slurm/commit/c52ea49).

In this case, I did opt not to depend on pkgconfig.  I do understand that this might not be ideal... but since we can change the installation directory of slurm (as well as the slurm.pc file), depending on pkgconfig isn't enough to guarantee that the directory exists.  However, even without "%dir %{_libdir}/pkgconfig" the appropriate directory gets created if it doesn't exist.

There is also a *potential* issue where some distributions are moving to the "pkgconf" package instead of "pkgconfig".  I've opened a separate issue where I'll be figuring out if that is something we need to address, but I don't want that discussion to block fixing this :)

> Thanks a lot for your help,
> Marc

Thank you for all your help on this, and for your patience regarding getting it resolved!

Let me know if you have any other questions or concerns about this!
--Tim
Comment 15 Marc Caubet Serrabou 2022-02-10 04:02:12 MST
(In reply to Tim McMullan from comment #14)
> (In reply to Marc Caubet Serrabou from comment #12)

Hi Tim,

> pkgconfig is definitely installed, I fully installed slurm and slurm-devel,
> and double checked that the files appeared where they should.  I might just
> blow this VM away and try again.

Yes that's weird really. I tried also with a VM and I have the same problem.

> Some good news: that change has been pushed into master, so starting with
> 22.05 this shouldn't be an issue for you
> (https://github.com/SchedMD/slurm/commit/c52ea49).

Cool! This will be very helpful! Thanks a lot for moving this :)

> In this case, I did opt not to depend on pkgconfig.  I do understand that
> this might not be ideal... but since we can change the installation
> directory of slurm (as well as the slurm.pc file), depending on pkgconfig
> isn't enough to guarantee that the directory exists.  However, even without
> "%dir %{_libdir}/pkgconfig" the appropriate directory gets created if it
> doesn't exist.
> 
> There is also a *potential* issue where some distributions are moving to the
> "pkgconf" package instead of "pkgconfig".  I've opened a separate issue
> where I'll be figuring out if that is something we need to address, but I
> don't want that discussion to block fixing this :)


Yes, you are right, some distros changed that.

> 
> Thank you for all your help on this, and for your patience regarding getting
> it resolved!
> 
> Let me know if you have any other questions or concerns about this!
> --Tim

Having this from 22.05 will be ok, in the meantime I will keep patching for the v21 releases. Therefore, ticket can be closed if necessary.

Thanks a lot for your help,
Marc
Comment 16 Tim McMullan 2022-02-10 06:15:18 MST
Thanks Marc, sounds good!  I'll resolve this for now, but please let us know if you have any other issues!

Thanks again!
--Tim