Bug 822796 - FindRuby: Setting RUBY_VENDORARCH_DIR fails.
Summary: FindRuby: Setting RUBY_VENDORARCH_DIR fails.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: cmake
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Orion Poplawski
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-18 07:58 UTC by Ales Kozumplik
Modified: 2014-09-30 23:40 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-06-01 17:04:44 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Ales Kozumplik 2012-05-18 07:58:21 UTC
This is for cmake-2.8.5-3.fc16.x86_64 but there's the same problem with the rawhide version.

Steps to Reproduce:
1. Use "FIND_PACKAGE (Ruby)" to have FindRuby set ruby directories for you.

Actual results:
RUBY_VENDORARCH_DIR does not get set


Expected results:
RUBY_VENDORARCH_DIR gets set and points to rbconfig's Config::CONFIG['vendorarchdir']

Additional info:
FindRuby does the following to determine the dir:

   EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r vendor-specific -e "print 'true'"
      OUTPUT_VARIABLE RUBY_HAS_VENDOR_RUBY  ERROR_QUIET)

   IF(RUBY_HAS_VENDOR_RUBY)
      EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['vendorlibdir']"
         OUTPUT_VARIABLE RUBY_VENDORLIB_DIR)

      EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['vendorarchdir']"
         OUTPUT_VARIABLE RUBY_VENDORARCH_DIR)
   ENDIF(RUBY_HAS_VENDOR_RUBY)

But RUBY_HAS_VENDOR_RUBY always ends up false because vendor-specific is not an existing module in Fedora.

I am not sure if this is something to be fixed in ruby (i.e. adding the 'vendor-specific' module) or in CMake (i.e. using some other way to determine we are on a distro with vendor-specific dirs).

CCing bkabrda, a Ruby guy who knows about the situation.

Comment 1 Bohuslav "Slavek" Kabrda 2012-05-18 08:12:54 UTC
I guess that there are two possible options:

1) Find out if vendor dirs exist in some other way - maybe just looking if they are defined:
ruby -e "if Config::CONFIG.has_key?('vendorarchdir') then exit 0 else exit 1 end"

or

2) We could add the vendor-specific.rb file to Ruby (would have to communicate with Ruby SIG on this one). Are there any specific needs for this file or is it sufficient if it only exists?

CCing vondruch, who is Ruby maintainer in Fedora and will for sure bring in some more options/opinions on this.

Comment 2 Vít Ondruch 2012-05-18 09:17:00 UTC
Config was deprecated in favour of RbConfig:

$ ruby -r rbconfig -e "print Config::CONFIG['vendorlibdir']"
-e:1: Use RbConfig instead of obsolete and deprecated Config.

$ ruby -r rbconfig -e "print RbConfig::CONFIG['vendorlibdir']"
/usr/share/ruby/vendor_ruby

CMake should be updated if there is used "Config". Note that RbConfig works also for Ruby 1.8.7, so it should not be an issue.

Comment 3 Vít Ondruch 2012-05-18 09:32:40 UTC
Actually, I am not sure where the vendor-specific should come from. Isn't it part of CMake? There is also difference between Ruby 1.8 and 1.9. Ruby 1.8 will require the file which is in current directory, while Ruby 1.9 will not.

However I am not sure what is the issue, since you are referencing F16 and Rawhide, which have different Ruby versions.

Comment 4 Orion Poplawski 2012-05-21 16:32:19 UTC
[root@orca ~]# ruby -r vendor-specific -e "print 'true'"
ruby: no such file to load -- vendor-specific (LoadError)
[root@orca ~]# ruby -r rbconfig -e "print Config::CONFIG['vendorarchdir']"
/usr/lib/ruby/1.8/i386-linux
[root@orca ~]# ruby -r rbconfig -e "print RbConfig::CONFIG['vendorarchdir']"
/usr/lib/ruby/1.8/i386-linux

This has been reported upstream here: http://public.kitware.com/Bug/view.php?id=12965 but apparently there is no maintainer for FindRuby.  Apparently vendor-specific in an OpenSUSE thing.

Comment 5 Orion Poplawski 2012-05-21 16:40:19 UTC
Ales - Can you test cmake-2.8.8-4.fc18?  If that works for you I'll push updates to F16/17.

Comment 6 Vít Ondruch 2012-05-22 07:16:53 UTC
(In reply to comment #4)
> Apparently vendor-specific in an OpenSUSE thing.

Yes, it seems to be SUSE, taken from MacPorts ... but note that even on OpenSUSE, this "extension" is available just for Ruby 1.8

Comment 7 Ales Kozumplik 2012-05-22 07:59:18 UTC
(In reply to comment #5)
> Ales - Can you test cmake-2.8.8-4.fc18?  If that works for you I'll push
> updates to F16/17.

Thank you, works and FWIW the patch looks reasonable to me.

Comment 8 Ales Kozumplik 2012-05-22 08:01:44 UTC
(In reply to comment #3)
> Actually, I am not sure where the vendor-specific should come from. Isn't it
> part of CMake? There is also difference between Ruby 1.8 and 1.9. Ruby 1.8
> will require the file which is in current directory, while Ruby 1.9 will not.
> 
> However I am not sure what is the issue, since you are referencing F16 and
> Rawhide, which have different Ruby versions.

Yes, and it fails with both.

It indeed seems plausible that 'vendor-specific' is an (empty?) module in opensuse's ruby distribution, grepping for it with 'yum provides' didn't show anything on Fedora.

Comment 9 Fedora Update System 2012-05-22 16:16:48 UTC
cmake-2.8.8-4.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/cmake-2.8.8-4.fc16

Comment 10 Fedora Update System 2012-05-22 16:17:23 UTC
cmake-2.8.8-4.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/cmake-2.8.8-4.fc17

Comment 11 Fedora Update System 2012-05-24 15:34:39 UTC
Package cmake-2.8.8-4.fc17:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing cmake-2.8.8-4.fc17'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-8301/cmake-2.8.8-4.fc17
then log in and leave karma (feedback).

Comment 12 Fedora Update System 2012-06-01 17:04:44 UTC
cmake-2.8.8-4.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2012-06-10 01:33:21 UTC
cmake-2.8.8-4.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.