[#64703] Add `Hash#fetch_at` (issue #10017) — Wojtek Mach <wojtek@...>
Hey guys
1 message
2014/09/01
[#64711] [ruby-trunk - Bug #10193] [Closed] TestIO#test_readpartial_locktmp fails randomly — nobu@...
Issue #10193 has been updated by Nobuyoshi Nakada.
3 messages
2014/09/02
[#64744] [ruby-trunk - Bug #10202] [Open] TestBenchmark#test_realtime_output breaks on ARM — v.ondruch@...
Issue #10202 has been reported by Vit Ondruch.
3 messages
2014/09/03
[#64823] documenting constants — Xavier Noria <fxn@...>
I am writing a Rails guide about constant autoloading in Ruby on
5 messages
2014/09/07
[#64838] [ruby-trunk - Bug #10212] [Open] MRI is not for lambda calculus — ko1@...
Issue #10212 has been reported by Koichi Sasada.
6 messages
2014/09/08
[#64858] Re: [ruby-trunk - Bug #10212] [Open] MRI is not for lambda calculus
— Eric Wong <normalperson@...>
2014/09/08
rb_env_t may use a flexible array, helps a little even on my busy system:
[#64871] Re: [ruby-trunk - Bug #10212] [Open] MRI is not for lambda calculus
— SASADA Koichi <ko1@...>
2014/09/08
(2014/09/08 19:48), Eric Wong wrote:
[#64972] [ruby-trunk - Bug #10231] [Open] Process.detach(pid) defines new singleton classes every call — headius@...
Issue #10231 has been reported by Charles Nutter.
3 messages
2014/09/11
[#64980] [ruby-trunk - Bug #10212] MRI is not for lambda calculus — ko1@...
Issue #10212 has been updated by Koichi Sasada.
4 messages
2014/09/12
[#65142] [ruby-trunk - Feature #10267] [Open] Number of processors — akr@...
Issue #10267 has been reported by Akira Tanaka.
4 messages
2014/09/20
[#65144] Re: [ruby-trunk - Feature #10267] [Open] Number of processors
— Eric Wong <normalperson@...>
2014/09/20
akr@fsij.org wrote:
[#65210] [ruby-trunk - misc #10278] [Assigned] [RFC] st.c: use ccan linked list — nobu@...
Issue #10278 has been updated by Nobuyoshi Nakada.
3 messages
2014/09/22
[ruby-core:65320] [ruby-trunk - Feature #10305] [Open] Method for resolving all autoload statements / Add warning on autoload when used with chroot
From:
quintus@...
Date:
2014-09-29 14:05:51 UTC
List:
ruby-core #65320
Issue #10305 has been reported by Marvin Gテシlker.
----------------------------------------
Feature #10305: Method for resolving all autoload statements / Add warning on autoload when used with chroot
https://bugs.ruby-lang.org/issues/10305
* Author: Marvin Gテシlker
* Status: Open
* Priority: Normal
* Assignee:
* Category: core
* Target version:
----------------------------------------
Hi everyone,
I窶冦 currently trying to make my way to create a chrooted process using Dir.chroot. However, once these lines are executed:
~~~ ruby
Dir.chroot("/some/path/here")
Dir.chdir("/")
~~~
all libraries that use the #autoload method (which are quite a lot) fail with LoadErrors everywhere. This is natural, because after being locked into the chroot the referenced paths are simply gone. I could live with that if there was a method to load all the files referenced by #autoload immediately, which I would then simply call before I lock the process into the chroot. However, it appears there is not even a way to get a list of all constants that are to be autoloaded; the #autoload? method only allows checks for specific constants I simply do not have at hand without digging through all the library code, which is infeasable.
Therefore, I suggest do add one of the following methods to Ruby:
1. Kernel#load_autoloads that loads all modules referenced with #autoload right now.
2. Kernel#autoload_list that returns a list of symbols for the constants that are to be autoloaded.
The methods could probably also be on Module rather than on the Kernel module, but I guess this is topic for discussion.
I also suggest that when calling Dir::chroot() and there are constants that are marked as autoloadable, a warning should be printed that the referenced files cannot be loaded if the constants are ever used.
Steps to reproduce the LoadError problem after chroot:
Create a file "foo.rb" with this content:
~~~~~~~~~~~ ruby
autoload :Bar, File.join(Dir.pwd, "bar.rb")
Dir.chroot "/var/empty"
Dir.chdir "/"
Bar.new
~~~~~~~~~~~
Create a file "bar.rb" with this content:
~~~~~~~~~ ruby
class Bar
end
~~~~~~~~~
Ensure you have the directory "/var/empty", and it is empty.
Execute "foo.rb" with root rights.
~~~~~~~~~~~
$ sudo ruby foo.rb
foo.rb:6:in `<main>': cannot load such file -- /home/quintus/foo/bar.rb (LoadError)
~~~~~~~~~~~
Valete,
Marvin
--
https://bugs.ruby-lang.org/