From 8aec31c444d5a7be1403254f9d8418aef9c8a006 Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Wed, 14 Feb 2024 07:14:50 -0800 Subject: [PATCH] Drop unused rubygem-native/compiled components These were last referenced by bolt when using bootsnap to speed up load times, see 65fd77a9d59. They're now unused so delete them. --- configs/components/_base-rubygem-compiled.rb | 51 ----------------- .../_base-rubygem-native-extension.rb | 55 ------------------- 2 files changed, 106 deletions(-) delete mode 100644 configs/components/_base-rubygem-compiled.rb delete mode 100644 configs/components/_base-rubygem-native-extension.rb diff --git a/configs/components/_base-rubygem-compiled.rb b/configs/components/_base-rubygem-compiled.rb deleted file mode 100644 index 0d88ccbd0..000000000 --- a/configs/components/_base-rubygem-compiled.rb +++ /dev/null @@ -1,51 +0,0 @@ -# This file is a common basis for multiple rubygem components. -# -# It is used with gems that have native extensions that need compilation on windows -# -# It should not be included as a component itself; Instead, other components -# should load it with instance_eval after setting pkg.version. Parts of this -# shared configuration may be overridden afterward. - -name = pkg.get_name.gsub('rubygem-', '') -unless name && !name.empty? - raise "Rubygem component files that instance_eval _base-rubygem must be named rubygem-.rb" -end - -version = pkg.get_version -unless version && !version.empty? - raise "You must set the `pkg.version` in your rubygem component before instance_eval'ing _base-rubygem-native-extension.rb" -end - -pkg.build_requires "runtime-#{settings[:runtime_project]}" -pkg.build_requires "pl-ruby-patch" if platform.is_cross_compiled? - -if platform.is_windows? - # This part applies to all gems except gettext and gettext-setup - pkg.environment "PATH", "$(shell cygpath -u #{settings[:gcc_bindir]}):$(shell cygpath -u #{settings[:ruby_bindir]}):$(shell cygpath -u #{settings[:bindir]}):/cygdrive/c/Windows/system32:/cygdrive/c/Windows:/cygdrive/c/Windows/System32/WindowsPowerShell/v1.0" -end - -# When cross-compiling, we can't use the rubygems we just built. -# Instead we use the host gem installation and override GEM_HOME. Yay? -pkg.environment "GEM_HOME", settings[:gem_home] - -# PA-25 in order to install gems in a cross-compiled environment we need to -# set RUBYLIB to include puppet and hiera, so that their gemspecs can resolve -# hiera/version and puppet/version requires. Without this the gem install -# will fail by blowing out the stack. -if settings[:ruby_vendordir] - pkg.environment "RUBYLIB", "#{settings[:ruby_vendordir]}:$(RUBYLIB)" -end - -if platform.is_windows? - pkg.url("http://rubygems.org/downloads/#{name}-#{version}-x64-mingw32.gem") - pkg.mirror("#{settings[:buildsources_url]}/#{name}-#{version}-x64-mingw32.gem") - pkg.install do - "#{settings[:gem_install]} #{name}-#{version}-x64-mingw32.gem" - end -else - pkg.url("https://rubygems.org/downloads/#{name}-#{version}.gem") - pkg.mirror("#{settings[:buildsources_url]}/#{name}-#{version}.gem") - pkg.install do - "#{settings[:gem_install]} #{name}-#{version}.gem" - end -end diff --git a/configs/components/_base-rubygem-native-extension.rb b/configs/components/_base-rubygem-native-extension.rb deleted file mode 100644 index 4c536038a..000000000 --- a/configs/components/_base-rubygem-native-extension.rb +++ /dev/null @@ -1,55 +0,0 @@ -# This file is a common basis for multiple rubygem components. -# -# It is used with gems that have native extensions that need compilation on windows -# -# It should not be included as a component itself; Instead, other components -# should load it with instance_eval after setting pkg.version. Parts of this -# shared configuration may be overridden afterward. - -name = pkg.get_name.gsub('rubygem-', '') -unless name && !name.empty? - raise "Rubygem component files that instance_eval _base-rubygem must be named rubygem-.rb" -end - -version = pkg.get_version -unless version && !version.empty? - raise "You must set the `pkg.version` in your rubygem component before instance_eval'ing _base-rubygem-native-extension.rb" -end - -pkg.build_requires "runtime-#{settings[:runtime_project]}" -pkg.build_requires "pl-ruby-patch" if platform.is_cross_compiled? - -if platform.is_windows? - ruby_gem_ver = 'ruby-2.7.0' - ruby_bindir ||= settings[:ruby_bindir] - build_env_path = [ - "$(shell cygpath -u C:/ProgramData/chocolatey/lib/mingw/tools/install/mingw64/bin)", - "$(shell cygpath -u #{settings[:tools_root]}/bin)", - "$(shell cygpath -u #{settings[:tools_root]}/include)", - "$(shell cygpath -u #{settings[:bindir]})", - "$(shell cygpath -u #{ruby_bindir})", - "$(shell cygpath -u #{settings[:includedir]})", - "$(PATH)", - ].join(":") - pkg.environment "PATH", build_env_path - pkg.environment 'CONFIGURE_ARGS', "--with-cflags='-I#{settings[:includedir]}/#{ruby_gem_ver}'" -end - -# When cross-compiling, we can't use the rubygems we just built. -# Instead we use the host gem installation and override GEM_HOME. Yay? -pkg.environment "GEM_HOME", settings[:gem_home] - -# PA-25 in order to install gems in a cross-compiled environment we need to -# set RUBYLIB to include puppet and hiera, so that their gemspecs can resolve -# hiera/version and puppet/version requires. Without this the gem install -# will fail by blowing out the stack. -if settings[:ruby_vendordir] - pkg.environment "RUBYLIB", "#{settings[:ruby_vendordir]}:$(RUBYLIB)" -end - -pkg.url("https://rubygems.org/downloads/#{name}-#{version}.gem") -pkg.mirror("#{settings[:buildsources_url]}/#{name}-#{version}.gem") - -pkg.install do - "#{settings[:gem_install]} #{name}-#{version}.gem" -end