Bug 1485002 - "Requires: gcc" may install dts-gcc which is not in PATH
Summary: "Requires: gcc" may install dts-gcc which is not in PATH
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Developer Toolset
Classification: Red Hat
Component: gcc
Version: DTS 7.0 RHEL 7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: alpha
: 7.0
Assignee: Marek Polacek
QA Contact: Martin Cermak
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-24 19:47 UTC by Josh Stone
Modified: 2017-10-24 09:47 UTC (History)
11 users (show)

Fixed In Version: devtoolset-7-gcc-7.1.1-7.1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-10-24 09:47:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:3016 0 normal SHIPPED_LIVE new packages: devtoolset-7-gcc 2017-10-24 13:21:49 UTC

Description Josh Stone 2017-08-24 19:47:53 UTC
Description of problem:
Rust needs "cc" for linking, so it has "Requires: gcc".  However, in bug 1482062 and bug 1482066 we found that it installed devtoolset-4-gcc instead of the expected base-OS gcc.  DTS gcc isn't in the PATH without enabling the SCL, so rustc fails to invoke it.

This seems to stem from DTS having "Provides:gcc = %{version}-%{release}".  Since the base-OS gcc and several DTS gcc in the repo all provide some "gcc", yum apparently picks one at random.

Version-Release number of selected component (if applicable):
devtoolset-7-gcc-7.1.1-7.el7
(and AFAICS all past versions of DTS gcc)

How reproducible:
high

Steps to Reproduce:
1. rhpkg clone rust-toolset-7-docker
2. cd rust-toolset-7-docker
3. rhpkg container-build --scratch

Actual results:
One of the devtoolset-*-gcc is installed to satisfy "Requires: gcc".

Expected results:
Ideally it should just install the base-OS gcc, as that will be in PATH.

Additional info:
Whatever we decide to do for devtoolset-7-gcc, I think we'll also need a solution that works with all of the past DTS present in the repos too.  It may just be that rust.spec should have "Requires: /usr/bin/cc" instead.

Comment 2 Jeff Law 2017-08-24 20:59:54 UTC
More generally, I think we need to look at all the DTS packages and their Provides: lines to make sure they're sane WRT this problem.

Comment 3 Marek Polacek 2017-08-25 12:46:54 UTC
It seems to me that we should drop
%{?scl:Provides:gcc = %{version}-%{release}}
from the gcc spec file.  It's been there since the DTS 1.1 times and I do not find any justification why it's there.

I've checked some other DTS packages (gdb, binutils, valgrind, dwz, systemtap, elfutils, strace) and I don't see the same Provides there.

But that won't help right now because we're not able to change older DTS gcc.  So, for now, I suppose let's use "Requires: /usr/bin/cc".

It'd also be helpful to know, exactly, how yum finds the appropriate package specified in Requires.

Comment 4 Marek Polacek 2017-08-28 15:59:14 UTC
I'm moving forward with what I proposed in Comment 3.

Comment 5 Marek Polacek 2017-08-30 09:12:10 UTC
Should be fixed.

Comment 7 Michael Petlan 2017-09-14 15:28:32 UTC
Both .el6 and .el7 source rpms of devtoolset-7-gcc-7.2.1-1 seem NOT to contain the troublemaker line:

# cat rpmbuild/SPECS/gcc.spec | grep Provides
Provides: liblto_plugin.so.0()(64bit)
Provides: liblto_plugin.so.0

---> VERIFIED.

Comment 9 errata-xmlrpc 2017-10-24 09:47:20 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2017:3016


Note You need to log in before you can comment on or make changes to this bug.