diff --git a/rubygem-bundler_ext-0.4.1-Fix-Bundler-1.8.1-test-failures.patch b/rubygem-bundler_ext-0.4.1-Fix-Bundler-1.8.1-test-failures.patch new file mode 100644 index 0000000..a8818ff --- /dev/null +++ b/rubygem-bundler_ext-0.4.1-Fix-Bundler-1.8.1-test-failures.patch @@ -0,0 +1,72 @@ +From e4e583af5539e9d9ec0d859721025cae4c290181 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?V=C3=ADt=20Ondruch?= +Date: Wed, 16 Sep 2020 14:40:35 +0200 +Subject: [PATCH] Fix Bundler 1.8.1+ test failures. + +This fixes issues such as: + + 1) BundlerExt::Runtime add_spec adds spec load paths not already on LOAD_PATH to it + Failure/Error: runtime.add_spec(spec) + LoadError: + cannot load such file -- rubygems/ext/builder + # /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in `require' + # /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:83:in `require' + # ./lib/bundler_ext/runtime.rb:20:in `new' + # ./lib/bundler_ext/runtime.rb:20:in `rubygems' + # ./lib/bundler_ext/runtime.rb:64:in `add_spec' + # ./spec/bundler_ext/runtime_spec.rb:164:in `block (3 levels) in ' + # ./spec/bundler_ext/runtime_spec.rb:145:in `block (3 levels) in ' + +These are caused by Bundler requiring to load additional libraries [[1]] +since Bundler 1.8.1. + +[1]: https://github.com/rubygems/bundler/commit/f86bd0712c3a1ed8138e5c0a056d6a5511e207c9 +--- + spec/bundler_ext/runtime_spec.rb | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/spec/bundler_ext/runtime_spec.rb b/spec/bundler_ext/runtime_spec.rb +index 2f246d0..edcc40f 100644 +--- a/spec/bundler_ext/runtime_spec.rb ++++ b/spec/bundler_ext/runtime_spec.rb +@@ -141,7 +141,7 @@ module BundlerExt + + describe "add_spec" do + around(:each) do |spec| +- orig = $LOAD_PATH ++ orig = $LOAD_PATH.dup + spec.run + + # XXX need to restore this way else we'll get an err: +@@ -150,9 +150,11 @@ module BundlerExt + orig.each { |o| $LOAD_PATH << o } + end + ++ # XXX needed to require rubygems/ext/builder in with Bundler 1.8.1+. ++ let!(:runtime) { described_class.new.tap {|c| c.rubygems} } ++ + it "marks spec as loaded" do + spec = Gem::Specification.new +- runtime = described_class.new + runtime.rubygems.should_receive(:mark_loaded).with(spec) + runtime.add_spec(spec) + end +@@ -160,7 +162,6 @@ module BundlerExt + it "adds spec load paths not already on LOAD_PATH to it" do + $LOAD_PATH.clear + spec = Gem::Specification.new :load_paths => ['foo'] +- runtime = described_class.new + runtime.add_spec(spec) + $LOAD_PATH.should include(*spec.load_paths) + end +@@ -169,7 +170,6 @@ module BundlerExt + spec = Gem::Specification.new :load_paths => ['foo'] + $LOAD_PATH.clear + $LOAD_PATH << spec.load_paths.first +- runtime = described_class.new + runtime.add_spec(spec) + $LOAD_PATH.size.should == 1 + end +-- +2.27.0 + diff --git a/rubygem-bundler_ext.spec b/rubygem-bundler_ext.spec index 0d0e455..ee0b77d 100644 --- a/rubygem-bundler_ext.spec +++ b/rubygem-bundler_ext.spec @@ -4,13 +4,16 @@ Summary: Load system gems via Bundler DSL Name: rubygem-%{gem_name} Version: 0.4.1 -Release: 10%{?dist} +Release: 11%{?dist} License: MIT URL: https://github.com/bundlerext/bundler_ext Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem +# Fix test failures due to Bundler 1.8.1+. +# https://github.com/bundlerext/bundler_ext/pull/22 +Patch0: rubygem-bundler_ext-0.4.1-Fix-Bundler-1.8.1-test-failures.patch BuildRequires: ruby(release) BuildRequires: rubygems-devel -BuildRequires: ruby +BuildRequires: ruby BuildRequires: rubygem(rspec) < 3 BuildRequires: rubygem(bundler) BuildRequires: rubygem(rails) @@ -30,22 +33,30 @@ BuildArch: noarch Documentation for %{name}. %prep -%setup -q -c -T -%gem_install -n %{SOURCE0} +%setup -q -n %{gem_name}-%{version} + +%patch0 -p1 %build +# Create the gem as gem install only works on a gem file +gem build ../%{gem_name}-%{version}.gemspec + +# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir +# by default, so that we can move it into the buildroot in %%install +%gem_install %install mkdir -p %{buildroot}%{gem_dir} -cp -pa .%{gem_dir}/* \ +cp -a .%{gem_dir}/* \ %{buildroot}%{gem_dir}/ + + %check pushd .%{gem_instdir} rspec2 spec popd - %files %dir %{gem_instdir} %exclude %{gem_instdir}/.* @@ -59,9 +70,13 @@ popd %doc %{gem_instdir}/CHANGELOG %doc %{gem_instdir}/README.md %{gem_instdir}/Rakefile -%{gem_instdir}/spec/ +%{gem_instdir}/spec %changelog +* Wed Sep 16 2020 Vít Ondruch - 0.4.1-1 +- Fix FTBFS due to test failures with Bundler 1.8.1+. + Resolves: rhbz#1865408 + * Sat Aug 01 2020 Fedora Release Engineering - 0.4.1-10 - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild