Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 528652 - dev-lang/ruby-2.0.0_p594 with dev-ruby/json-1.8.0 - file collisions in /usr/lib/debug/.build-id/*
Summary: dev-lang/ruby-2.0.0_p594 with dev-ruby/json-1.8.0 - file collisions in /usr/l...
Status: RESOLVED DUPLICATE of bug 491452
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-08 15:10 UTC by Łukasz Stelmach
Modified: 2015-01-05 18:11 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,589.76 KB, text/plain)
2014-11-08 15:45 UTC, Łukasz Stelmach
Details
List of files in dev-ruby/json-1.8.0 (json.txt,3.34 KB, text/plain)
2014-11-10 16:54 UTC, Łukasz Stelmach
Details
List of files in dev-lang/ruby-2.0.0_p594 (ruby.txt.bz2,93.90 KB, application/x-bzip2)
2014-11-10 16:57 UTC, Łukasz Stelmach
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Łukasz Stelmach 2014-11-08 15:10:02 UTC
Ruby 2.0.0_p594 fails to install due to file collisions with dev-ruby/json-1.8.0 (see attached build.log). Ruby requires the json package, even though ruby ships with only slightly older (1.7.7) version. With exactly the same parser.c file 

# find json-1.8.0/ ruby-2.0.0-p594/ext/json/ -name parser.c | xargs sha1sum
e3e3ab4c86ee5f7f1a63fc057285959729186a53  json-1.8.0/ext/json/ext/parser/parser.c
e3e3ab4c86ee5f7f1a63fc057285959729186a53  ruby-2.0.0-p594/ext/json/parser/parser.c

which is why the two packages provide the same debug file.

# ls -l /usr/lib/debug/.build-id/68/616d7d9c982e6fd3cb7722aa51fbd85d2423a2*
lrwxrwxrwx 1 root root 65 11-08 16:02 /usr/lib/debug/.build-id/68/616d7d9c982e6fd3cb7722aa51fbd85d2423a2 -> /usr/lib64/ruby/gems/2.0.0/gems/json-1.8.0/lib/json/ext/parser.so
lrwxrwxrwx 1 root root 76 11-08 16:02 /usr/lib/debug/.build-id/68/616d7d9c982e6fd3cb7722aa51fbd85d2423a2.debug -> ../../usr/lib64/ruby/gems/2.0.0/gems/json-1.8.0/lib/json/ext/parser.so.debug


Reproducible: Always
Comment 1 Łukasz Stelmach 2014-11-08 15:45:17 UTC
Created attachment 388876 [details]
build.log
Comment 2 Hans de Graaff gentoo-dev Security 2014-11-08 16:13:02 UTC

*** This bug has been marked as a duplicate of bug 491452 ***
Comment 3 Łukasz Stelmach 2014-11-09 12:24:28 UTC
I am glad that the collision problem has been managed more or less (the search engine is really poor because it didn't find bug 491452 when I asked for "dev-lang/ruby json"). However, I am still not sure why dev-lang/ruby-2.0.0_p594 requires separate >=dev-ruby/json-1.7.7 package.
Comment 4 Łukasz Stelmach 2014-11-09 13:12:39 UTC
Besides, applying the fix from https://bugs.gentoo.org/show_bug.cgi?id=526144#c5 makes dev-lang/ruby not provide the build-id files which IMHO can be deemed merely as a workaround for both this and bug 491452.
Comment 5 Hans de Graaff gentoo-dev Security 2014-11-10 07:07:04 UTC
(In reply to Łukasz Stelmach from comment #3)
> I am glad that the collision problem has been managed more or less (the
> search engine is really poor because it didn't find bug 491452 when I asked
> for "dev-lang/ruby json"). However, I am still not sure why
> dev-lang/ruby-2.0.0_p594 requires separate >=dev-ruby/json-1.7.7 package.

Because we prefer to unbundle code in Gentoo and many packages will request the gem version of the json code so that is what we need to provide in any case. Even if we would not unbundle the json code from dev-lang/ruby you would get the same build-id issues since in its current state is not compatible with how Gentoo manages things in terms of file collisions.
Comment 6 Łukasz Stelmach 2014-11-10 16:53:04 UTC
If I understand the term "unbundle" correctly, json isn't actually unbundled. Both packages have some common files (see attachments). Including parser.so

ruby:
./usr/lib64/ruby/2.0.0/x86_64-linux/json/ext/parser.so

json:
./usr/lib64/ruby/gems/2.0.0/gems/json-1.8.0/lib/json/ext/parser.so


If they were removed from ruby before installing/merging/packaging there would be no collision.
Comment 7 Łukasz Stelmach 2014-11-10 16:54:35 UTC
Created attachment 389016 [details]
List of files in dev-ruby/json-1.8.0
Comment 8 Łukasz Stelmach 2014-11-10 16:57:47 UTC
Created attachment 389022 [details]
List of files in dev-lang/ruby-2.0.0_p594
Comment 9 Hans de Graaff gentoo-dev Security 2015-01-05 18:11:04 UTC
(In reply to Łukasz Stelmach from comment #6)
> If I understand the term "unbundle" correctly, json isn't actually
> unbundled. Both packages have some common files (see attachments). Including
> parser.so
> 
> ruby:
> ./usr/lib64/ruby/2.0.0/x86_64-linux/json/ext/parser.so
> 
> json:
> ./usr/lib64/ruby/gems/2.0.0/gems/json-1.8.0/lib/json/ext/parser.so
> 
> 
> If they were removed from ruby before installing/merging/packaging there
> would be no collision.

You are correct in that we don't properly unbundle anymore. 

Unfortunately proper unbundling would not make a difference since we still need to compile parser.so to account for the bootstrap scenario, and at that point the build-id file would already be generated.