Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

accelerate core ruby requires #1113

Merged
merged 1 commit into from
Nov 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions config/patches/ruby/ruby-fast-load_26.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
diff --git a/load.c b/load.c
index 576464fb68..ae89f63820 100644
--- a/load.c
+++ b/load.c
@@ -908,6 +908,11 @@ search_required(VALUE fname, volatile VALUE *path, int safe_level, feature_func
if (loading) *path = rb_filesystem_str_new_cstr(loading);
return 'r';
}
+ else if ((ft = rb_feature_p(ftptr, 0, FALSE, FALSE, &loading)) == 's') {
+ if (loading) *path = rb_filesystem_str_new_cstr(loading);
+ return 's';
+ }
+
tmp = fname;
type = rb_find_file_ext_safe(&tmp, loadable_ext, safe_level);
switch (type) {
8 changes: 8 additions & 0 deletions config/software/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@
patch source: "ruby-no-stack-protector.patch", plevel: 1, env: patch_env
end

# accelerate requires of c-extension.
#
# this would break code which did `require "thing"` and loaded thing.so and
# then fiddled with the libpath and did `require "thing"` and loaded thing.rb
# over the top of it. AFAIK no sane ruby code should need to do that, and the
# cost of this behavior in core ruby is enormous.
patch source: "ruby-fast-load_26.patch", plevel: 1, env: patch_env

# disable libpath in mkmf across all platforms, it trolls omnibus and
# breaks the postgresql cookbook. i'm not sure why ruby authors decided
# this was a good idea, but it breaks our use case hard. AIX cannot even
Expand Down