Rubygem plugin changes with rubygems >= 3.2
Hi list, rubygems changed how and where plugins are installed, mostly for speeding up the loading of the gems [1]. Plugins are now installed as %{name}_plugin.rb into %gem_base/plugins/. This is a problem, as our current ruby packaging does not account for that and this broke the build of yard[2]. Any ideas how this can be addressed? Fedora solved this problem when rebasing to ruby 3.0 rather easily: https://src.fedoraproject.org/rpms/ruby/pull-request/76#request_diff But we cannot use their fix as it is, because we autogenerate the file lists, so we'll have to add some version check to the generator? I am honestly not really familiar with the inner workings of our gem2rpm fork or where to add it. But I need to fix this, as rubygem-yard is now consistently failing to build (and I don't consider turning ruby 3.0 off as a good way how to address this). Cheers, Dan Footnotes: [1] https://github.com/rubygems/rubygems/pull/3108 [2] https://build.opensuse.org/package/live_build_log/devel:languages:ruby:exten... -- Dan Čermák <dcermak@suse.com> Software Engineer Development tools SUSE Software Solutions Germany GmbH Maxfeldstr. 5 90409 Nuremberg Germany (HRB 36809, AG Nürnberg) Managing Director: Felix Imendörffer
the fix on our side is easy: ``` Index: gem_packages.spec.erb =================================================================== --- gem_packages.spec.erb (revision a62bfdd2060cc94ccb3ae1827fd01ca8) +++ gem_packages.spec.erb (working copy) @@ -78,6 +78,7 @@ gem_spec = Gem::Specification.new gem_base_dir = patch_libdir(gem_spec.base_dir) gem_cache_dir = patch_libdir(gem_spec.cache_dir) + gem_build_info_dir = patch_libdir(gem_spec.build_info_dir) gem_gems_dir = patch_libdir(gem_spec.gems_dir) gem_spec_dir = patch_libdir(gem_spec.spec_dir) gem_bin_dir = patch_libdir(patch_mod_full_name(gem_spec.bin_dir , mod_full_name )) @@ -89,6 +90,7 @@ gem_extension_dir = gem_spec.respond_to?(:extension_dir) ? patch_libdir(patch_mod_full_name(gem_spec.extension_dir, mod_full_name)) : nil gem_extension_doc = patch_libdir(get_extension_doc_dir(gem_spec)) #/ruby2.1 + gem_plugins_dir = Gem::Version.new(Gem::VERSION) >= Gem::Version.new("3.2.0") ? File.join(gem_spec.base_dir, 'plugins') : nil if config[:disable_docs].nil? config[:disable_docs] ||= true end @@ -211,6 +213,8 @@ # cache file <%= gem_cache_dir %>/<%= mod_full_name %>.gem <%= gem_gem_dir %> +<%= gem_plugins_dir %> +<%= gem_build_info_dir %> <% unless spec.extensions.empty? or gem_extension_dir.nil? -%> <%= gem_extension_dir %> <% end -%> ``` which leads to https://github.com/rubygems/rubygems/issues/4261 -- Always remember: Never accept the world as it appears to be. Dare to see it for what it could be. The world can always use more heroes.
participants (2)
-
Dan Čermák
-
Marcus Rückert