From a1c6d39792380511548b631c50b94e55c3616f69 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 2 Feb 2021 11:52:28 +0000 Subject: [PATCH 1/6] rubocop.yml: autofix formatting. --- Library/.rubocop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/.rubocop.yml b/Library/.rubocop.yml index c992c614a8..1843832d3f 100644 --- a/Library/.rubocop.yml +++ b/Library/.rubocop.yml @@ -355,7 +355,7 @@ Layout/LineLength: ' name "', ' pkg "', ' pkgutil: "', - ' sha256 cellar: ', + " sha256 cellar: ", "#{language}", "#{version.", ' "/Library/Application Support/', From 7912b1e0438190f63a10295c2df0784650bf6057 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 2 Feb 2021 11:50:44 +0000 Subject: [PATCH 2/6] homebrew_bootsnap: various improvements. - Add `HOMEBREW_NO_BOOTSNAP` as well as `HOMEBREW_BOOTSNAP` - Guard the whole file rather than `raise` on inclusion. - Use `HOMEBREW_CACHE` instead of `HOMEBREW_TEMP` - Don't try to use Bootsnap with macOS portable ruby --- Library/Homebrew/homebrew_bootsnap.rb | 50 +++++++++++++++------------ Library/Homebrew/load_path.rb | 5 ++- 2 files changed, 29 insertions(+), 26 deletions(-) diff --git a/Library/Homebrew/homebrew_bootsnap.rb b/Library/Homebrew/homebrew_bootsnap.rb index fff14b8d54..c79d11fec6 100644 --- a/Library/Homebrew/homebrew_bootsnap.rb +++ b/Library/Homebrew/homebrew_bootsnap.rb @@ -3,33 +3,37 @@ # TODO: make this `typed: true` when HOMEBREW_BOOTSNAP is enabled by # default and/or we vendor bootsnap and the RBI file. +if !ENV["HOMEBREW_NO_BOOTSNAP"] && + ENV["HOMEBREW_BOOTSNAP"] && + # portable ruby doesn't play nice with bootsnap + !ENV["HOMEBREW_FORCE_VENDOR_RUBY"] && + (!ENV["HOMEBREW_MACOS_VERSION"] || ENV["HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH"]) -raise "Needs HOMEBREW_BOOTSNAP!" unless ENV["HOMEBREW_BOOTSNAP"] + require "rubygems" -require "rubygems" + begin + require "bootsnap" + rescue LoadError + raise if ENV["HOMEBREW_BOOTSNAP_RETRY"] -begin - require "bootsnap" -rescue LoadError - raise if ENV["HOMEBREW_BOOTSNAP_RETRY"] + Dir.chdir(HOMEBREW_LIBRARY_PATH) do + system "bundle", "install", "--standalone" + end - Dir.chdir(HOMEBREW_LIBRARY_PATH) do - system "bundle", "install", "--standalone" + ENV["HOMEBREW_BOOTSNAP_RETRY"] = "1" + exec ENV["HOMEBREW_BREW_FILE"], *ARGV end - ENV["HOMEBREW_BOOTSNAP_RETRY"] = "1" - exec ENV["HOMEBREW_BREW_FILE"], *ARGV + ENV.delete("HOMEBREW_BOOTSNAP_RETRY") + + cache = ENV["HOMEBREW_CACHE"] || ENV["HOMEBREW_DEFAULT_CACHE"] + # Can't use .blank? here because we haven't required active_support yet. + raise "Needs HOMEBREW_CACHE or HOMEBREW_DEFAULT_CACHE!" if cache.nil? || cache.empty? # rubocop:disable Rails/Blank + + Bootsnap.setup( + cache_dir: cache, + load_path_cache: true, + compile_cache_iseq: true, + compile_cache_yaml: true, + ) end - -ENV.delete("HOMEBREW_BOOTSNAP_RETRY") - -tmp = ENV["HOMEBREW_TEMP"] || ENV["HOMEBREW_DEFAULT_TEMP"] -raise "Needs HOMEBREW_TEMP or HOMEBREW_DEFAULT_TEMP!" unless tmp - -Bootsnap.setup( - cache_dir: "#{tmp}/homebrew-bootsnap", - development_mode: false, # TODO: use ENV["HOMEBREW_DEVELOPER"]?, - load_path_cache: true, - compile_cache_iseq: true, - compile_cache_yaml: true, -) diff --git a/Library/Homebrew/load_path.rb b/Library/Homebrew/load_path.rb index 9745b7348f..10aa74784c 100644 --- a/Library/Homebrew/load_path.rb +++ b/Library/Homebrew/load_path.rb @@ -8,10 +8,9 @@ HOMEBREW_LIBRARY_PATH = Pathname(__dir__).realpath.freeze $LOAD_PATH.push HOMEBREW_LIBRARY_PATH.to_s require "vendor/bundle/bundler/setup" +require "homebrew_bootsnap" -if ENV["HOMEBREW_BOOTSNAP"] - require "homebrew_bootsnap" -else +unless defined?(Bootsnap) $LOAD_PATH.select! { |d| Pathname(d).directory? } $LOAD_PATH.uniq! end From 240d2c34fb72a642a6163fa163bfd0b971761574 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 2 Feb 2021 11:53:51 +0000 Subject: [PATCH 3/6] utils/fork: fix bootsnap handling. Also, while we're here: - remove unused block argument - remove unneeded RuboCop disable comment --- Library/Homebrew/utils/fork.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/utils/fork.rb b/Library/Homebrew/utils/fork.rb index e9eb1ea243..7094e7d8f4 100644 --- a/Library/Homebrew/utils/fork.rb +++ b/Library/Homebrew/utils/fork.rb @@ -29,12 +29,15 @@ module Utils error end - def self.safe_fork(&_block) + def self.safe_fork Dir.mktmpdir("homebrew", HOMEBREW_TEMP) do |tmpdir| UNIXServer.open("#{tmpdir}/socket") do |server| read, write = IO.pipe pid = fork do + # bootsnap doesn't like these forked processes + ENV["HOMEBREW_NO_BOOTSNAP"] = "1" + ENV["HOMEBREW_ERROR_PIPE"] = server.path server.close read.close @@ -56,7 +59,7 @@ module Utils write.close exit! - else # rubocop:disable Layout/ElseAlignment + else exit!(true) end From 36c292f2784ef1aa9abf7f93220587e1404915e2 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 2 Feb 2021 11:51:08 +0000 Subject: [PATCH 4/6] cleanup: cleanup bootsnap files. --- Library/Homebrew/cleanup.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Library/Homebrew/cleanup.rb b/Library/Homebrew/cleanup.rb index fc3554def1..47ef774cdc 100644 --- a/Library/Homebrew/cleanup.rb +++ b/Library/Homebrew/cleanup.rb @@ -209,6 +209,7 @@ module Homebrew return if periodic cleanup_portable_ruby + cleanup_bootsnap else args.each do |arg| formula = begin @@ -399,6 +400,17 @@ module Homebrew FileUtils.rm_rf portable_rubies_to_remove end + def cleanup_bootsnap + bootsnap = cache/"bootsnap" + return unless bootsnap.exist? + + if dry_run? + puts "Would remove: #{bootsnap} (#{bootsnap.abv})" + else + FileUtils.rm_rf bootsnap + end + end + def cleanup_cache_db(rack = nil) FileUtils.rm_rf [ cache/"desc_cache.json", From 89fc1314223054eb1d93608e744baff7ef02e250 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 2 Feb 2021 11:52:13 +0000 Subject: [PATCH 5/6] Gemfile: install bootsnap. And allow type checking of `homebrew_bootsnap.rb`. --- Library/.rubocop.yml | 1 - Library/Homebrew/Gemfile | 2 +- Library/Homebrew/Gemfile.lock | 4 + Library/Homebrew/homebrew_bootsnap.rb | 4 +- .../sorbet/rbi/gems/bootsnap@1.7.0.rbi | 8 + .../sorbet/rbi/gems/msgpack@1.4.2.rbi | 7 + .../sorbet/rbi/hidden-definitions/hidden.rbi | 530 +++++++++++++++++- .../Homebrew/vendor/bundle/bundler/setup.rb | 16 +- 8 files changed, 535 insertions(+), 37 deletions(-) create mode 100644 Library/Homebrew/sorbet/rbi/gems/bootsnap@1.7.0.rbi create mode 100644 Library/Homebrew/sorbet/rbi/gems/msgpack@1.4.2.rbi diff --git a/Library/.rubocop.yml b/Library/.rubocop.yml index 1843832d3f..e3b0537813 100644 --- a/Library/.rubocop.yml +++ b/Library/.rubocop.yml @@ -373,7 +373,6 @@ Sorbet/FalseSigil: - "/**/{Formula,Casks}/*.rb" - "**/{Formula,Casks}/*.rb" - "Homebrew/test/**/Casks/**/*.rb" - - "Homebrew/homebrew_bootsnap.rb" Sorbet/StrictSigil: Enabled: true diff --git a/Library/Homebrew/Gemfile b/Library/Homebrew/Gemfile index cfc9287a89..f13e5f3bbf 100644 --- a/Library/Homebrew/Gemfile +++ b/Library/Homebrew/Gemfile @@ -3,7 +3,7 @@ source "https://rubygems.org" # installed gems (should all be require: false) -gem "bootsnap", require: false if ENV["HOMEBREW_BOOTSNAP"] +gem "bootsnap", require: false gem "byebug", require: false gem "codecov", require: false gem "nokogiri", require: false diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index 9bf60eeaa1..dc074ef055 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -9,6 +9,8 @@ GEM zeitwerk (~> 2.3) ast (2.4.2) bindata (2.4.8) + bootsnap (1.7.0) + msgpack (~> 1.0) byebug (11.1.3) codecov (0.4.2) simplecov (>= 0.15, < 0.22) @@ -46,6 +48,7 @@ GEM mime-types-data (3.2020.1104) mini_portile2 (2.5.0) minitest (5.14.3) + msgpack (1.4.2) mustache (1.1.1) net-http-digest_auth (1.4.1) net-http-persistent (4.0.1) @@ -169,6 +172,7 @@ PLATFORMS DEPENDENCIES activesupport + bootsnap byebug codecov concurrent-ruby diff --git a/Library/Homebrew/homebrew_bootsnap.rb b/Library/Homebrew/homebrew_bootsnap.rb index c79d11fec6..b12d0c5308 100644 --- a/Library/Homebrew/homebrew_bootsnap.rb +++ b/Library/Homebrew/homebrew_bootsnap.rb @@ -1,8 +1,6 @@ -# typed: ignore +# typed: false # frozen_string_literal: true -# TODO: make this `typed: true` when HOMEBREW_BOOTSNAP is enabled by -# default and/or we vendor bootsnap and the RBI file. if !ENV["HOMEBREW_NO_BOOTSNAP"] && ENV["HOMEBREW_BOOTSNAP"] && # portable ruby doesn't play nice with bootsnap diff --git a/Library/Homebrew/sorbet/rbi/gems/bootsnap@1.7.0.rbi b/Library/Homebrew/sorbet/rbi/gems/bootsnap@1.7.0.rbi new file mode 100644 index 0000000000..4cf183bb25 --- /dev/null +++ b/Library/Homebrew/sorbet/rbi/gems/bootsnap@1.7.0.rbi @@ -0,0 +1,8 @@ +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `bootsnap` gem. +# Please instead update this file by running `tapioca sync`. + +# typed: true + +# THIS IS AN EMPTY RBI FILE. +# see https://github.com/Shopify/tapioca/blob/master/README.md#manual-gem-requires diff --git a/Library/Homebrew/sorbet/rbi/gems/msgpack@1.4.2.rbi b/Library/Homebrew/sorbet/rbi/gems/msgpack@1.4.2.rbi new file mode 100644 index 0000000000..fc385bdfb8 --- /dev/null +++ b/Library/Homebrew/sorbet/rbi/gems/msgpack@1.4.2.rbi @@ -0,0 +1,7 @@ +# DO NOT EDIT MANUALLY +# This is an autogenerated file for types exported from the `msgpack` gem. +# Please instead update this file by running `tapioca sync`. + +# typed: true + +Bignum = Integer diff --git a/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi b/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi index a3a41bd0f0..9a48262e5f 100644 --- a/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi +++ b/Library/Homebrew/sorbet/rbi/hidden-definitions/hidden.rbi @@ -532,6 +532,14 @@ class ActiveSupport::CurrentAttributes def _reset_callbacks(); end def _run_reset_callbacks(&block); end + + def attributes(); end + + def attributes=(attributes); end + + def reset(); end + + def set(set_attributes); end end class ActiveSupport::CurrentAttributes @@ -553,9 +561,17 @@ class ActiveSupport::CurrentAttributes def self.before_reset(&block); end + def self.clear_all(); end + def self.instance(); end + def self.reset(*args, &block); end + + def self.reset_all(); end + def self.resets(&block); end + + def self.set(*args, &block); end end module ActiveSupport::Dependencies @@ -2690,6 +2706,7 @@ class Addrinfo end class Array + include ::MessagePack::CoreExt def compact_blank!(); end def extract_options!(); end @@ -2794,6 +2811,376 @@ class Bintray extend ::T::Private::Methods::SingletonMethodHooks end +module Bootsnap + def bundler?(); end + VERSION = ::T.let(nil, ::T.untyped) +end + +module Bootsnap::CompileCache +end + +class Bootsnap::CompileCache::Error +end + +class Bootsnap::CompileCache::Error +end + +module Bootsnap::CompileCache::ISeq +end + +module Bootsnap::CompileCache::ISeq::InstructionSequenceMixin + def compile_option=(hash); end + + def load_iseq(path); end +end + +module Bootsnap::CompileCache::ISeq::InstructionSequenceMixin +end + +module Bootsnap::CompileCache::ISeq + def self.cache_dir(); end + + def self.cache_dir=(cache_dir); end + + def self.compile_option_updated(); end + + def self.fetch(path, cache_dir: T.unsafe(nil)); end + + def self.input_to_output(_data, _kwargs); end + + def self.input_to_storage(_, path); end + + def self.install!(cache_dir); end + + def self.precompile(path, cache_dir: T.unsafe(nil)); end + + def self.storage_to_output(binary, _args); end +end + +module Bootsnap::CompileCache::Native +end + +module Bootsnap::CompileCache::Native + def self.compile_option_crc32=(compile_option_crc32); end + + def self.coverage_running?(); end + + def self.fetch(_, _1, _2, _3); end + + def self.precompile(_, _1, _2); end +end + +class Bootsnap::CompileCache::PermissionError +end + +class Bootsnap::CompileCache::PermissionError +end + +class Bootsnap::CompileCache::Uncompilable +end + +class Bootsnap::CompileCache::Uncompilable +end + +module Bootsnap::CompileCache::YAML +end + +module Bootsnap::CompileCache::YAML::Patch + def load_file(path, *args); end +end + +module Bootsnap::CompileCache::YAML::Patch +end + +module Bootsnap::CompileCache::YAML + def self.cache_dir(); end + + def self.cache_dir=(cache_dir); end + + def self.init!(); end + + def self.input_to_output(data, kwargs); end + + def self.input_to_storage(contents, _); end + + def self.install!(cache_dir); end + + def self.msgpack_factory(); end + + def self.msgpack_factory=(msgpack_factory); end + + def self.precompile(path, cache_dir: T.unsafe(nil)); end + + def self.storage_to_output(data, kwargs); end + + def self.supported_options(); end + + def self.supported_options=(supported_options); end +end + +module Bootsnap::CompileCache + def self.permission_error(path); end + + def self.setup(cache_dir:, iseq:, yaml:); end + + def self.supported?(); end +end + +module Bootsnap::ExplicitRequire + ARCHDIR = ::T.let(nil, ::T.untyped) + DLEXT = ::T.let(nil, ::T.untyped) + RUBYLIBDIR = ::T.let(nil, ::T.untyped) +end + +module Bootsnap::ExplicitRequire + def self.from_archdir(feature); end + + def self.from_rubylibdir(feature); end + + def self.from_self(feature); end + + def self.with_gems(*gems); end +end + +class Bootsnap::InvalidConfiguration +end + +class Bootsnap::InvalidConfiguration +end + +module Bootsnap::LoadPathCache + CACHED_EXTENSIONS = ::T.let(nil, ::T.untyped) + DLEXT = ::T.let(nil, ::T.untyped) + DLEXT2 = ::T.let(nil, ::T.untyped) + DL_EXTENSIONS = ::T.let(nil, ::T.untyped) + DOT_RB = ::T.let(nil, ::T.untyped) + DOT_SO = ::T.let(nil, ::T.untyped) + ERROR_TAG_IVAR = ::T.let(nil, ::T.untyped) + SLASH = ::T.let(nil, ::T.untyped) +end + +class Bootsnap::LoadPathCache::Cache + def absolute_path?(path); end + + def find(feature); end + + def initialize(store, path_obj, development_mode: T.unsafe(nil)); end + + def load_dir(dir); end + + def push_paths(sender, *paths); end + + def reinitialize(path_obj=T.unsafe(nil)); end + + def unshift_paths(sender, *paths); end + AGE_THRESHOLD = ::T.let(nil, ::T.untyped) + BUILTIN_FEATURES = ::T.let(nil, ::T.untyped) +end + +class Bootsnap::LoadPathCache::Cache +end + +module Bootsnap::LoadPathCache::ChangeObserver +end + +module Bootsnap::LoadPathCache::ChangeObserver::ArrayMixin + def <<(entry); end + + def []=(*args, &block); end + + def clear(*args, &block); end + + def collect!(*args, &block); end + + def compact!(*args, &block); end + + def concat(entries); end + + def delete(*args, &block); end + + def delete_at(*args, &block); end + + def delete_if(*args, &block); end + + def fill(*args, &block); end + + def flatten!(*args, &block); end + + def insert(*args, &block); end + + def keep_if(*args, &block); end + + def map!(*args, &block); end + + def pop(*args, &block); end + + def push(*entries); end + + def reject!(*args, &block); end + + def replace(*args, &block); end + + def reverse!(*args, &block); end + + def rotate!(*args, &block); end + + def select!(*args, &block); end + + def shift(*args, &block); end + + def shuffle!(*args, &block); end + + def slice!(*args, &block); end + + def sort!(*args, &block); end + + def sort_by!(*args, &block); end + + def uniq!(*args); end + + def unshift(*entries); end +end + +module Bootsnap::LoadPathCache::ChangeObserver::ArrayMixin +end + +module Bootsnap::LoadPathCache::ChangeObserver + def self.register(observer, arr); end +end + +module Bootsnap::LoadPathCache::CoreExt +end + +module Bootsnap::LoadPathCache::CoreExt + def self.make_load_error(path); end +end + +class Bootsnap::LoadPathCache::FallbackScan +end + +class Bootsnap::LoadPathCache::FallbackScan +end + +class Bootsnap::LoadPathCache::LoadedFeaturesIndex + def key?(feature); end + + def purge(feature); end + + def purge_multi(features); end + + def register(short, long=T.unsafe(nil)); end +end + +class Bootsnap::LoadPathCache::LoadedFeaturesIndex +end + +class Bootsnap::LoadPathCache::Path + def entries_and_dirs(store); end + + def expanded_path(); end + + def initialize(path); end + + def non_directory?(); end + + def path(); end + + def relative?(); end + + def stable?(); end + + def volatile?(); end + RUBY_LIBDIR = ::T.let(nil, ::T.untyped) + RUBY_SITEDIR = ::T.let(nil, ::T.untyped) + STABLE = ::T.let(nil, ::T.untyped) + VOLATILE = ::T.let(nil, ::T.untyped) +end + +class Bootsnap::LoadPathCache::Path +end + +module Bootsnap::LoadPathCache::PathScanner + ALTERNATIVE_NATIVE_EXTENSIONS_PATTERN = ::T.let(nil, ::T.untyped) + BUNDLE_PATH = ::T.let(nil, ::T.untyped) + NORMALIZE_NATIVE_EXTENSIONS = ::T.let(nil, ::T.untyped) + REQUIRABLE_EXTENSIONS = ::T.let(nil, ::T.untyped) +end + +module Bootsnap::LoadPathCache::PathScanner + def self.call(path); end + + def self.walk(absolute_dir_path, relative_dir_path, &block); end +end + +class Bootsnap::LoadPathCache::RealpathCache + def call(*key); end +end + +class Bootsnap::LoadPathCache::RealpathCache +end + +class Bootsnap::LoadPathCache::ReturnFalse +end + +class Bootsnap::LoadPathCache::ReturnFalse +end + +class Bootsnap::LoadPathCache::Store + def fetch(key); end + + def get(key); end + + def initialize(store_path); end + + def set(key, value); end + + def transaction(); end +end + +class Bootsnap::LoadPathCache::Store::NestedTransactionError +end + +class Bootsnap::LoadPathCache::Store::NestedTransactionError +end + +class Bootsnap::LoadPathCache::Store::SetOutsideTransactionNotAllowed +end + +class Bootsnap::LoadPathCache::Store::SetOutsideTransactionNotAllowed +end + +class Bootsnap::LoadPathCache::Store +end + +module Bootsnap::LoadPathCache + def self.load_path_cache(); end + + def self.loaded_features_index(); end + + def self.realpath_cache(); end + + def self.setup(cache_path:, development_mode:); end + + def self.supported?(); end +end + +module Bootsnap + extend ::Bootsnap + def self._instrument(event, path); end + + def self.default_setup(); end + + def self.instrumentation=(callback); end + + def self.log!(); end + + def self.logger(); end + + def self.logger=(logger); end + + def self.setup(cache_dir:, development_mode: T.unsafe(nil), load_path_cache: T.unsafe(nil), autoload_paths_cache: T.unsafe(nil), disable_trace: T.unsafe(nil), compile_cache_iseq: T.unsafe(nil), compile_cache_yaml: T.unsafe(nil)); end +end + class BottleSpecification extend ::T::Private::Methods::MethodHooks extend ::T::Private::Methods::SingletonMethodHooks @@ -5288,6 +5675,15 @@ module Cask::Caskroom extend ::T::Private::Methods::SingletonMethodHooks end +class Cask::Cmd::AbstractCommand + include ::Homebrew::Search::Extension +end + +class Cask::Cmd::AbstractCommand + extend ::T::Private::Methods::MethodHooks + extend ::T::Private::Methods::SingletonMethodHooks +end + class Cask::Config def appdir(); end @@ -6730,8 +7126,6 @@ end class Errno::EBADRPC end -Errno::ECAPMODE = Errno::NOERROR - Errno::EDEADLOCK = Errno::NOERROR class Errno::EDEVERR @@ -6752,13 +7146,6 @@ end Errno::EIPSEC = Errno::NOERROR -class Errno::ELAST - Errno = ::T.let(nil, ::T.untyped) -end - -class Errno::ELAST -end - class Errno::ENEEDAUTH Errno = ::T.let(nil, ::T.untyped) end @@ -6780,8 +7167,6 @@ end class Errno::ENOPOLICY end -Errno::ENOTCAPABLE = Errno::NOERROR - class Errno::ENOTSUP Errno = ::T.let(nil, ::T.untyped) end @@ -6824,7 +7209,12 @@ end class Errno::EPWROFF end -Errno::EQFULL = Errno::ELAST +class Errno::EQFULL + Errno = ::T.let(nil, ::T.untyped) +end + +class Errno::EQFULL +end class Errno::ERPCMISMATCH Errno = ::T.let(nil, ::T.untyped) @@ -6956,6 +7346,10 @@ class ExternalPatch extend ::T::Private::Methods::SingletonMethodHooks end +class FalseClass + include ::MessagePack::CoreExt +end + class Fiber def transfer(*_); end end @@ -7017,6 +7411,10 @@ module FileUtils extend ::FileUtils::StreamUtils_ end +class Float + include ::MessagePack::CoreExt +end + module FormulaCellarChecks extend ::T::Private::Methods::MethodHooks extend ::T::Private::Methods::SingletonMethodHooks @@ -7701,6 +8099,7 @@ module Hardware end class Hash + include ::MessagePack::CoreExt def assert_valid_keys(*valid_keys); end def compact_blank!(); end @@ -7789,6 +8188,8 @@ module Homebrew::EnvConfig def self.bintray_user(); end + def self.bootsnap?(); end + def self.bottle_domain(); end def self.brew_git_remote(); end @@ -7857,6 +8258,8 @@ module Homebrew::EnvConfig def self.no_auto_update?(); end + def self.no_bootsnap?(); end + def self.no_bottle_source_fallback?(); end def self.no_color?(); end @@ -7947,6 +8350,14 @@ module Homebrew::Livecheck extend ::T::Private::Methods::SingletonMethodHooks end +module Homebrew::MissingFormula + extend ::T::Private::Methods::SingletonMethodHooks +end + +module Homebrew::Search + include ::Homebrew::Search::Extension +end + module Homebrew::Settings extend ::T::Private::Methods::MethodHooks extend ::T::Private::Methods::SingletonMethodHooks @@ -9234,6 +9645,7 @@ module IRB end class Integer + include ::MessagePack::CoreExt def to_bn(); end end @@ -9302,11 +9714,13 @@ module Kernel extend ::T::Private::Methods::SingletonMethodHooks def self.at_exit(); end + def self.autoload(_, _1); end + def self.fork(); end def self.gem(dep, *reqs); end - def self.load(*_); end + def self.load(path, wrap=T.unsafe(nil)); end def self.require(path); end end @@ -10672,6 +11086,52 @@ end Markdown = RDiscount +module MessagePack + DEFAULT_EMPTY_PARAMS = ::T.let(nil, ::T.untyped) +end + +class MessagePack::Packer + def write_bin(_); end + + def write_bin_header(_); end +end + +module MessagePack::Time + Packer = ::T.let(nil, ::T.untyped) + TIME_AT_3_AVAILABLE = ::T.let(nil, ::T.untyped) + Unpacker = ::T.let(nil, ::T.untyped) +end + +module MessagePack::Time +end + +class MessagePack::Timestamp + def ==(other); end + + def initialize(sec, nsec); end + + def nsec(); end + + def sec(); end + + def to_msgpack_ext(); end + TIMESTAMP32_MAX_SEC = ::T.let(nil, ::T.untyped) + TIMESTAMP64_MAX_SEC = ::T.let(nil, ::T.untyped) + TYPE = ::T.let(nil, ::T.untyped) +end + +class MessagePack::Timestamp + def self.from_msgpack_ext(data); end + + def self.to_msgpack_ext(sec, nsec); end +end + +class MessagePack::Unpacker + def feed_reference(_); end + + def freeze?(); end +end + class Messages extend ::T::Private::Methods::MethodHooks extend ::T::Private::Methods::SingletonMethodHooks @@ -11570,6 +12030,8 @@ class Module def anonymous?(); end + def autoload_without_bootsnap(_, _1); end + def context(*a, &b); end def deprecate(*method_names); end @@ -12029,6 +12491,7 @@ class Net::WriteTimeout end class NilClass + include ::MessagePack::CoreExt def to_d(); end def try(_method_name=T.unsafe(nil), *_); end @@ -12161,6 +12624,7 @@ class Object def to_query(key); end def to_yaml(options=T.unsafe(nil)); end + APPLE_GEM_HOME = ::T.let(nil, ::T.untyped) ARGF = ::T.let(nil, ::T.untyped) ARGV = ::T.let(nil, ::T.untyped) BUG_REPORTS_URL = ::T.let(nil, ::T.untyped) @@ -12225,6 +12689,8 @@ class Object RUBY_DESCRIPTION = ::T.let(nil, ::T.untyped) RUBY_ENGINE = ::T.let(nil, ::T.untyped) RUBY_ENGINE_VERSION = ::T.let(nil, ::T.untyped) + RUBY_FRAMEWORK = ::T.let(nil, ::T.untyped) + RUBY_FRAMEWORK_VERSION = ::T.let(nil, ::T.untyped) RUBY_PATCHLEVEL = ::T.let(nil, ::T.untyped) RUBY_PATH = ::T.let(nil, ::T.untyped) RUBY_PLATFORM = ::T.let(nil, ::T.untyped) @@ -12277,11 +12743,7 @@ class OpenSSL::KDF::KDFError end module OpenSSL::KDF - def self.hkdf(*_); end - def self.pbkdf2_hmac(*_); end - - def self.scrypt(*_); end end class OpenSSL::OCSP::Request @@ -12290,29 +12752,20 @@ end OpenSSL::PKCS7::Signer = OpenSSL::PKCS7::SignerInfo -class OpenSSL::PKey::EC - EXPLICIT_CURVE = ::T.let(nil, ::T.untyped) -end - class OpenSSL::PKey::EC::Point def to_octet_string(_); end end module OpenSSL::SSL - OP_ALLOW_NO_DHE_KEX = ::T.let(nil, ::T.untyped) OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION = ::T.let(nil, ::T.untyped) OP_CRYPTOPRO_TLSEXT_BUG = ::T.let(nil, ::T.untyped) OP_LEGACY_SERVER_CONNECT = ::T.let(nil, ::T.untyped) - OP_NO_ENCRYPT_THEN_MAC = ::T.let(nil, ::T.untyped) - OP_NO_RENEGOTIATION = ::T.let(nil, ::T.untyped) - OP_NO_TLSv1_3 = ::T.let(nil, ::T.untyped) OP_SAFARI_ECDHE_ECDSA_BUG = ::T.let(nil, ::T.untyped) OP_TLSEXT_PADDING = ::T.let(nil, ::T.untyped) SSL2_VERSION = ::T.let(nil, ::T.untyped) SSL3_VERSION = ::T.let(nil, ::T.untyped) TLS1_1_VERSION = ::T.let(nil, ::T.untyped) TLS1_2_VERSION = ::T.let(nil, ::T.untyped) - TLS1_3_VERSION = ::T.let(nil, ::T.untyped) TLS1_VERSION = ::T.let(nil, ::T.untyped) end @@ -16821,6 +17274,7 @@ module Psych end module Psych + extend ::Bootsnap::CompileCache::YAML::Patch def self.add_builtin_type(type_tag, &block); end def self.add_domain_type(domain, type_tag, &block); end @@ -18824,6 +19278,8 @@ module RSpec::Core::HashImitatable def to_hash(*args, &block); end + def to_msgpack(*args, &block); end + def to_plist(*args, &block); end def to_proc(*args, &block); end @@ -26352,6 +26808,8 @@ module RuboCop::AST::CollectionNode def pluck(*args, &block); end + def to_msgpack(*args, &block); end + def without(*args, &block); end end @@ -27586,6 +28044,10 @@ class RubyVM::AbstractSyntaxTree::Node def pretty_print_children(q, names=T.unsafe(nil)); end end +class RubyVM::InstructionSequence + extend ::Bootsnap::CompileCache::ISeq::InstructionSequenceMixin +end + module RubyVM::MJIT end @@ -28475,6 +28937,7 @@ class Socket IPV6_PATHMTU = ::T.let(nil, ::T.untyped) IPV6_RECVPATHMTU = ::T.let(nil, ::T.untyped) IPV6_USE_MIN_MTU = ::T.let(nil, ::T.untyped) + IP_DONTFRAG = ::T.let(nil, ::T.untyped) IP_PORTRANGE = ::T.let(nil, ::T.untyped) IP_RECVDSTADDR = ::T.let(nil, ::T.untyped) IP_RECVIF = ::T.let(nil, ::T.untyped) @@ -28566,6 +29029,7 @@ module Socket::Constants IPV6_PATHMTU = ::T.let(nil, ::T.untyped) IPV6_RECVPATHMTU = ::T.let(nil, ::T.untyped) IPV6_USE_MIN_MTU = ::T.let(nil, ::T.untyped) + IP_DONTFRAG = ::T.let(nil, ::T.untyped) IP_PORTRANGE = ::T.let(nil, ::T.untyped) IP_RECVDSTADDR = ::T.let(nil, ::T.untyped) IP_RECVIF = ::T.let(nil, ::T.untyped) @@ -28793,6 +29257,7 @@ class Spoom::Timeline end class String + include ::MessagePack::CoreExt def black(); end def blink(); end @@ -28963,6 +29428,15 @@ module Superenv extend ::T::Private::Methods::SingletonMethodHooks end +class Symbol + include ::MessagePack::CoreExt + def to_msgpack_ext(); end +end + +class Symbol + def self.from_msgpack_ext(data); end +end + class SystemCommand::Result extend ::T::Private::Methods::MethodHooks extend ::T::Private::Methods::SingletonMethodHooks @@ -29248,6 +29722,10 @@ class TracePoint def parameters(); end end +class TrueClass + include ::MessagePack::CoreExt +end + module Tty extend ::T::Private::Methods::SingletonMethodHooks def self.blue(); end diff --git a/Library/Homebrew/vendor/bundle/bundler/setup.rb b/Library/Homebrew/vendor/bundle/bundler/setup.rb index 5faff2bf34..08b3ae8b74 100644 --- a/Library/Homebrew/vendor/bundle/bundler/setup.rb +++ b/Library/Homebrew/vendor/bundle/bundler/setup.rb @@ -11,8 +11,12 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/zeitwerk-2.4.2/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/activesupport-6.1.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ast-2.4.2/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/bindata-2.4.8/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/universal-darwin-20/2.6.0/msgpack-1.4.2" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/msgpack-1.4.2/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/universal-darwin-20/2.6.0/bootsnap-1.7.0" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/bootsnap-1.7.0/lib" $:.unshift "#{path}/" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/x86_64-darwin-14/2.6.0-static/byebug-11.1.3" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/universal-darwin-20/2.6.0/byebug-11.1.3" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/byebug-11.1.3/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/docile-1.3.5/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/simplecov-html-0.12.3/lib" @@ -25,12 +29,12 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/highline-2.0.3/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/commander-4.5.2/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/connection_pool-2.2.3/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/diff-lcs-1.4.4/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/x86_64-darwin-14/2.6.0-static/unf_ext-0.0.7.7" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/universal-darwin-20/2.6.0/unf_ext-0.0.7.7" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unf_ext-0.0.7.7/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/unf-0.1.4/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/domain_name-0.5.20190701/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/elftools-1.1.3/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/x86_64-darwin-14/2.6.0-static/hpricot-0.8.6" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/universal-darwin-20/2.6.0/hpricot-0.8.6" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/hpricot-0.8.6/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/http-cookie-1.0.3/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/mime-types-data-3.2020.1104/lib" @@ -38,7 +42,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/mime-types-3.3.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/net-http-digest_auth-1.4.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/net-http-persistent-4.0.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/mini_portile2-2.5.0/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/x86_64-darwin-14/2.6.0-static/racc-1.5.2" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/universal-darwin-20/2.6.0/racc-1.5.2" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/racc-1.5.2/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/nokogiri-1.11.1-x86_64-darwin/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ntlm-http-0.1.1/lib" @@ -57,7 +61,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/patchelf-1.3.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/plist-3.6.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/pry-0.13.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rack-2.2.3/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/x86_64-darwin-14/2.6.0-static/rdiscount-2.2.0.2" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/extensions/universal-darwin-20/2.6.0/rdiscount-2.2.0.2" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rdiscount-2.2.0.2/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/regexp_parser-2.0.3/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rexml-3.2.4/lib" @@ -70,7 +74,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-3.10.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-github-2.3.1/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-its-1.3.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-retry-0.6.2/lib" -$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/sorbet-static-0.5.6259-universal-darwin-14/lib" +$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/sorbet-static-0.5.6259-universal-darwin-20/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/sorbet-0.5.6259/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-sorbet-1.8.0/lib" $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rspec-wait-0.0.9/lib" From 3b0e8b7cf0bd1bf6dbf597fef6326529e1fd17ad Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 2 Feb 2021 11:52:56 +0000 Subject: [PATCH 6/6] Document HOMEBREW_{,NO_}BOOTSNAP variables. --- Library/Homebrew/env_config.rb | 8 ++++++++ docs/Manpage.md | 6 ++++++ manpages/brew.1 | 12 ++++++++++++ 3 files changed, 26 insertions(+) diff --git a/Library/Homebrew/env_config.rb b/Library/Homebrew/env_config.rb index e16fc15296..18a670cefa 100644 --- a/Library/Homebrew/env_config.rb +++ b/Library/Homebrew/env_config.rb @@ -39,6 +39,10 @@ module Homebrew HOMEBREW_BINTRAY_USER: { description: "Use this username when accessing the Bintray API (where bottles are stored).", }, + HOMEBREW_BOOTSNAP: { + description: "If set, use Bootsnap to speed up repeated `brew` calls.", + boolean: true, + }, HOMEBREW_BOTTLE_DOMAIN: { description: "Use this URL as the download mirror for bottles. " \ "For example, `HOMEBREW_BOTTLE_DOMAIN=http://localhost:8080` will cause all bottles to " \ @@ -203,6 +207,10 @@ module Homebrew "`brew install`, `brew upgrade` or `brew tap`.", boolean: true, }, + HOMEBREW_NO_BOOTSNAP: { + description: "If set, do not use Bootsnap to speed up repeated `brew` calls.", + boolean: true, + }, HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: { description: "If set, fail on the failure of installation from a bottle rather than " \ "falling back to building from source.", diff --git a/docs/Manpage.md b/docs/Manpage.md index c6b471d806..1260340f88 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -1707,6 +1707,9 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just - `HOMEBREW_BINTRAY_USER`
Use this username when accessing the Bintray API (where bottles are stored). +- `HOMEBREW_BOOTSNAP` +
If set, use Bootsnap to speed up repeated `brew` calls. + - `HOMEBREW_BOTTLE_DOMAIN`
Use this URL as the download mirror for bottles. For example, `HOMEBREW_BOTTLE_DOMAIN=http://localhost:8080` will cause all bottles to download from the prefix `http://localhost:8080/`. @@ -1839,6 +1842,9 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just - `HOMEBREW_NO_AUTO_UPDATE`
If set, do not automatically update before running `brew install`, `brew upgrade` or `brew tap`. +- `HOMEBREW_NO_BOOTSNAP` +
If set, do not use Bootsnap to speed up repeated `brew` calls. + - `HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK`
If set, fail on the failure of installation from a bottle rather than falling back to building from source. diff --git a/manpages/brew.1 b/manpages/brew.1 index b226fc8c21..ed8565d917 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -2376,6 +2376,12 @@ Use this API key when accessing the Bintray API (where bottles are stored)\. Use this username when accessing the Bintray API (where bottles are stored)\. . .TP +\fBHOMEBREW_BOOTSNAP\fR +. +.br +If set, use Bootsnap to speed up repeated \fBbrew\fR calls\. +. +.TP \fBHOMEBREW_BOTTLE_DOMAIN\fR . .br @@ -2622,6 +2628,12 @@ If set, do not send analytics\. For more information, see: \fIhttps://docs\.brew If set, do not automatically update before running \fBbrew install\fR, \fBbrew upgrade\fR or \fBbrew tap\fR\. . .TP +\fBHOMEBREW_NO_BOOTSNAP\fR +. +.br +If set, do not use Bootsnap to speed up repeated \fBbrew\fR calls\. +. +.TP \fBHOMEBREW_NO_BOTTLE_SOURCE_FALLBACK\fR . .br