From 1b1a8b34c872bc55f2acf77e44ac70e6e1efcab7 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Tue, 9 May 2017 09:39:23 -0700 Subject: simplify omnibus config and greenify builds again this is also necessary for bundler-1.14.x i'm still not entirely clear why we ever needed all the fussy software gem configs or what the build-chef / build-chef-gem infrastructure ever did for us. it seems to have been mostly micro-optimization around building the software gems before bundle installing the project in order to take advantage of git caching. i aggressively don't care about that, this is quite fast enough. we can install nokogiri and libgecode early and that should take care of 98% of the build optimization issue. Signed-off-by: Lamont Granquist --- omnibus/config/software/chef-appbundle.rb | 18 ----- omnibus/config/software/chef-cleanup.rb | 30 -------- omnibus/config/software/chef-complete.rb | 20 ----- .../config/software/chef-gem-bcrypt_pbkdf-ruby.rb | 10 --- .../config/software/chef-gem-binding_of_caller.rb | 10 --- omnibus/config/software/chef-gem-byebug.rb | 10 --- .../config/software/chef-gem-debug_inspector.rb | 10 --- omnibus/config/software/chef-gem-ffi-yajl.rb | 12 --- omnibus/config/software/chef-gem-ffi.rb | 12 --- omnibus/config/software/chef-gem-inspec.rb | 10 --- omnibus/config/software/chef-gem-json.rb | 11 --- omnibus/config/software/chef-gem-libyajl2.rb | 10 --- omnibus/config/software/chef-gem-mini_portile2.rb | 10 --- omnibus/config/software/chef-gem-nokogiri.rb | 13 ---- omnibus/config/software/chef-gem-ohai.rb | 10 --- omnibus/config/software/chef-gem-pkg-config.rb | 10 --- .../config/software/chef-gem-rbnacl-libsodium.rb | 10 --- omnibus/config/software/chef-gem-ruby-prof.rb | 10 --- omnibus/config/software/chef-gem-ruby-shadow.rb | 11 --- omnibus/config/software/chef.rb | 88 ---------------------- 20 files changed, 325 deletions(-) delete mode 100644 omnibus/config/software/chef-appbundle.rb delete mode 100644 omnibus/config/software/chef-cleanup.rb delete mode 100644 omnibus/config/software/chef-complete.rb delete mode 100644 omnibus/config/software/chef-gem-bcrypt_pbkdf-ruby.rb delete mode 100644 omnibus/config/software/chef-gem-binding_of_caller.rb delete mode 100644 omnibus/config/software/chef-gem-byebug.rb delete mode 100644 omnibus/config/software/chef-gem-debug_inspector.rb delete mode 100644 omnibus/config/software/chef-gem-ffi-yajl.rb delete mode 100644 omnibus/config/software/chef-gem-ffi.rb delete mode 100644 omnibus/config/software/chef-gem-inspec.rb delete mode 100644 omnibus/config/software/chef-gem-json.rb delete mode 100644 omnibus/config/software/chef-gem-libyajl2.rb delete mode 100644 omnibus/config/software/chef-gem-mini_portile2.rb delete mode 100644 omnibus/config/software/chef-gem-nokogiri.rb delete mode 100644 omnibus/config/software/chef-gem-ohai.rb delete mode 100644 omnibus/config/software/chef-gem-pkg-config.rb delete mode 100644 omnibus/config/software/chef-gem-rbnacl-libsodium.rb delete mode 100644 omnibus/config/software/chef-gem-ruby-prof.rb delete mode 100644 omnibus/config/software/chef-gem-ruby-shadow.rb delete mode 100644 omnibus/config/software/chef.rb (limited to 'omnibus/config/software') diff --git a/omnibus/config/software/chef-appbundle.rb b/omnibus/config/software/chef-appbundle.rb deleted file mode 100644 index 8ea21103fb..0000000000 --- a/omnibus/config/software/chef-appbundle.rb +++ /dev/null @@ -1,18 +0,0 @@ -name "chef-appbundle" -default_version "local_source" - -license :project_license -skip_transitive_dependency_licensing true - -source path: project.files_path - -dependency "chef" - -build do - # This is where we get the definitions below - require_relative "../../files/chef-appbundle/build-chef-appbundle" - extend BuildChefAppbundle - - appbundle_gem "chef" - appbundle_gem "ohai" -end diff --git a/omnibus/config/software/chef-cleanup.rb b/omnibus/config/software/chef-cleanup.rb deleted file mode 100644 index 302e841699..0000000000 --- a/omnibus/config/software/chef-cleanup.rb +++ /dev/null @@ -1,30 +0,0 @@ -name "chef-cleanup" -default_version "local_source" - -license :project_license -skip_transitive_dependency_licensing true - -source path: project.files_path - -dependency "chef" - -build do - # This is where we get the definitions below - require_relative "../../files/chef/build-chef" - extend BuildChef - - # Clear the now-unnecessary git caches, cached gems, and git-checked-out gems - block "Delete bundler git cache and git installs" do - gemdir = shellout!("#{gem_bin} environment gemdir", env: env).stdout.chomp - remove_directory "#{gemdir}/cache" - remove_directory "#{gemdir}/bundler" - end - - delete "#{install_dir}/embedded/docs" - delete "#{install_dir}/embedded/share/man" - delete "#{install_dir}/embedded/share/doc" - delete "#{install_dir}/embedded/share/gtk-doc" - delete "#{install_dir}/embedded/ssl/man" - delete "#{install_dir}/embedded/man" - delete "#{install_dir}/embedded/info" -end diff --git a/omnibus/config/software/chef-complete.rb b/omnibus/config/software/chef-complete.rb deleted file mode 100644 index 4e2b9f6ec2..0000000000 --- a/omnibus/config/software/chef-complete.rb +++ /dev/null @@ -1,20 +0,0 @@ -name "chef-complete" - -license :project_license -skip_transitive_dependency_licensing true - -dependency "chef" -dependency "chef-appbundle" -dependency "chef-cleanup" - -dependency "gem-permissions" -dependency "shebang-cleanup" -dependency "version-manifest" -dependency "openssl-customization" - -if windows? - # TODO can this be safely moved to before the chef? - # It would make caching better ... - dependency "ruby-windows-devkit" - dependency "ruby-windows-devkit-bash" -end diff --git a/omnibus/config/software/chef-gem-bcrypt_pbkdf-ruby.rb b/omnibus/config/software/chef-gem-bcrypt_pbkdf-ruby.rb deleted file mode 100644 index 1f7f4d3207..0000000000 --- a/omnibus/config/software/chef-gem-bcrypt_pbkdf-ruby.rb +++ /dev/null @@ -1,10 +0,0 @@ -# gem installs this gem from the version specified in chef's Gemfile.lock -# so we can take advantage of omnibus's caching. Just duplicate this file and -# add the new software def to chef software def if you want to separate -# another gem's installation. -require_relative "../../files/chef-gem/build-chef-gem/gem-install-software-def" -BuildChefGem::GemInstallSoftwareDef.define(self, __FILE__) - -license "MIT" -license_file "https://raw.githubusercontent.com/mfazekas/bcrypt_pbkdf-ruby/master/COPYING" -skip_transitive_dependency_licensing true diff --git a/omnibus/config/software/chef-gem-binding_of_caller.rb b/omnibus/config/software/chef-gem-binding_of_caller.rb deleted file mode 100644 index 3e7a9f9c70..0000000000 --- a/omnibus/config/software/chef-gem-binding_of_caller.rb +++ /dev/null @@ -1,10 +0,0 @@ -# gem installs this gem from the version specified in chef's Gemfile.lock -# so we can take advantage of omnibus's caching. Just duplicate this file and -# add the new software def to chef software def if you want to separate -# another gem's installation. -require_relative "../../files/chef-gem/build-chef-gem/gem-install-software-def" -BuildChefGem::GemInstallSoftwareDef.define(self, __FILE__) - -license "MIT" -license_file "https://github.com/banister/binding_of_caller/blob/master/LICENSE" -skip_transitive_dependency_licensing true diff --git a/omnibus/config/software/chef-gem-byebug.rb b/omnibus/config/software/chef-gem-byebug.rb deleted file mode 100644 index 3aef706e82..0000000000 --- a/omnibus/config/software/chef-gem-byebug.rb +++ /dev/null @@ -1,10 +0,0 @@ -# gem installs this gem from the version specified in chef's Gemfile.lock -# so we can take advantage of omnibus's caching. Just duplicate this file and -# add the new software def to chef software def if you want to separate -# another gem's installation. -require_relative "../../files/chef-gem/build-chef-gem/gem-install-software-def" -BuildChefGem::GemInstallSoftwareDef.define(self, __FILE__) - -license "MIT" -license_file "https://github.com/deivid-rodriguez/byebug/blob/master/LICENSE" -skip_transitive_dependency_licensing true diff --git a/omnibus/config/software/chef-gem-debug_inspector.rb b/omnibus/config/software/chef-gem-debug_inspector.rb deleted file mode 100644 index ab818768ea..0000000000 --- a/omnibus/config/software/chef-gem-debug_inspector.rb +++ /dev/null @@ -1,10 +0,0 @@ -# gem installs this gem from the version specified in chef's Gemfile.lock -# so we can take advantage of omnibus's caching. Just duplicate this file and -# add the new software def to chef software def if you want to separate -# another gem's installation. -require_relative "../../files/chef-gem/build-chef-gem/gem-install-software-def" -BuildChefGem::GemInstallSoftwareDef.define(self, __FILE__) - -license "MIT" -license_file "https://github.com/banister/debug_inspector/blob/master/README.md" -skip_transitive_dependency_licensing true diff --git a/omnibus/config/software/chef-gem-ffi-yajl.rb b/omnibus/config/software/chef-gem-ffi-yajl.rb deleted file mode 100644 index 44f98446bd..0000000000 --- a/omnibus/config/software/chef-gem-ffi-yajl.rb +++ /dev/null @@ -1,12 +0,0 @@ -# gem installs this gem from the version specified in chef's Gemfile.lock -# so we can take advantage of omnibus's caching. Just duplicate this file and -# add the new software def to chef software def if you want to separate -# another gem's installation. -require_relative "../../files/chef-gem/build-chef-gem/gem-install-software-def" -BuildChefGem::GemInstallSoftwareDef.define(self, __FILE__) - -license "MIT" -license_file "https://github.com/chef/ffi-yajl/blob/master/LICENSE" -skip_transitive_dependency_licensing true - -dependency "chef-gem-libyajl2" diff --git a/omnibus/config/software/chef-gem-ffi.rb b/omnibus/config/software/chef-gem-ffi.rb deleted file mode 100644 index ea8879c2ac..0000000000 --- a/omnibus/config/software/chef-gem-ffi.rb +++ /dev/null @@ -1,12 +0,0 @@ -# gem installs this gem from the version specified in chef's Gemfile.lock -# so we can take advantage of omnibus's caching. Just duplicate this file and -# add the new software def to chef software def if you want to separate -# another gem's installation. -require_relative "../../files/chef-gem/build-chef-gem/gem-install-software-def" -BuildChefGem::GemInstallSoftwareDef.define(self, __FILE__) - -license "BSD-3-Clause" -license_file "https://github.com/ffi/ffi/blob/master/LICENSE" -license_file "https://github.com/ffi/ffi/blob/master/COPYING" -license_file "https://github.com/ffi/ffi/blob/master/LICENSE.SPECS" -skip_transitive_dependency_licensing true diff --git a/omnibus/config/software/chef-gem-inspec.rb b/omnibus/config/software/chef-gem-inspec.rb deleted file mode 100644 index 8c5e1cbf26..0000000000 --- a/omnibus/config/software/chef-gem-inspec.rb +++ /dev/null @@ -1,10 +0,0 @@ -# gem installs this gem from the version specified in chef's Gemfile.lock -# so we can take advantage of omnibus's caching. Just duplicate this file and -# add the new software def to chef software def if you want to separate -# another gem's installation. -require_relative "../../files/chef-gem/build-chef-gem/gem-install-software-def" -BuildChefGem::GemInstallSoftwareDef.define(self, __FILE__) - -license "Apache-2.0" -license_file "https://raw.githubusercontent.com/chef/inspec/master/LICENSE" -skip_transitive_dependency_licensing true diff --git a/omnibus/config/software/chef-gem-json.rb b/omnibus/config/software/chef-gem-json.rb deleted file mode 100644 index 9217359ba2..0000000000 --- a/omnibus/config/software/chef-gem-json.rb +++ /dev/null @@ -1,11 +0,0 @@ -# gem installs this gem from the version specified in chef's Gemfile.lock -# so we can take advantage of omnibus's caching. Just duplicate this file and -# add the new software def to chef software def if you want to separate -# another gem's installation. -require_relative "../../files/chef-gem/build-chef-gem/gem-install-software-def" -BuildChefGem::GemInstallSoftwareDef.define(self, __FILE__) - -license "Ruby" -license_file "https://github.com/flori/json/blob/master/README.md" -license_file "https://www.ruby-lang.org/en/about/license.txt" -skip_transitive_dependency_licensing true diff --git a/omnibus/config/software/chef-gem-libyajl2.rb b/omnibus/config/software/chef-gem-libyajl2.rb deleted file mode 100644 index 47ef42e1cf..0000000000 --- a/omnibus/config/software/chef-gem-libyajl2.rb +++ /dev/null @@ -1,10 +0,0 @@ -# gem installs this gem from the version specified in chef's Gemfile.lock -# so we can take advantage of omnibus's caching. Just duplicate this file and -# add the new software def to chef software def if you want to separate -# another gem's installation. -require_relative "../../files/chef-gem/build-chef-gem/gem-install-software-def" -BuildChefGem::GemInstallSoftwareDef.define(self, __FILE__) - -license "Apache-2.0" -license_file "https://github.com/chef/libyajl2-gem/blob/master/LICENSE" -skip_transitive_dependency_licensing true diff --git a/omnibus/config/software/chef-gem-mini_portile2.rb b/omnibus/config/software/chef-gem-mini_portile2.rb deleted file mode 100644 index 36a2b833dd..0000000000 --- a/omnibus/config/software/chef-gem-mini_portile2.rb +++ /dev/null @@ -1,10 +0,0 @@ -# gem installs this gem from the version specified in chef's Gemfile.lock -# so we can take advantage of omnibus's caching. Just duplicate this file and -# add the new software def to chef software def if you want to separate -# another gem's installation. -require_relative "../../files/chef-gem/build-chef-gem/gem-install-software-def" -BuildChefGem::GemInstallSoftwareDef.define(self, __FILE__) - -license "MIT" -license_file "https://github.com/flavorjones/mini_portile/blob/master/LICENSE.txt" -skip_transitive_dependency_licensing true diff --git a/omnibus/config/software/chef-gem-nokogiri.rb b/omnibus/config/software/chef-gem-nokogiri.rb deleted file mode 100644 index c6b8d03822..0000000000 --- a/omnibus/config/software/chef-gem-nokogiri.rb +++ /dev/null @@ -1,13 +0,0 @@ -# gem installs this gem from the version specified in chef's Gemfile.lock -# so we can take advantage of omnibus's caching. Just duplicate this file and -# add the new software def to chef software def if you want to separate -# another gem's installation. -require_relative "../../files/chef-gem/build-chef-gem/gem-install-software-def" -BuildChefGem::GemInstallSoftwareDef.define(self, __FILE__) - -license "MIT" -license_file "https://github.com/ruby-prof/ruby-prof/blob/master/LICENSE" -skip_transitive_dependency_licensing true - -dependency "chef-gem-pkg-config" -dependency "chef-gem-mini_portile2" diff --git a/omnibus/config/software/chef-gem-ohai.rb b/omnibus/config/software/chef-gem-ohai.rb deleted file mode 100644 index 7ee7ff4909..0000000000 --- a/omnibus/config/software/chef-gem-ohai.rb +++ /dev/null @@ -1,10 +0,0 @@ -# gem installs this gem from the version specified in chef's Gemfile.lock -# so we can take advantage of omnibus's caching. Just duplicate this file and -# add the new software def to chef software def if you want to separate -# another gem's installation. -require_relative "../../files/chef-gem/build-chef-gem/gem-install-software-def" -BuildChefGem::GemInstallSoftwareDef.define(self, __FILE__) - -license "Apache-2.0" -license_file "https://github.com/chef/ohai/blob/master/LICENSE" -skip_transitive_dependency_licensing true diff --git a/omnibus/config/software/chef-gem-pkg-config.rb b/omnibus/config/software/chef-gem-pkg-config.rb deleted file mode 100644 index 051091b73f..0000000000 --- a/omnibus/config/software/chef-gem-pkg-config.rb +++ /dev/null @@ -1,10 +0,0 @@ -# gem installs this gem from the version specified in chef's Gemfile.lock -# so we can take advantage of omnibus's caching. Just duplicate this file and -# add the new software def to chef software def if you want to separate -# another gem's installation. -require_relative "../../files/chef-gem/build-chef-gem/gem-install-software-def" -BuildChefGem::GemInstallSoftwareDef.define(self, __FILE__) - -license "LGPL-2.1" -license_file "https://github.com/ruby-gnome2/pkg-config/blob/master/LGPL-2.1" -skip_transitive_dependency_licensing true diff --git a/omnibus/config/software/chef-gem-rbnacl-libsodium.rb b/omnibus/config/software/chef-gem-rbnacl-libsodium.rb deleted file mode 100644 index 90bbc69dfb..0000000000 --- a/omnibus/config/software/chef-gem-rbnacl-libsodium.rb +++ /dev/null @@ -1,10 +0,0 @@ -# gem installs this gem from the version specified in chef's Gemfile.lock -# so we can take advantage of omnibus's caching. Just duplicate this file and -# add the new software def to chef software def if you want to separate -# another gem's installation. -require_relative "../../files/chef-gem/build-chef-gem/gem-install-software-def" -BuildChefGem::GemInstallSoftwareDef.define(self, __FILE__) - -license "MIT" -license_file "https://raw.githubusercontent.com/cryptosphere/rbnacl-libsodium/master/LICENSE" -skip_transitive_dependency_licensing true diff --git a/omnibus/config/software/chef-gem-ruby-prof.rb b/omnibus/config/software/chef-gem-ruby-prof.rb deleted file mode 100644 index af90212d23..0000000000 --- a/omnibus/config/software/chef-gem-ruby-prof.rb +++ /dev/null @@ -1,10 +0,0 @@ -# gem installs this gem from the version specified in chef's Gemfile.lock -# so we can take advantage of omnibus's caching. Just duplicate this file and -# add the new software def to chef software def if you want to separate -# another gem's installation. -require_relative "../../files/chef-gem/build-chef-gem/gem-install-software-def" -BuildChefGem::GemInstallSoftwareDef.define(self, __FILE__) - -license "BSD-2-Clause" -license_file "https://github.com/ruby-prof/ruby-prof/blob/master/LICENSE" -skip_transitive_dependency_licensing true diff --git a/omnibus/config/software/chef-gem-ruby-shadow.rb b/omnibus/config/software/chef-gem-ruby-shadow.rb deleted file mode 100644 index 02fc906d9d..0000000000 --- a/omnibus/config/software/chef-gem-ruby-shadow.rb +++ /dev/null @@ -1,11 +0,0 @@ -# gem installs this gem from the version specified in chef's Gemfile.lock -# so we can take advantage of omnibus's caching. Just duplicate this file and -# add the new software def to chef software def if you want to separate -# another gem's installation. -require_relative "../../files/chef-gem/build-chef-gem/gem-install-software-def" -BuildChefGem::GemInstallSoftwareDef.define(self, __FILE__) - -license "Public-Domain" -license_file "https://github.com/apalmblad/ruby-shadow/blob/master/LICENSE" -license_file "http://creativecommons.org/licenses/publicdomain/" -skip_transitive_dependency_licensing true diff --git a/omnibus/config/software/chef.rb b/omnibus/config/software/chef.rb deleted file mode 100644 index 4726f8b687..0000000000 --- a/omnibus/config/software/chef.rb +++ /dev/null @@ -1,88 +0,0 @@ -name "chef" -default_version "local_source" - -license :project_license - -# For the specific super-special version "local_source", build the source from -# the local git checkout. This is what you'd want to occur by default if you -# just ran omnibus build locally. -version("local_source") do - source path: File.expand_path("../..", project.files_path), - # Since we are using the local repo, we try to not copy any files - # that are generated in the process of bundle installing omnibus. - # If the install steps are well-behaved, this should not matter - # since we only perform bundle and gem installs from the - # omnibus cache source directory, but we do this regardless - # to maintain consistency between what a local build sees and - # what a github based build will see. - options: { exclude: [ "omnibus/vendor" ] } -end - -# For any version other than "local_source", fetch from github. -if version != "local_source" - source git: "git://github.com/chef/chef.git" -end - -# For nokogiri -dependency "libxml2" -dependency "libxslt" -dependency "liblzma" -dependency "zlib" - -# ruby and bundler and friends -dependency "ruby" -dependency "rubygems" -dependency "bundler" - -# Install all the native gems separately -# Worst offenders first to take best advantage of cache: -dependency "chef-gem-ffi-yajl" -dependency "chef-gem-ohai" -dependency "chef-gem-nokogiri" unless windows? -dependency "chef-gem-libyajl2" -dependency "chef-gem-ruby-prof" -dependency "chef-gem-byebug" -dependency "chef-gem-debug_inspector" -dependency "chef-gem-binding_of_caller" -dependency "chef-gem-inspec" -unless ios_xr? || solaris? - dependency "chef-gem-rbnacl-libsodium" - dependency "chef-gem-bcrypt_pbkdf-ruby" -end - -# Now everyone else, in alphabetical order because we don't care THAT much -Dir.entries(File.dirname(__FILE__)).sort.each do |gem_software| - if gem_software =~ /^(chef-gem-.+)\.rb$/ - dependency $1 - end -end - -build do - # This is where we get the definitions below - require_relative "../../files/chef/build-chef" - extend BuildChef - - project_env = env.dup - project_env["BUNDLE_GEMFILE"] = project_gemfile - - # Prepare to install: build config, retries, job, frozen=true - # TODO Windows install seems to sometimes install already-installed gems such - # as gherkin (and fail as a result) if you use jobs > 1. - create_bundle_config(project_gemfile, retries: 4, jobs: windows? ? 1 : 7, frozen: true) - - # Install all the things. Arguments are specified in .bundle/config (see create_bundle_config) - block { log.info(log_key) { "" } } - bundle "install --verbose", env: project_env - - # Check that it worked - block { log.info(log_key) { "" } } - bundle "check", env: project_env - - # fix up git-sourced gems - properly_reinstall_git_and_path_sourced_gems - install_shared_gemfile - - # Check that the final gemfile worked - block { log.info(log_key) { "" } } - bundle "check", env: env, cwd: File.dirname(shared_gemfile) -end -- cgit v1.2.1