ruby-changes:71266
From: Peter <ko1@a...>
Date: Thu, 24 Feb 2022 23:18:17 +0900 (JST)
Subject: [ruby-changes:71266] 9bd4b2ab14 (master): Add ABI version to RUBY_LIB_VERSION
https://git.ruby-lang.org/ruby.git/commit/?id=9bd4b2ab14 From 9bd4b2ab14eea3df392f4531887fcc1c59291d02 Mon Sep 17 00:00:00 2001 From: Peter Zhu <peter@p...> Date: Tue, 22 Feb 2022 16:40:32 -0500 Subject: Add ABI version to RUBY_LIB_VERSION This commit adds the ABI version as build metadata to RUBY_LIB_VERSION. This will ensure that gems are installed in a path with the ABI version. --- tool/mkconfig.rb | 9 --------- version.h | 7 +++++-- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/tool/mkconfig.rb b/tool/mkconfig.rb index 0dd25eb400..6e23af5185 100755 --- a/tool/mkconfig.rb +++ b/tool/mkconfig.rb @@ -229,15 +229,6 @@ end https://github.com/ruby/ruby/blob/trunk/tool/mkconfig.rb#L229 print " CONFIG[#{v.dump}] = #{(versions[v]||vars[v]).dump}\n" end -# Get the ABI version -File.foreach(File.join(srcdir, "include/ruby/internal/abi.h")) do |l| - m = /^\s*#\s*define\s+RUBY_ABI_VERSION\s+(\d+)/.match(l) - if m - print " CONFIG[\"ruby_abi_version\"] = \"#{m[1]}\"\n" - break - end -end - dest = drive ? %r'= "(?!\$[\(\{])(?i:[a-z]:)' : %r'= "(?!\$[\(\{])' v_disabled = {} v_others.collect! do |x| diff --git a/version.h b/version.h index 87f618044c..aea513716f 100644 --- a/version.h +++ b/version.h @@ -18,6 +18,7 @@ https://github.com/ruby/ruby/blob/trunk/version.h#L18 #define RUBY_RELEASE_DAY 24 #include "ruby/version.h" +#include "ruby/internal/abi.h" #ifndef TOKEN_PASTE #define TOKEN_PASTE(x,y) x##y @@ -39,9 +40,11 @@ https://github.com/ruby/ruby/blob/trunk/version.h#L40 #if !defined RUBY_LIB_VERSION && defined RUBY_LIB_VERSION_STYLE # if RUBY_LIB_VERSION_STYLE == 3 -# define RUBY_LIB_VERSION STRINGIZE(RUBY_API_VERSION_MAJOR)"."STRINGIZE(RUBY_API_VERSION_MINOR)"."STRINGIZE(RUBY_API_VERSION_TEENY) +# define RUBY_LIB_VERSION STRINGIZE(RUBY_API_VERSION_MAJOR)"."STRINGIZE(RUBY_API_VERSION_MINOR) \ + "."STRINGIZE(RUBY_API_VERSION_TEENY)"+"STRINGIZE(RUBY_ABI_VERSION) # elif RUBY_LIB_VERSION_STYLE == 2 -# define RUBY_LIB_VERSION STRINGIZE(RUBY_API_VERSION_MAJOR)"."STRINGIZE(RUBY_API_VERSION_MINOR) +# define RUBY_LIB_VERSION STRINGIZE(RUBY_API_VERSION_MAJOR)"."STRINGIZE(RUBY_API_VERSION_MINOR) \ + "+"STRINGIZE(RUBY_ABI_VERSION) # endif #endif -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/