View Issue Details

IDProjectCategoryView StatusLast Update
0015331CentOS-7cmakepublic2018-12-21 08:53
Reportercommodo 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version7.5.1804 
Target VersionFixed in Version7.6.1810 
Summary0015331: CPackRPM creates RPMs that try to install system folders
DescriptionExample of failures:
https://travis-ci.org/commodo/libiio/jobs/434498366#L3178

Transaction check error:
  file /lib from install of libiio-0.15.g43dc961-1.x86_64 conflicts with file from package filesystem-3.2-25.el7.x86_64
  file /usr/sbin from install of libiio-0.15.g43dc961-1.x86_64 conflicts with file from package filesystem-3.2-25.el7.x86_64


This happens when trying to install the RPM. The build works fine.
Steps To ReproduceBuild an RPM with cmake.
Try to install it with yum.
Get error.

Additional InformationWe've worked around it with the patch below.
Essentially this was just copied from a few lines above, where the same code is present in this form.
We're patching this in docker before running the cmake command. And it works.

This could also be fixed upstream in cmake, but I haven't looked.
We will remove our patch once cmake is fixed in the yum repo.

------------------------------------------------------------------------------------------
--- a/usr/share/cmake/Modules/CPackRPM.cmake
+++ b/usr/share/cmake/Modules/CPackRPM.cmake
@@ -703,7 +703,7 @@ if(CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST)
    message("CPackRPM:Debug: CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST= \${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST}")
  endif()
   foreach(_DIR \${CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST})
- list(APPEND _RPM_DIRS_TO_OMIT "-o;-path;.\${_DIR}")
+ list(APPEND _RPM_DIRS_TO_OMIT "-o -path \${_DIR}")
   endforeach()
 endif()
 if (CPACK_RPM_PACKAGE_DEBUG)
        EOF
------------------------------------------------------------------------------------------
TagsNo tags attached.
abrt_hash
URL

Activities

hjmallon

hjmallon

2018-10-25 12:57

reporter   ~0032993

We have extensive CPackRPM stuff and use this method to avoid these problems. This is our list (not complete, but adding to CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION in CMake is the improtant part).

list(APPEND CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION
    "/usr/lib/firewalld"
    "/usr/lib/firewalld/services"
    "/usr/lib/systemd"
    "/usr/lib/systemd/system-preset"
    "/usr/lib/systemd/system"
    "/usr/lib/udev"
    "/usr/lib/udev/rules.d"
    "/usr/lib/modprobe.d"
    "/usr/lib/sysctl.d"
)
hjmallon

hjmallon

2018-10-25 12:59

reporter   ~0032994

I take my comment back, looks like you have tried this.
commodo

commodo

2018-10-27 12:32

reporter   ~0033009

Yep.
Sorry for omitting this info previously.
I've tried CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION & CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST
They don't work because the list does not get generated properly in `list(APPEND _RPM_DIRS_TO_OMIT "-o;-path;.\${_DIR}")`, which is what my proposed patch seems to fix.
commodo

commodo

2018-12-21 08:50

reporter   ~0033416

So, for some reason, the universe changed [or I am stupid] and CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION seems to work now.
No idea why it didn't work before.
I may have been struggling with some damaged CentOS 7 VM ; I typically try changes in VMs so as not to break the main host.
commodo

commodo

2018-12-21 08:51

reporter   ~0033417

I can't seem to close this.

But if anyone has admin rights, feel free to close this.
tigalch

tigalch

2018-12-21 08:53

manager   ~0033418

Closing per reporters feedback

Issue History

Date Modified Username Field Change
2018-09-28 08:24 commodo New Issue
2018-10-25 12:57 hjmallon Note Added: 0032993
2018-10-25 12:59 hjmallon Note Added: 0032994
2018-10-27 12:32 commodo Note Added: 0033009
2018-12-21 08:50 commodo Note Added: 0033416
2018-12-21 08:51 commodo Note Added: 0033417
2018-12-21 08:53 tigalch Status new => resolved
2018-12-21 08:53 tigalch Resolution open => fixed
2018-12-21 08:53 tigalch Fixed in Version => 7.6.1810
2018-12-21 08:53 tigalch Note Added: 0033418