require_relative in std_lib
I noticed that there are some
require for internal files in
lib/. Ideally, they would be using
require_relative instead. This is faster and more explicit.
require_relative had a potential issue with symlinks that was fixed in 2.5, so libraries that might be loaded from earlier Ruby, like
rubygems, can not yet be updated.
I've created a PR and would like to know if there are comments / objections / things I'm missing.
Updated by MSP-Greg (Greg L) almost 2 years ago
The Appveyor run on the PR passed.
Appveyor testing has been intermittently failing. With parallel/multi testing (test-all and/or test-spec), there can be a lot more files being checked and possibly loaded. Considering more than one CI VM may be exist on a system, and they may share drives, anything that lowers disk I/O is good.
Updated by nobu (Nobuyoshi Nakada) almost 2 years ago
- Status changed from Open to Closed
Updated by stomar (Marcus Stollsteimer) almost 2 years ago
lib/racc/parser.rb I reverted this in r65514 for the require of
racc/cparse.so (similar to r65511 for
Possibly there might be other C extensions that are required from within
/lib, where require_relative would not work?
(I only had a quick look into
racc was an obvious other case, besides
cgi, where this problem might occur.)
PS. The LoadError for
racc/cparse is not that obvious because it is rescued and there is a Ruby fallback.