[#87773] timer thread [was Re: [ruby-alerts:7905] failure alert on trunk-asserts@silicon-docker (NG (r63844))] — Eric Wong <normalperson@...>
> test_all <main>: warning: pthread_create failed for timer: Resource temporarily unavailable, scheduling broken
[#87836] [Ruby trunk Bug#14898] test/lib/test/unit/parallel.rb: TestSocket#test_timestamp stuck sometimes — ko1@...
Issue #14898 has been reported by ko1 (Koichi Sasada).
ko1@atdot.net wrote:
On 2018/07/06 18:47, Eric Wong wrote:
[#87847] undefined symbol: mjit_init_p — Leam Hall <leamhall@...>
I pulled Ruby trunk on 3 Jul and am now getting errors similar to the
As I told you, `make install` is needed to make Ruby work. Running
One more reason for https://bugs.ruby-lang.org/issues/13620 maybe? ;)
Benoit Daloze <eregontp@gmail.com> wrote:
[#87986] [Ruby trunk Feature#14915] Deprecate String#crypt, move implementation to string/crypt — mame@...
Issue #14915 has been updated by mame (Yusuke Endoh).
mame@ruby-lang.org wrote:
normalperson (Eric Wong) wrote:
[#88088] [Ruby trunk Misc#14937] [PATCH] thread_pthread: lazy-spawn timer-thread only on contention — normalperson@...
Issue #14937 has been reported by normalperson (Eric Wong).
[#88104] [Ruby trunk Bug#14898] test/lib/test/unit/parallel.rb: TestSocket#test_timestamp stuck sometimes — ko1@...
Issue #14898 has been updated by ko1 (Koichi Sasada).
[#88173] [Ruby trunk Bug#14950] r64109 thread.c: move ppoll wrapper before thread_pthread.c - Windows compile failure - thread.c — Greg.mpls@...
Issue #14950 has been reported by MSP-Greg (Greg L).
[#88189] [Ruby trunk Bug#14950] r64109 thread.c: move ppoll wrapper before thread_pthread.c - Windows compile failure - thread.c — nobu@...
Issue #14950 has been updated by nobu (Nobuyoshi Nakada).
[#88199] [Ruby trunk Misc#14937] [PATCH] thread_pthread: lazy-spawn timer-thread only on contention — takashikkbn@...
Issue #14937 has been updated by k0kubun (Takashi Kokubun).
takashikkbn@gmail.com wrote:
> yet, sky3 had a failure at
> http://ci.rvm.jp/results/trunk@P895/1173951
> > http://ci.rvm.jp/results/trunk@P895/1173951
[ruby-core:88031] [Ruby trunk Feature#14927] Loading multiple files at once
Issue #14927 has been updated by shevegen (Robert A. Heiler).
I wanted to propose a more sophisticated load-process in ruby some time ago,
but I never got around it. I am even thinking of being able to load files
based on abbreviations/shortcuts, without necessiting a hardcoded path (e.
g. require needs the path, whereas with an abbreviation we could only
refer to that abbreviation, and an internal list keeps track of where the
actual file resides instead). But it's not so simple to suggest something
that has a real chance of inclusion. I am glad to see other people have
somewhat similar ideas - of course your suggestion is quite different
from my idea, but you tap into a very similar situation:
- Handling multiple files.
This is especially useful for larger ruby projects. For smaller projects
it is not so important perhaps but when you have like +50 .rb files and
growing, making things easier in regards to handling files, would be great.
To the suggestion - I think several ruby hackers may benefit from better
handling of files.
I am not sure if there is a big chance to see load() and require() itself
being changed, but I also don't know. I think we should ask matz, but there
may be a chance that they may not be changed, possibly due to backwards
compatibility (if there is a problem). In the long run we may want to
consider using alternative means. For example, the require-family, such
as require_relative(). I don't mean require_relative in itself, but
something related to require_*.
require_relative also handles location to other files, just relative to
the directory at hand.
By the way, I also understand this use case:
> This approach may not work if your files have dependencies like that:
And it is related to another use case which isn't a lot of fun:
- Circular dependencies + warnings about this
I also thought about this with my never-written proposal... :D
Circular dependency warnings are not a lot of fun IMO.
I think Hiroshi Shibata also had a suggestion in regards to ... require,
I think, some months or a few years ago, but I don't remember what it
was exactly.
Anyway, before I write way too much and digress from the suggestion,
I am in general in favour of your suggestion. I don't have any particular
opinion on your proposed solution - another API may be fine or perhaps
a new method... load_files() ? Hmm... may not be an ideal name either.
But I think the specific API may be a detail. The more important aspect
is whether ruby can provide easier means for ruby users to load or
require a batch of files. Perhaps load() and require() will remain as
they are, for simplicity and backwards compatibility, but in such a
case we could think about better ways to handle the task of "pulling
all necessary files" into a project. This may also help people when
they create gems.
In my own larger gems I do something very similar as to what S辿bastien
Durand showed, e. g. I also do Dir['*.rb'] often on a per-directory
basis. That way I don't have to specify the names of the individual
.rb files.
----------------------------------------
Feature #14927: Loading multiple files at once
https://bugs.ruby-lang.org/issues/14927#change-73048
* Author: deneb (S辿bastien Durand)
* Status: Open
* Priority: Normal
* Assignee:
* Target version:
----------------------------------------
Just a proof concept I wanted to share. Maybe it could be useful?
Say you want to load all the .rb files in your lib directory:
~~~ ruby
Dir['lib/**/*.rb'].each { |file| load(file) }
~~~
This approach may not work if your files have dependencies like that:
~~~ ruby
# lib/foo.rb
class Foo < Bar
end
~~~
~~~ ruby
# lib/bar.rb
class Bar
end
~~~
Foo class needs Bar class. You will get a NameError (uninitialized constant Bar).
So in my personal projects, I use this algorithm to load all my files and to automatically take care of dependencies (class/include):
~~~ ruby
def boot(files)
i = 0
while i < files.length
begin
load(files[i])
rescue NameError
i += 1
else
while i > 0
files.push(files.shift)
i -= 1
end
files.shift
end
end
end
~~~
~~~ ruby
boot Dir['lib/**/*.rb'] # It works! foo.rb and bar.rb are properly loaded.
~~~
My point is: it would be cool if Kernel#load could receive an array of filenames (to load all these files in the proper order). So we could load all our libs with just a single line:
~~~ ruby
load Dir['{path1,path2}/**/*.rb']
~~~
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>