Bug 744922 - RFE: please provide RPM and non-RPM metadata expressing exact build ID (for use by plugins)
Summary: RFE: please provide RPM and non-RPM metadata expressing exact build ID (for u...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-10 20:19 UTC by Dave Malcolm
Modified: 2011-10-29 06:32 UTC (History)
1 user (show)

Fixed In Version: gcc-4.6.2-1.fc16
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-10-29 06:32:36 UTC
Type: ---


Attachments (Terms of Use)

Description Dave Malcolm 2011-10-10 20:19:09 UTC
Description of problem:
See bug 739766

As I understand it, gcc makes no promises about the ABI it exposes to plugins: every plugin needs to be rebuilt every time gcc is rebuilt.

Bug 739766 shows a problem where an rpm of gcc-python-plugin was out-of-sync with the gcc rpm, leading to the python plugin failing its version check on startup.

There would seem to be two ways of fixing this:
 (a) embed the plugin sources within the build of "gcc"
 (b) express the exact version requirements in rpm metadata, so that the plugin rpm has a Requires that is only satisfied by a "Provides" from the exact gcc rpm that it was built against.

Problems with approach (a):
  * plugins are separate projects from gcc, and have their own release cycle:
    * They may be considerably less mature than gcc, and sugject to change.
  * The gcc maintainer probably doesn't want to care about the various plugins that exist
  * As a plugin mainainer, I'm only familiar with a small subset of gcc internals
  * We don't want a build issue with a plugin to stop gcc from rebuilding

I prefer option (b) for gcc-python-plugin.

However, (b) is also fiddly.  Ideally we would have something like: 
  Requires: gcc%{_isa} = %{gcc_version}-%{gcc_release}
within the plugin's metadata.

I tried this for gcc-python-plugin.spec with attachment 524073 [details].

Unfortunately, we can't query the rpm database from within a specfile: within a Koji build, there is no guarantee that the rpm database is available, or matches the correct versions within the build root (AIUI, the chroot built by mock doesn't contain it).

So instead I used this approach:
http://pkgs.fedoraproject.org/gitweb/?p=gcc-python-plugin.git;a=commitdiff;h=4fabc53d12d03cad2f8f5dcc0b0c1c5187e9f7d7

which involves scraping gcc's version-release (without the dist) from:
   gcc --version

However this doesn't work either: 
  gcc-python2-plugin-0.6-3.fc17.i686 requires gcc = 0:4.6.1-9.fc17
but the gcc in rawhide currently has a .fc16 dist tag: 4.6.1-9.fc16

Is it possible to add 

(c) some kind of command-line option to emit a build version?

e.g. something like:
  $ gcc --plugin-abi-version
  4.6.1-9.fc16

where it's defined to emit a string in an unspecified format, and 

(d) for gcc to have a "Provides" on that?

e.g. 
  echo '%{version}-%{release}' > gcc/PLUGIN_ABI_VERSION
analogous to the DEV_PHASE code in gcc.spec
and something like:
  Provides: gcc-abi-version%{_isa} = %{version}-%{release}

With both (c) and (d) in place, a specfile for a plugin can invoke the new gcc command-line option to get at the correct metadata, and add a Requires on it, and then rpm can ensure that the plugin and gcc versions match.

Hope the above makes sense

Version-Release number of selected component (if applicable):
gcc-4.6.1-9.fc15.x86_64

Comment 1 Dave Malcolm 2011-10-24 20:00:44 UTC
Should I work on a patch for (b)?

Alternatively, would approach (a) be preferable to you?

Comment 2 Dave Malcolm 2011-10-27 18:19:55 UTC
gcc-4.6.2-1.fc16 has:

  * Thu Oct 27 2011 Jakub Jelinek <jakub> 4.6.2-1
  [...snip...]
  - add `gcc -print-file-name=rpmver` file with gcc NVRA for plugins
    (#744922)
  [...snip...]

Thanks; am investigating

Comment 3 Dave Malcolm 2011-10-27 18:31:02 UTC
$ rpm -q gcc
gcc-4.6.2-1.fc16.x86_64

$ gcc -print-file-name=rpmver
/usr/lib/gcc/x86_64-redhat-linux/4.6.2/rpmver

$ cat $(gcc -print-file-name=rpmver)
gcc-4.6.2-1.fc16.%{arch}

Comment 4 Fedora Update System 2011-10-27 20:03:27 UTC
gcc-4.6.2-1.fc16,libtool-2.4-7.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/gcc-4.6.2-1.fc16,libtool-2.4-7.fc16

Comment 5 Fedora Update System 2011-10-28 21:32:11 UTC
Package gcc-4.6.2-1.fc16, libtool-2.4-7.fc16, gcc-python-plugin-0.6-4.2.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing gcc-4.6.2-1.fc16 libtool-2.4-7.fc16 gcc-python-plugin-0.6-4.2.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2011-15040
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2011-10-29 06:32:36 UTC
gcc-4.6.2-1.fc16, libtool-2.4-7.fc16, gcc-python-plugin-0.6-4.2.fc16 has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.


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