Compare commits

..

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
fe7da81a8e
!10 [sync] PR-9: fix mocha/minitest dependency issue due to rubygem-mocha upgrade
From: @openeuler-sync-bot 
Reviewed-by: @small_leek 
Signed-off-by: @small_leek
2022-10-19 09:33:34 +00:00
cherry530
b8c1df13bf Fixed mocha/minitest dependency issue due to rubygem-mocha upgrade
Signed-off-by: cherry530 <xuping33@huawei.com>
(cherry picked from commit e22bb051660ce0d640bb1ca43e42d3ec212e0b5a)
2022-10-19 09:04:12 +08:00
openeuler-ci-bot
7e6618185b
!8 [sync] PR-7: 【轻量级 PR】:update rubygem-bootsnap.spec.
From: @openeuler-sync-bot 
Reviewed-by: @shinwell_hu 
Signed-off-by: @shinwell_hu
2022-06-11 06:52:18 +00:00
温志伟
a04875936e update rubygem-bootsnap.spec.
(cherry picked from commit aa275faebd63acae37c03b1cb4b0497e7b2f6018)
2022-06-11 12:07:30 +08:00
openeuler-ci-bot
0905a4c8f8
!4 修复rubygem-bootsnap编译在check阶段失败报错no implicit conversion of String into Integer (TypeError)
Merge pull request !4 from 吴磊磊/openEuler-22.03-LTS-Next
2022-01-27 07:04:44 +00:00
wu-leilei
068ae4620e fix no implicit conversion of String into Integer 2022-01-27 11:35:21 +08:00
openeuler-ci-bot
9c9602d7cf !2 fix build fail
Merge pull request !2 from lyn/master
2020-09-09 09:25:32 +08:00
lyn1001
6a45feeb65 fix build fail 2020-09-08 22:59:43 +08:00
openeuler-ci-bot
0fd022e2bc !1 init
Merge pull request !1 from 王琳/master
2020-09-01 09:55:51 +08:00
王琳
610a38a447 删除文件 bootsnap-1.3.2-tests.tgz 2020-08-28 16:48:10 +08:00
3 changed files with 75 additions and 2 deletions

Binary file not shown.

View File

@ -0,0 +1,60 @@
From 97dd9c266fbaac188d39f7d545aa54aef80c3070 Mon Sep 17 00:00:00 2001
From: wu-leilei <wu18740459704@163.com>
Date: Thu, 27 Jan 2022 09:35:50 +0800
Subject: [PATCH] test 3
---
ext/bootsnap/bootsnap.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/ext/bootsnap/bootsnap.c b/ext/bootsnap/bootsnap.c
index e0c5307..d29219a 100644
--- a/ext/bootsnap/bootsnap.c
+++ b/ext/bootsnap/bootsnap.c
@@ -94,6 +94,7 @@ static int cache_key_equal(struct bs_cache_key * k1, struct bs_cache_key * k2);
static VALUE bs_fetch(char * path, VALUE path_v, char * cache_path, VALUE handler);
static int open_current_file(char * path, struct bs_cache_key * key, char ** errno_provenance);
static int fetch_cached_data(int fd, ssize_t data_size, VALUE handler, VALUE * output_data, int * exception_tag, char ** errno_provenance);
+static uint32_t get_ruby_revision(void);
static uint32_t get_ruby_platform(void);
/*
@@ -134,7 +135,7 @@ Init_bootsnap(void)
rb_mBootsnap_CompileCache_Native = rb_define_module_under(rb_mBootsnap_CompileCache, "Native");
rb_eBootsnap_CompileCache_Uncompilable = rb_define_class_under(rb_mBootsnap_CompileCache, "Uncompilable", rb_eStandardError);
- current_ruby_revision = FIX2INT(rb_const_get(rb_cObject, rb_intern("RUBY_REVISION")));
+ current_ruby_revision = get_ruby_revision();
current_ruby_platform = get_ruby_platform();
uncompilable = rb_intern("__bootsnap_uncompilable__");
@@ -191,6 +192,26 @@ fnv1a_64(const char *str)
return fnv1a_64_iter(h, str);
}
+/*
+ * Ruby's revision may be Integer or String. CRuby 2.7 or later uses
+ * Git commit ID as revision. It's String.
+ */
+static uint32_t
+get_ruby_revision(void)
+{
+ VALUE ruby_revision;
+
+ ruby_revision = rb_const_get(rb_cObject, rb_intern("RUBY_REVISION"));
+ if (RB_TYPE_P(ruby_revision, RUBY_T_FIXNUM)) {
+ return FIX2INT(ruby_revision);
+ } else {
+ uint64_t hash;
+
+ hash = fnv1a_64(StringValueCStr(ruby_revision));
+ return (uint32_t)(hash >> 32);
+ }
+}
+
/*
* When ruby's version doesn't change, but it's recompiled on a different OS
* (or OS version), we need to invalidate the cache.
--
2.23.0

View File

@ -1,12 +1,13 @@
%global gem_name bootsnap
Name: rubygem-%{gem_name}
Version: 1.3.2
Release: 1
Release: 4
Summary: Boot large ruby/rails apps faster
License: MIT
URL: https://github.com/Shopify/bootsnap
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
Source1: https://github.com/Shopify/bootsnap/archive/v1.3.2.tar.gz
Patch1: fix-no-implicit-conversion-of-String-into-Integer.patch
BuildRequires: ruby(release) rubygems-devel ruby-devel >= 2.0.0 rubygem(minitest)
BuildRequires: rubygem(mocha) rubygem(msgpack) gcc
ExcludeArch: armv7hl
@ -23,6 +24,7 @@ Documentation for %{name}.
%prep
%setup -q -n %{gem_name}-%{version}
%patch1 -p1
sed -i -e "/^\s*\$CFLAGS / s/^/#/g" \
ext/bootsnap/extconf.rb
@ -42,8 +44,10 @@ rm -rf %{buildroot}%{gem_instdir}/ext/
%check
pushd .%{gem_instdir}
tar xzvf %{SOURCE1}
ln -s %{gem_name}-%{version}/test test
sed -i 'N;38a\ if RUBY_REVISION.is_a?(String)\n exp = [Help.fnv1a_64(RUBY_REVISION) >> 32].pack("L")\n else\n exp = [RUBY_REVISION].pack("L")\n end' bootsnap-1.3.2/test/compile_cache_key_format_test.rb
sed -i '38 d' bootsnap-1.3.2/test/compile_cache_key_format_test.rb
sed -i -e "/require 'bundler/ s/^/#/g" \
-e "/require 'mocha\/minitest/ s/minitest/mini_test/g" \
test/test_helper.rb
sed -i -e "/^\s*assert stable.stable?,/ s/^/#/g" \
-e "/^\s*refute stable.volatile?,/ s/^/#/g" \
@ -77,5 +81,14 @@ popd
%doc %{gem_instdir}/CODE_OF_CONDUCT.md
%changelog
* Tue Jul 05 2022 xu_ping <xuping33@h-partners.com> - 1.3.2-4
- fixed mocha/minitest dependency issue due to rubygem-mocha upgrade
* Thu Jan 27 2022 wulei <wulei@huawei.com> - 1.3.2-3
- fix no implicit conversion of String into Integer
* Tue Sep 8 2020 yanan li <liyanan032@huawei.com> - 1.3.2-2
- fix build fail
* Tue Aug 18 2020 wanglin <wanglin175@huawei.com> - 1.3.2-1
- package init