Skip to content

Commit

Permalink
Chef 15947/ruby 3.1.6 patch/muthuja (#1941)
Browse files Browse the repository at this point in the history
* add ruby 3.1.6 patch for rhel and suse platforms

Signed-off-by: muthuja <[email protected]>

* add ruby 3.1.6 patch for rhel and suse platforms

Signed-off-by: muthuja <[email protected]>

update sha id for msys2 devkit ruby

Signed-off-by: muthuja <[email protected]>

update sha id for msys2 devkit ruby

Signed-off-by: muthuja <[email protected]>

---------

Signed-off-by: muthuja <[email protected]>
  • Loading branch information
muthuja authored Sep 25, 2024
1 parent 2f804e8 commit 6343ead
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
31 changes: 31 additions & 0 deletions config/patches/ruby/ruby-3.1.6-configure.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
diff --git i/configure.ac w/configure.ac
index fcae66f775e..c933ed8b91f 100644
--- i/configure.ac
+++ w/configure.ac
@@ -363,6 +363,13 @@ AS_IF([test "$GCC" = yes], [
icc_version=`echo =__ICC | $CC -E -xc - | sed '/^=/!d;s///;/^__ICC/d'`
test -n "$icc_version" || icc_version=0
# RUBY_APPEND_OPTIONS(XCFLAGS, ["-include ruby/config.h" "-include ruby/missing.h"])
+
+ AC_CACHE_CHECK([if thread-local storage is supported], [rb_cv_tls_supported],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[int __thread conftest;]])],
+ [rb_cv_tls_supported=yes],
+ [rb_cv_tls_supported=no])])
+ AS_IF([test x"$rb_cv_tls_supported" != xyes],
+ [AC_DEFINE(RB_THREAD_LOCAL_SPECIFIER_IS_UNSUPPORTED)])
], [
linker_flag=
])
diff --git i/thread_pthread.h w/thread_pthread.h
index 2ac354046c0..7d4df3e2785 100644
--- i/thread_pthread.h
+++ w/thread_pthread.h
@@ -72,7 +72,7 @@ typedef struct rb_global_vm_lock_struct {

#if __STDC_VERSION__ >= 201112
#define RB_THREAD_LOCAL_SPECIFIER _Thread_local
-#elif defined(__GNUC__)
+#elif defined(__GNUC__) && !defined(RB_THREAD_LOCAL_SPECIFIER_IS_UNSUPPORTED)
/* note that ICC (linux) and Clang are covered by __GNUC__ */
#define RB_THREAD_LOCAL_SPECIFIER __thread
#else
2 changes: 1 addition & 1 deletion config/software/ruby-msys2-devkit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

version "3.1.6-1" do
source url: "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-#{version}/rubyinstaller-#{version}-x64.exe",
sha256: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
sha256: "42f71849f0ae053df8d40182e00ee82a98ac5faa69d815fa850566f2d3711174"
internal_source url: "#{ENV["ARTIFACTORY_REPO_URL"]}/#{name}/rubyinstaller-devkit-#{version}-x64.exe",
authorization: "X-JFrog-Art-Api:#{ENV["ARTIFACTORY_TOKEN"]}"
end
Expand Down
6 changes: 6 additions & 0 deletions config/software/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@
if suse? && version.satisfies?("= 3.1.4")
patch source: "ruby-3.1.4-configure.patch", plevel: 1, env: patch_env
end
if suse? && version.satisfies?("= 3.1.6")
patch source: "ruby-3.1.6-configure.patch", plevel: 1, env: patch_env
end

# RHEL6 has a base compiler that does not support -fstack-protector-strong, but we
# cannot build modern ruby on the RHEL6 base compiler, and the configure script
# determines that it supports that flag and so includes it and then ultimately
Expand All @@ -181,6 +185,8 @@
if rhel? && platform_version.satisfies?(">=7")
if version.satisfies?("= 3.1.4")
patch source: "ruby-3.1.4-configure.patch", plevel: 1, env: patch_env
elsif version.satisfies?("= 3.1.6")
patch source: "ruby-3.1.6-configure.patch", plevel: 1, env: patch_env
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion scripts/internal_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ software:
- url: https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.1.2-1/rubyinstaller-devkit-3.1.2-1-x64.exe
sha256: 5f0fd4a206b164a627c46e619d2babbcafb0ed4bc3e409267b9a73b6c58bdec1
- url: https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.1.6-1/rubyinstaller-devkit-3.1.6-1-x64.exe
sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
sha256: 42f71849f0ae053df8d40182e00ee82a98ac5faa69d815fa850566f2d3711174

- name: ruby
sources:
Expand Down

0 comments on commit 6343ead

Please sign in to comment.