Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 953499

Summary: Automatic provides without scl prefix
Product: Red Hat Enterprise Linux 6 Reporter: Ivan Necas <inecas>
Component: scl-utilsAssignee: Jan Zeleny <jzeleny>
Status: CLOSED WONTFIX QA Contact: BaseOS QE - Apps <qe-baseos-apps>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.4CC: bkabrda, drieden, hhorak, jzeleny, mmaslano, msuchy
Target Milestone: rc   
Target Release: 6.6   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-03-12 14:26:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 965565    

Description Ivan Necas 2013-04-18 10:15:47 UTC
Description of problem:
rpm automatically adds provides for .so libs. This provides are not prefixed with the scl. In practise in means, it acts as it provides the libs globally.

Example:

Mongo requires libv8.so, v8 provides it. If you package v8 into scl, install it, and then install mongo without scl, the system-wide scl is not installed
but mongo doesn't work, because it doesn't see the libv8.

Comment 1 Miroslav Suchý 2013-04-18 10:46:08 UTC
And the very same problem is with requires.

Even if I change provides - in my case I done it as:
%if %{?scl:1}%{!?scl:0}
  # Do not check .so files in the libdir
  %global __provides_exclude_from ^(%{_libdir}/*.so.*)$
%endif
...
# When running in SCL add provides of libdir manually
%if %{?scl:1}%{!?scl:0}
%if "%{__isa_bits}" == 64
Provides %{?scl_prefix}libv8.so.3()(64bit)
Provides %{?scl_prefix}libv8preparser.so.3()(64bit)
%else
Provides %{?scl_prefix}libv8.so.3()
Provides %{?scl_prefix}libv8preparser.so.3()
%endif
%endif

Then the requires will be still the same. In my case (abbreviated):
# rpm -q --requires ruby193-v8
libc.so.6()(64bit)  
libc.so.6(GLIBC_2.2.5)(64bit)  
libc.so.6(GLIBC_2.3.4)(64bit)  
libc.so.6(GLIBC_2.4)(64bit)  
libpthread.so.0()(64bit)  
libpthread.so.0(GLIBC_2.2.5)(64bit)  
libv8.so.3()(64bit)  
libv8preparser.so.3()(64bit)


But I want to have 
 ruby193-libv8.so.3()(64bit) 
 ruby193-libv8preparser.so.3()(64bit)
instead of orginal ones. But leaves other intact.

I would very welcome something like
%global _use_scl_libs libv8.so libv8preparser.so

And if such libraries are find in automatically generated requires or provides they would be prepend with scl prefix.

Comment 2 Jan Zeleny 2013-08-26 13:51:15 UTC
You are mixing the provides and requires in your description. If I understand it correctly, you are defining your provides with a prefix but requires are not prefixed. That actually sounds correct to me, at least from the rpm side of things. You might want to consider using %__requires_exclude_from as well.

Could you please post me rpm -q --provides to see if everything is ok on that front?

Comment 3 Miroslav Suchý 2013-08-26 14:54:59 UTC
The v8 mentioned in #1 is here:
http://koji.katello.org/koji/buildinfo?buildID=4101

Comment 4 Jan Zeleny 2013-08-27 11:05:30 UTC
(In reply to Miroslav Suchý from comment #3)
> The v8 mentioned in #1 is here:
> http://koji.katello.org/koji/buildinfo?buildID=4101

So I did some testing on the package. On the first line I put a definition of scl macro:
%global scl ruby193

And the expected result after build:

ruby193-libv8.so.3()(64bit)
ruby193-libv8preparser.so.3()(64bit)
ruby193-v8 = 1:3.10.8-7.fc18
ruby193-v8(x86-64) = 1:3.10.8-7.fc18
scl-package(ruby193)

Perhaps we are missing something ...

Comment 5 Miroslav Suchý 2013-08-27 11:36:55 UTC
I actually build it under rhel6.
There the provides are always:
 libv8.so.3()(64bit)
no matter if I define scl macro on first line or in meta package.

Comment 6 Jan Zeleny 2013-08-27 12:08:52 UTC
Ok so after some more discussion on IRC this has been limited only to RHEL6 builds. The root cause is that rpm in RHEL6 doesn't support __provides_exclude_from.

Switching the product and keeping the bug for the moment as a tracker. We will investigate our options further.

Comment 8 Jan Zeleny 2013-08-27 13:49:20 UTC
Filed a bug 1001674 to document the situation. This bug is deferred until there is a demand for this to be fixed.

Comment 9 Jan Zeleny 2013-10-16 07:47:59 UTC
*** Bug 996025 has been marked as a duplicate of this bug. ***

Comment 10 Jan Zeleny 2013-11-12 14:10:38 UTC
Removing the dependency on RHSCL 1.1 tracker. As I have indicated above, I am not going to implement this unless absolutely necessary for something super important. The amount of work on this too high considering the potential benefit.

Comment 11 Marcela Mašláňová 2014-02-24 12:12:28 UTC
Currently, we are using "infixes" in shared objects e.g. libv8OURCOLLECTION.so.3()(64bit). I guess it won't be easy to implement it in scl-utils. I would leave it for scl-utils2 if we find better general solution.

Comment 12 Honza Horak 2014-02-24 12:44:29 UTC
(In reply to Marcela Mašláňová from comment #11)
> Currently, we are using "infixes" in shared objects e.g.
> libv8OURCOLLECTION.so.3()(64bit).

This wouldn't work, since we need to keep the library name unchanged (unless all dependencies are patched), just adjusting the soname works better. This is what we actually use:

libv8.so.OURCOLLECTION-3()(64bit).

Comment 13 Honza Horak 2014-02-24 12:59:10 UTC
Also worth mentioning (and sorry for repeating myself), that solving RPM provides issue is only one of the two issues we face. The second issue is runtime linking -- if scl-utils would only change the provides, it wouldn't prevent applications to link against wrong libraries.

So I still believe that changing the soname by manual patching is much better solution than hacking scl-utils to fix provides and let the libraries fail during linking possibly.

Comment 14 Marcela Mašláňová 2014-03-12 14:26:17 UTC
I agree. It has to be patched manually.