Issue #7788 has been updated by Andrew Parker.
Turns out that there is a small problem that is triggered on old rubygems
(1.6.4 showed the problem) where after asking for the available paths several
times it screws up and ends up trying to load a file that doesn't exist:
<pre>
1) Puppet::Util::Autoload when reloading files changes should be seen by
changed? on the instance using the short name
Failure/Error: @autoload.load("myfile")
Errno::ENOENT:
No such file or directory -
/home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/specifications/rake-0.8.7.gemspec
#
/home/hudson/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems.rb:490:in
`read'
#
/home/hudson/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems.rb:490:in
`each_load_path'
#
/home/hudson/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems.rb:486:in
`each'
#
/home/hudson/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems.rb:486:in
`each_load_path'
#
/home/hudson/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems.rb:640:in
`latest_load_paths'
#
/home/hudson/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems.rb:639:in
`each'
#
/home/hudson/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems.rb:639:in
`latest_load_paths'
# ./lib/puppet/util/rubygems.rb:45:in `directories'
# ./lib/puppet/util/autoload.rb:169:in `gem_directories'
# ./lib/puppet/util/autoload.rb:173:in `search_directories'
# ./lib/puppet/util/autoload.rb:96:in `get_file'
# ./lib/puppet/util/autoload.rb:64:in `load_file'
# ./lib/puppet/util/autoload.rb:208:in `load'
# ./spec/unit/util/autoload_spec.rb:190
#
/home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example.rb:80:in
`instance_eval'
#
/home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example.rb:80:in
`run'
#
/home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example.rb:173:in
`with_around_hooks'
#
/home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example.rb:77:in
`run'
#
/home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:355:in
`run_examples'
#
/home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:351:in
`map'
#
/home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:351:in
`run_examples'
#
/home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:337:in
`run'
#
/home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:338:in
`run'
#
/home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:338:in
`map'
#
/home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/example_group.rb:338:in
`run'
#
/home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:28:in
`run'
#
/home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:28:in
`map'
#
/home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:28:in
`run'
#
/home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/reporter.rb:34:in
`report'
#
/home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/command_line.rb:25:in
`run'
#
/home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:69:in
`run'
#
/home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/gems/rspec-core-2.9.0/lib/rspec/core/runner.rb:10:in
`autorun'
# /home/hudson/.rvm/gems/ruby-1.8.7-p334@noFeatures/bin/rspec:19
</pre>
The file that it is trying to load is actually found in
`/home/hudson/.rvm/gems/ruby-1.8.7-p334@global`, which is where it actually
loads it from the first few times. The fix is to cache the call to get the
paths.
Fix committed in e5d075c
----------------------------------------
Feature #7788: Puppet should allow rubygems to deliver new functionality
https://projects.puppetlabs.com/issues/7788#change-69773
Author: R.I. Pienaar
Status: Merged - Pending Release
Priority: Normal
Assignee:
Category: plug-ins
Target version: 3.0.0
Affected Puppet version:
Keywords: rubygems autoloader
Branch:
https://github.com/kelseyhightower/puppet/tree/feature/3.0rc/autoloader_works_with_rubygems
It would be desirable to use Rubygems to install things like parser functions.
There might be cases where you only want a function on the master, pluginsync
would copy it everywhere and everywhere might not have the dependencies needed
to run it.
If the autoloader considered the rubygem search path while autoloading this
should allow gems to extend puppet.
Update: Just to be clear, this ticket is about whether Puppet should allow
rubygems as a delivery mechanism for Puppet extensions like parser functions,
Faces, types and more. If added in, you could deliver Puppet extensions via
modules with pluginsync and via installing a Ruby gem. Both the Puppet DSL and
Puppet's Ruby DSL would be untouched.
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.