Bundle Racc into StdLib.

It is increasingly hard to maintain default gems extracted from StdLib
into gems. If they are overlapped by independent versions, it is even
harder, because the overlapped versions would need to provide symlinks
back to StdLib \[[1]\]. On top of that, the layout differs from
upstream, where default gems are always available.

Because these small nuances can make hard discoverable race conditions
during Ruby application loading and runtime, it will be best to keep the
default gems bundled.

[1]: https://src.fedoraproject.org/rpms/rubygem-racc/pull-request/1
This commit is contained in:
Vít Ondruch 2020-03-30 17:39:57 +02:00
parent c63e907e87
commit baf046a6a4

View File

@ -164,7 +164,6 @@ Recommends: rubygem(bigdecimal) >= %{bigdecimal_version}
# https://bugs.ruby-lang.org/issues/16431 # https://bugs.ruby-lang.org/issues/16431
Requires: rubygem(did_you_mean) >= %{did_you_mean_version} Requires: rubygem(did_you_mean) >= %{did_you_mean_version}
Recommends: rubygem(openssl) >= %{openssl_version} Recommends: rubygem(openssl) >= %{openssl_version}
Recommends: rubygem(racc) >= %{racc_version}
BuildRequires: autoconf BuildRequires: autoconf
BuildRequires: gdbm-devel BuildRequires: gdbm-devel
@ -220,6 +219,9 @@ Provides: bundled(ccan-check_type)
Provides: bundled(ccan-container_of) Provides: bundled(ccan-container_of)
Provides: bundled(ccan-list) Provides: bundled(ccan-list)
# StdLib default gems.
Provides: bundled(rubygem-racc) = %{racc_version}
# Tcl/Tk support was removed from stdlib in Ruby 2.4, i.e. F27 timeframe # Tcl/Tk support was removed from stdlib in Ruby 2.4, i.e. F27 timeframe
# so lets obsolete it. This is not the best place, but we don't have # so lets obsolete it. This is not the best place, but we don't have
# better, unless https://fedorahosted.org/fpc/ticket/645 provides some # better, unless https://fedorahosted.org/fpc/ticket/645 provides some
@ -276,6 +278,8 @@ Macros and development tools for packaging RubyGems.
Summary: Default gems which are part of Ruby StdLib. Summary: Default gems which are part of Ruby StdLib.
Requires: ruby(rubygems) >= %{rubygems_version} Requires: ruby(rubygems) >= %{rubygems_version}
Supplements: ruby(rubygems) Supplements: ruby(rubygems)
# Obsoleted by Ruby 2.7 in F32 timeframe.
Obsoletes: rubygem-racc < %{racc_version}-%{release}
BuildArch: noarch BuildArch: noarch
%description default-gems %description default-gems
@ -443,19 +447,6 @@ Bundler manages an application's dependencies through its entire life, across
many machines, systematically and repeatably. many machines, systematically and repeatably.
%package -n rubygem-racc
Summary: Racc is a LALR(1) parser generator
Version: %{racc_version}
License: MIT
Requires: ruby(release)
Requires: ruby(rubygems) >= %{rubygems_version}
Provides: rubygem(racc) = %{version}-%{release}
%description -n rubygem-racc
Racc is a LALR(1) parser generator. It is written in Ruby itself, and
generates Ruby program.
# Bundled gems # Bundled gems
# #
# These are regular packages, which might be installed just optionally. Users # These are regular packages, which might be installed just optionally. Users
@ -753,27 +744,6 @@ ln -s %{gem_dir}/gems/psych-%{psych_version}/lib/psych %{buildroot}%{ruby_libdir
ln -s %{gem_dir}/gems/psych-%{psych_version}/lib/psych.rb %{buildroot}%{ruby_libdir}/psych.rb ln -s %{gem_dir}/gems/psych-%{psych_version}/lib/psych.rb %{buildroot}%{ruby_libdir}/psych.rb
ln -s %{_libdir}/gems/%{name}/psych-%{psych_version}/psych.so %{buildroot}%{ruby_libarchdir}/psych.so ln -s %{_libdir}/gems/%{name}/psych-%{psych_version}/psych.so %{buildroot}%{ruby_libarchdir}/psych.so
# These have wrong shebangs. Exclude them for now and let's see what upstream
# thinks about them.
# https://bugs.ruby-lang.org/issues/15982
rm %{buildroot}%{_bindir}/{racc2y,y2racc}
rm %{buildroot}%{gem_dir}/gems/racc-%{racc_version}/bin/{racc2y,y2racc}
mkdir -p %{buildroot}%{gem_dir}/gems/racc-%{racc_version}/lib
mkdir -p %{buildroot}%{_libdir}/gems/%{name}/racc-%{racc_version}
mv %{buildroot}%{ruby_libdir}/racc* %{buildroot}%{gem_dir}/gems/racc-%{racc_version}/lib
mv %{buildroot}%{ruby_libarchdir}/racc/ %{buildroot}%{_libdir}/gems/%{name}/racc-%{racc_version}/
touch %{buildroot}%{_libdir}/gems/%{name}/racc-%{racc_version}/gem.build_complete
mv %{buildroot}%{gem_dir}/specifications/default/racc-%{racc_version}.gemspec %{buildroot}%{gem_dir}/specifications
# This used to be directories when racc was integral part of StdLib => Keep
# them as directories and link everything in them to prevent directory =>
# symlink conversion RPM issues.
mkdir -p %{buildroot}%{ruby_libdir}/racc
mkdir -p %{buildroot}%{ruby_libarchdir}/racc
find %{buildroot}%{gem_dir}/gems/racc-%{racc_version}/lib/racc -maxdepth 1 -type f -exec \
sh -c 'ln -s %{gem_dir}/gems/racc-%{racc_version}/lib/racc/`basename {}` %{buildroot}%{ruby_libdir}/racc' \;
ln -s %{gem_dir}/gems/racc-%{racc_version}/lib/racc.rb %{buildroot}%{ruby_libdir}/racc.rb
ln -s %{_libdir}/gems/%{name}/racc-%{racc_version}/racc/cparse.so %{buildroot}%{ruby_libarchdir}/racc/cparse.so
# Move the binary extensions into proper place (if no gem has binary extension, # Move the binary extensions into proper place (if no gem has binary extension,
# the extensions directory might be empty). # the extensions directory might be empty).
find %{buildroot}%{gem_dir}/extensions/*-%{_target_os}/%{ruby_version}/* -maxdepth 0 \ find %{buildroot}%{gem_dir}/extensions/*-%{_target_os}/%{ruby_version}/* -maxdepth 0 \
@ -949,7 +919,6 @@ make check TESTS="-v $DISABLE_TESTS" MSPECOPT="-fs $MSPECOPTS"
%exclude %{ruby_libdir}/json* %exclude %{ruby_libdir}/json*
%exclude %{ruby_libdir}/openssl* %exclude %{ruby_libdir}/openssl*
%exclude %{ruby_libdir}/psych* %exclude %{ruby_libdir}/psych*
%exclude %{ruby_libdir}/racc*
%{ruby_libdir}/abbrev.rb %{ruby_libdir}/abbrev.rb
%{ruby_libdir}/base64.rb %{ruby_libdir}/base64.rb
%{ruby_libdir}/benchmark* %{ruby_libdir}/benchmark*
@ -1120,6 +1089,11 @@ make check TESTS="-v $DISABLE_TESTS" MSPECOPT="-fs $MSPECOPTS"
%{ruby_libarchdir}/syslog.so %{ruby_libarchdir}/syslog.so
%{ruby_libarchdir}/zlib.so %{ruby_libarchdir}/zlib.so
# Default gems
%{ruby_libdir}/racc*
%dir %{ruby_libarchdir}/racc
%{ruby_libarchdir}/racc/cparse.so
%{?with_systemtap:%{tapset_root}} %{?with_systemtap:%{tapset_root}}
%files -n rubygems %files -n rubygems
@ -1191,6 +1165,18 @@ make check TESTS="-v $DISABLE_TESTS" MSPECOPT="-fs $MSPECOPTS"
%{gem_dir}/specifications/default/yaml-0.1.0.gemspec %{gem_dir}/specifications/default/yaml-0.1.0.gemspec
%{gem_dir}/specifications/default/zlib-1.1.0.gemspec %{gem_dir}/specifications/default/zlib-1.1.0.gemspec
# Use standalone rubygem-racc if Racc binary is required. Shipping this
# executable in both packages might possibly cause conflicts. The situation
# could be better if Ruby generated these files:
# https://github.com/ruby/ruby/pull/2545
%exclude %{_bindir}/racc
# These have wrong shebangs. Exclude them for now and let's see what upstream
# thinks about them.
# https://bugs.ruby-lang.org/issues/15982
%exclude %{_bindir}/{racc2y,y2racc}
%exclude %{gem_dir}/gems/racc-%{racc_version}/bin/{racc2y,y2racc}
%{gem_dir}/gems/racc-%{racc_version}
%{gem_dir}/specifications/default/racc-1.4.16.gemspec
%files -n rubygem-irb %files -n rubygem-irb
%{_bindir}/irb %{_bindir}/irb
@ -1262,14 +1248,6 @@ make check TESTS="-v $DISABLE_TESTS" MSPECOPT="-fs $MSPECOPTS"
%{_mandir}/man1/bundle*.1* %{_mandir}/man1/bundle*.1*
%{_mandir}/man5/gemfile.5* %{_mandir}/man5/gemfile.5*
%files -n rubygem-racc
%{ruby_libdir}/racc*
%{ruby_libarchdir}/racc
%{_bindir}/racc
%{_libdir}/gems/%{name}/racc-%{racc_version}
%{gem_dir}/gems/racc-%{racc_version}
%{gem_dir}/specifications/racc-%{racc_version}.gemspec
%files -n rubygem-minitest %files -n rubygem-minitest
%{gem_dir}/gems/minitest-%{minitest_version} %{gem_dir}/gems/minitest-%{minitest_version}
%exclude %{gem_dir}/gems/minitest-%{minitest_version}/.* %exclude %{gem_dir}/gems/minitest-%{minitest_version}/.*
@ -1311,6 +1289,7 @@ make check TESTS="-v $DISABLE_TESTS" MSPECOPT="-fs $MSPECOPTS"
%changelog %changelog
* Thu Apr 02 2020 Vít Ondruch <vondruch@redhat.com> - 2.7.1-129 * Thu Apr 02 2020 Vít Ondruch <vondruch@redhat.com> - 2.7.1-129
- Add ruby-default-gems subpackage shipping all extra default gem content. - Add ruby-default-gems subpackage shipping all extra default gem content.
- Bundle Racc into StdLib.
* Wed Apr 01 2020 Vít Ondruch <vondruch@redhat.com> - 2.7.1-128 * Wed Apr 01 2020 Vít Ondruch <vondruch@redhat.com> - 2.7.1-128
- Upgrade to Ruby 2.7.1. - Upgrade to Ruby 2.7.1.