FS#38411 - [ruby] Avoid conflicts between 'ruby' package and gem-based packages (rdoc, rake, ...)

Attached to Project: Arch Linux
Opened by Anatol Pomozov (anatolik) - Tuesday, 07 January 2014, 20:23 GMT
Last edited by Anatol Pomozov (anatolik) - Wednesday, 13 May 2015, 19:56 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Anatol Pomozov (anatolik)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Here is a discussion bug for the issue of conflicting ruby gems that are shipped in 'ruby' package.



I am trying to install https://aur.archlinux.org/packages/ruby-rake/ and it fails:

error: failed to commit transaction (conflicting files)
ruby-rake: /usr/bin/rake exists in filesystem


This comes from the fact that 'ruby' package already installs the gem with name 'rake'. In fact current version of ruby package installs following gems:

bigdecimal-1.2.0
io-console-0.4.2
json-1.7.7
minitest-4.3.2
psych-2.0.0
rake-0.9.6
rdoc-4.0.0
test-unit-2.0.0.0

So packages like 'ruby-rdoc', 'ruby-rake' are both require and conflict with ruby, thus they are useful only for non MRI ruby distros (like rubinius).

There should be a way to avoid conflicts like this, I see following solutions:

1) remove conflicting files (like those in /usr/bin/) from PKGBUILD and hope that we'll not have conflicts in /usr/lib/ruby/gems/2.0.0/gems/ (i.e. version in PKGBUILD will not match one in ruby package). Not very reliable solution.
2) add 'ruby-rake', 'ruby-rdoc'.... to provide=() and conflicts=() of 'ruby' package.
3) do not install gems in 'ruby' package and instead let users install gems via PKGBUILD.


For me it seems better to contact upstream and request #3 meanwhile use #2. But I would like to hear the maintainer opinion.
This task depends upon

Closed by  Anatol Pomozov (anatolik)
Wednesday, 13 May 2015, 19:56 GMT
Reason for closing:  Won't implement
Comment by Thomas Dziedzic (tomd123) - Wednesday, 08 January 2014, 07:32 GMT
Hello Anatol, thanks for bringing this up.

I see the packages you listed as part of the standard ruby experience [1].
Therefore options 1 and 3 aren't a good solution.

I will look into adding provides and conflicts for the packages listed.

[1] http://www.ruby-doc.org/stdlib-2.1.0/
Comment by Anatol Pomozov (anatolik) - Wednesday, 08 January 2014, 08:05 GMT
Thanks to you.

Even #2 has it's own problems. e.g. current ruby package installs json-1.7.7. If 'ruby' will provide 'ruby-json' it means users will not be able to install https://aur.archlinux.org/packages/ruby-json that currently a newer version (1.8.1). What if someone needs this version, not the old one from 'ruby'? At this point I have no clear solution for this problem....

wrt #1 I meant remove /usr/bin/* files from conflicting AUR packages like ruby-rdoc, ruby-rake,
Comment by Thomas Dziedzic (tomd123) - Wednesday, 08 January 2014, 22:53 GMT
Oh, that's what you meant. In that case if the conflict arrises in the bin file name, I think the bin filenames should be renamed in the ruby-{rake,...} packages that conflict with ruby
Comment by Thomas Dziedzic (tomd123) - Friday, 10 January 2014, 22:12 GMT
I'm going to close this ticket because I believe the correct solution is to have the packages in the aur rename their conflicting binaries which would allow them to be installed side by side with ruby.
Comment by Anatol Pomozov (anatolik) - Friday, 10 January 2014, 22:59 GMT
Thanks for reopening it. Feel free to assign the ticket to me so i'll track it more closely.


/usr/bin/ files are not the only one that can conflict. Other files are /usr/lib/ruby/gems/2.0.0/gems/ in case if version in ruby package matches version from PKGBUILD.

I'll contact upstream and try to discuss this question with them. I think the best way to solve the problem is to avoid installing any gems in 'ruby' package. If users needs gems (rake rdoc ...) it can
be easily installed from ruby-*. Or create a package group called 'ruby' that installs MRI+required gems.


BTW there is no need to rename binary files. These binaries are simple wrappers and the same for all versions, so the wrappers in /usr/bin can be easily removed from PKGBUILD.
Comment by Doug Newgard (Scimmia) - Wednesday, 13 May 2015, 19:43 GMT
Any progress on this, anatolik?
Comment by Anatol Pomozov (anatolik) - Wednesday, 13 May 2015, 19:56 GMT
No progress. This is low-priority task without clean solution. I am going to close it for now.

Loading...