summaryrefslogtreecommitdiff
path: root/spec/ruby/optional/capi/spec_helper.rb
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-03-24 08:59:24 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-03-24 08:59:24 +0900
commit1357b14750275d2f2d13896688064e1a243007dd (patch)
treefb51821c73dfe17629eeb508199fc3ac67593c93 /spec/ruby/optional/capi/spec_helper.rb
parentcccfd6535065e3b57d84257782f9d3b1ff5bd77c (diff)
downloadruby-1357b14750275d2f2d13896688064e1a243007dd.tar.gz
Now all extension libraries must consider the ABI header
Diffstat (limited to 'spec/ruby/optional/capi/spec_helper.rb')
-rw-r--r--spec/ruby/optional/capi/spec_helper.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/ruby/optional/capi/spec_helper.rb b/spec/ruby/optional/capi/spec_helper.rb
index 9bd2d9791c..ec6b909397 100644
--- a/spec/ruby/optional/capi/spec_helper.rb
+++ b/spec/ruby/optional/capi/spec_helper.rb
@@ -29,7 +29,9 @@ def compile_extension(name)
ext = "#{name}_spec"
lib = "#{object_path}/#{ext}.#{RbConfig::CONFIG['DLEXT']}"
- ruby_header = "#{RbConfig::CONFIG['rubyhdrdir']}/ruby.h"
+ rubyhdrdir = RbConfig::CONFIG['rubyhdrdir']
+ ruby_header = "#{rubyhdrdir}/ruby.h"
+ abi_header = "#{rubyhdrdir}/ruby/internal/abi.h"
if RbConfig::CONFIG["ENABLE_SHARED"] == "yes"
libdirname = RbConfig::CONFIG['libdirname'] # defined since 2.1
@@ -45,6 +47,7 @@ def compile_extension(name)
when mtime <= File.mtime("#{core_ext_dir}/rubyspec.h")
when mtime <= File.mtime("#{spec_ext_dir}/#{ext}.c")
when mtime <= File.mtime(ruby_header)
+ when (mtime <= File.mtime(abi_header) rescue nil)
when libruby && mtime <= File.mtime(libruby)
else
return lib # up-to-date