From 740cae525b83632775c4cf66325da83da59d3cd1 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Thu, 7 Dec 2023 22:58:54 +0000 Subject: [PATCH] Deprecate, disable & delete code for Homebrew 4.2.0 --- Library/Homebrew/cask/cask.rb | 5 +- Library/Homebrew/cask/download.rb | 2 +- Library/Homebrew/cask/dsl.rb | 2 +- Library/Homebrew/cask/dsl/postflight.rb | 2 +- Library/Homebrew/caveats.rb | 16 ++--- .../cmd/postgresql-upgrade-database.rb | 4 +- Library/Homebrew/dev-cmd/audit.rb | 31 +++------ Library/Homebrew/dev-cmd/bump-cask-pr.rb | 3 +- Library/Homebrew/dev-cmd/livecheck.rb | 2 +- Library/Homebrew/dev-cmd/pr-automerge.rb | 6 +- Library/Homebrew/dev-cmd/pr-publish.rb | 5 -- Library/Homebrew/dev-cmd/pr-pull.rb | 6 +- Library/Homebrew/download_strategy.rb | 2 +- Library/Homebrew/extend/kernel.rb | 18 ----- Library/Homebrew/extend/os/mac/tap.rb | 2 +- Library/Homebrew/formula.rb | 68 ++----------------- Library/Homebrew/github_packages.rb | 4 +- Library/Homebrew/language/python.rb | 10 ++- Library/Homebrew/linkage_checker.rb | 49 +------------ Library/Homebrew/livecheck/livecheck.rb | 2 +- Library/Homebrew/macos_version.rb | 6 +- Library/Homebrew/os/linux.rb | 22 +++--- Library/Homebrew/os/mac.rb | 14 ++-- Library/Homebrew/os/mac/xcode.rb | 8 +-- Library/Homebrew/rubocops/text.rb | 7 +- Library/Homebrew/software_spec.rb | 8 ++- Library/Homebrew/tap.rb | 7 +- Library/Homebrew/version.rb | 2 +- completions/bash/brew | 3 - completions/fish/brew.fish | 3 - completions/zsh/_brew | 3 - docs/Manpage.md | 6 -- manpages/brew.1 | 12 ---- 33 files changed, 93 insertions(+), 247 deletions(-) diff --git a/Library/Homebrew/cask/cask.rb b/Library/Homebrew/cask/cask.rb index fadce179e3861c..857b21918b0cf2 100644 --- a/Library/Homebrew/cask/cask.rb +++ b/Library/Homebrew/cask/cask.rb @@ -23,10 +23,11 @@ class Cask attr_predicate :loaded_from_api? + # @api private def self.all - # TODO: ideally avoid using ARGV by moving to e.g. CLI::Parser + # TODO: replace this ARGV and ENV logic with an argument, like how we do with formulae if ARGV.exclude?("--eval-all") && !Homebrew::EnvConfig.eval_all? - odisabled "Cask::Cask#all without --eval-all or HOMEBREW_EVAL_ALL" + raise ArgumentError, "Cask::Cask#all cannot be used without --eval-all or HOMEBREW_EVAL_ALL" end Tap.flat_map(&:cask_files).map do |f| diff --git a/Library/Homebrew/cask/download.rb b/Library/Homebrew/cask/download.rb index 0182440b4ed7b8..76c412103814e6 100644 --- a/Library/Homebrew/cask/download.rb +++ b/Library/Homebrew/cask/download.rb @@ -49,7 +49,7 @@ def version .returns(Pathname) } def fetch(quiet: nil, verify_download_integrity: true, timeout: nil) - downloader.shutup! if quiet + downloader.quiet! if quiet begin super(verify_download_integrity: false, timeout: timeout) diff --git a/Library/Homebrew/cask/dsl.rb b/Library/Homebrew/cask/dsl.rb index 2aeb6b8ae35f92..e8a1bf39b036cd 100644 --- a/Library/Homebrew/cask/dsl.rb +++ b/Library/Homebrew/cask/dsl.rb @@ -211,7 +211,7 @@ def url(*args, **options, &block) # @api public def appcast(*args, **kwargs) set_unique_stanza(:appcast, args.empty? && kwargs.empty?) do - odeprecated "the `appcast` stanza", "the `livecheck` stanza" + odisabled "the `appcast` stanza", "the `livecheck` stanza" true end end diff --git a/Library/Homebrew/cask/dsl/postflight.rb b/Library/Homebrew/cask/dsl/postflight.rb index c7fa797d9e3545..5231502325ba2b 100644 --- a/Library/Homebrew/cask/dsl/postflight.rb +++ b/Library/Homebrew/cask/dsl/postflight.rb @@ -12,7 +12,7 @@ class Postflight < Base include Staged def suppress_move_to_applications(_options = {}) - odeprecated "Cask::DSL#suppress_move_to_applications" + odisabled "Cask::DSL#suppress_move_to_applications" end end end diff --git a/Library/Homebrew/caveats.rb b/Library/Homebrew/caveats.rb index db7d9b870ab2e3..dcf8e7a18add49 100644 --- a/Library/Homebrew/caveats.rb +++ b/Library/Homebrew/caveats.rb @@ -159,26 +159,18 @@ def service_caveats s = [] - command = if formula.service.command? - formula.service.manual_command - else - formula.plist_manual - end - return <<~EOS if !Utils::Service.launchctl? && formula.plist #{Formatter.warning("Warning:")} #{formula.name} provides a launchd plist which can only be used on macOS! - You can manually execute the service instead with: - #{command} EOS # Brew services only works with these two tools return <<~EOS if !Utils::Service.systemctl? && !Utils::Service.launchctl? && formula.service.command? #{Formatter.warning("Warning:")} #{formula.name} provides a service which can only be used on macOS or systemd! You can manually execute the service instead with: - #{command} + #{formula.service.manual_command} EOS - startup = formula.service.requires_root? || formula.plist_startup + startup = formula.service.requires_root? if Utils::Service.running?(formula) s << "To restart #{formula.full_name} after an upgrade:" s << " #{startup ? "sudo " : ""}brew services restart #{formula.full_name}" @@ -190,9 +182,9 @@ def service_caveats s << " brew services start #{formula.full_name}" end - if formula.plist_manual || formula.service.command? + if formula.service.command? s << "Or, if you don't want/need a background service you can just run:" - s << " #{command}" + s << " #{formula.service.manual_command}" end # pbpaste is the system clipboard tool on macOS and fails with `tmux` by default diff --git a/Library/Homebrew/cmd/postgresql-upgrade-database.rb b/Library/Homebrew/cmd/postgresql-upgrade-database.rb index 0a6fe5ae68c8b4..7f51de7935444b 100755 --- a/Library/Homebrew/cmd/postgresql-upgrade-database.rb +++ b/Library/Homebrew/cmd/postgresql-upgrade-database.rb @@ -24,8 +24,8 @@ def postgresql_upgrade_database_args def postgresql_upgrade_database postgresql_upgrade_database_args.parse - odeprecated "brew postgresql_upgrade_database", - "using new, versioned e.g. `var/postgres@14` datadir and `pg_upgrade`" + odisabled "brew postgresql_upgrade_database", + "using new, versioned e.g. `var/postgres@14` datadir and `pg_upgrade`" name = "postgresql" pg = Formula[name] diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 2a849ddd9d76a3..a014d75bdff302 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -49,17 +49,15 @@ def self.audit_args "for Homebrew. This should be used when creating new formulae or casks and implies " \ "`--strict` and `--online`." switch "--new-formula", - # odeprecated: uncomment `replacement` to enable the `odeprecated` handling in `CLI::Parser` - # replacement: "--new", - # odeprecated: remove `args.new_formula?` calls once this is `true` - disable: false, - hidden: true + replacement: "--new", + # odeprecated: change this to true on disable and remove `args.new_formula?` calls + disable: false, + hidden: true switch "--new-cask", - # odeprecated: uncomment `replacement` to enable the `odeprecated` handling in `CLI::Parser` - # replacement: "--new", - # odeprecated: remove `args.new_cask?` calls once this is `true` - disable: false, - hidden: true + replacement: "--new", + # odeprecated: change this to true on disable and remove `args.new_formula?` calls + disable: false, + hidden: true switch "--[no-]signing", description: "Audit for signed apps, which are required on ARM" switch "--token-conflicts", @@ -74,9 +72,6 @@ def self.audit_args switch "--display-filename", description: "Prefix every line of output with the file or formula name being audited, to " \ "make output easy to grep." - switch "--display-failures-only", - description: "Only display casks that fail the audit. This is the default for formulae and casks.", - hidden: true switch "--skip-style", description: "Skip running non-RuboCop style checks. Useful if you plan on running " \ "`brew style` separately. Enabled by default unless a formula is specified by name." @@ -153,6 +148,8 @@ def self.audit [Formula.all(eval_all: args.eval_all?), Cask::Cask.all] else if args.named.any? { |named_arg| named_arg.end_with?(".rb") } + # This odisabled should probably stick around indefinitely, + # until at least we have a way to exclude error on these in the CLI parser. odisabled "brew audit [path ...]", "brew audit [name ...]" end @@ -247,13 +244,7 @@ def self.audit problems[[f.full_name, path]] = errors if errors.any? end - if audit_casks.any? - require "cask/auditor" - - if args.display_failures_only? - odisabled "`brew audit --display-failures-only`", "`brew audit ` without the argument" - end - end + require "cask/auditor" if audit_casks.any? cask_problems = audit_casks.each_with_object({}) do |cask, problems| path = cask.sourcefile_path diff --git a/Library/Homebrew/dev-cmd/bump-cask-pr.rb b/Library/Homebrew/dev-cmd/bump-cask-pr.rb index dea7392c529b0f..6000b4ea48ab05 100644 --- a/Library/Homebrew/dev-cmd/bump-cask-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-cask-pr.rb @@ -67,7 +67,8 @@ def bump_cask_pr_args def bump_cask_pr args = bump_cask_pr_args.parse - # odeprecated "brew bump-cask-pr --online" if args.online? + odeprecated "brew bump-cask-pr --online" if args.online? + # This will be run by `brew audit` or `brew style` later so run it first to # not start spamming during normal output. gem_groups = [] diff --git a/Library/Homebrew/dev-cmd/livecheck.rb b/Library/Homebrew/dev-cmd/livecheck.rb index 36cf601b375d68..557804fed9d8b2 100644 --- a/Library/Homebrew/dev-cmd/livecheck.rb +++ b/Library/Homebrew/dev-cmd/livecheck.rb @@ -54,7 +54,7 @@ def watchlist_path unless File.exist?(watchlist) previous_default_watchlist = File.expand_path("~/.brew_livecheck_watchlist") if File.exist?(previous_default_watchlist) - odeprecated "~/.brew_livecheck_watchlist", "~/.homebrew/livecheck_watchlist.txt" + odisabled "~/.brew_livecheck_watchlist", "~/.homebrew/livecheck_watchlist.txt" watchlist = previous_default_watchlist end end diff --git a/Library/Homebrew/dev-cmd/pr-automerge.rb b/Library/Homebrew/dev-cmd/pr-automerge.rb index e3d698f78f25ff..583708359f1b60 100644 --- a/Library/Homebrew/dev-cmd/pr-automerge.rb +++ b/Library/Homebrew/dev-cmd/pr-automerge.rb @@ -32,7 +32,9 @@ def pr_automerge_args "in the pull request to the preferred format." switch "--no-autosquash", description: "Instruct `brew pr-publish` to skip automatically reformatting and rewording commits " \ - "in the pull request to the preferred format." + "in the pull request to the preferred format.", + disable: true, # odisabled: remove this switch with 4.3.0 + hidden: true switch "--ignore-failures", description: "Include pull requests that have failing status checks." @@ -43,8 +45,6 @@ def pr_automerge_args def pr_automerge args = pr_automerge_args.parse - odeprecated "`brew pr-publish --no-autosquash`" if args.no_autosquash? - without_labels = args.without_labels || [ "do not merge", "new formula", diff --git a/Library/Homebrew/dev-cmd/pr-publish.rb b/Library/Homebrew/dev-cmd/pr-publish.rb index 24655e404bcf0f..1b732fe28731fc 100644 --- a/Library/Homebrew/dev-cmd/pr-publish.rb +++ b/Library/Homebrew/dev-cmd/pr-publish.rb @@ -17,9 +17,6 @@ def pr_publish_args switch "--autosquash", description: "If supported on the target tap, automatically reformat and reword commits " \ "to our preferred format." - switch "--no-autosquash", - description: "Skip automatically reformatting and rewording commits in the pull request " \ - "to the preferred format, even if supported on the target tap." switch "--large-runner", description: "Run the upload job on a large runner." flag "--branch=", @@ -39,8 +36,6 @@ def pr_publish_args def pr_publish args = pr_publish_args.parse - odisabled "`brew pr-publish --no-autosquash`" if args.no_autosquash? - tap = Tap.fetch(args.tap || CoreTap.instance.name) workflow = args.workflow || "publish-commit-bottles.yml" ref = args.branch || "master" diff --git a/Library/Homebrew/dev-cmd/pr-pull.rb b/Library/Homebrew/dev-cmd/pr-pull.rb index 82a60194c7c243..bd50244718e176 100644 --- a/Library/Homebrew/dev-cmd/pr-pull.rb +++ b/Library/Homebrew/dev-cmd/pr-pull.rb @@ -34,7 +34,9 @@ def self.pr_pull_args "preferred format." switch "--no-autosquash", description: "Skip automatically reformatting and rewording commits in the pull request to our " \ - "preferred format." + "preferred format.", + disable: true, # odisabled: remove this switch with 4.3.0 + hidden: true switch "--branch-okay", description: "Do not warn if pulling to a branch besides the repository default (useful for testing)." switch "--resolve", @@ -406,8 +408,6 @@ def self.pr_check_conflicts(repo, pull_request) def self.pr_pull args = pr_pull_args.parse - odeprecated "`brew pr-pull --no-autosquash`" if args.no_autosquash? - # Needed when extracting the CI artifact. ensure_executable!("unzip", reason: "extracting CI artifacts") diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index f018096ec0dca0..dc486de7a86be9 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -86,7 +86,7 @@ def quiet! # @api private sig { void } def shutup! - # odeprecated "AbstractDownloadStrategy#shutup!", "AbstractDownloadStrategy#quiet!" + odeprecated "AbstractDownloadStrategy#shutup!", "AbstractDownloadStrategy#quiet!" quiet! end diff --git a/Library/Homebrew/extend/kernel.rb b/Library/Homebrew/extend/kernel.rb index f03ab2190f87df..c29d1f12963c5e 100644 --- a/Library/Homebrew/extend/kernel.rb +++ b/Library/Homebrew/extend/kernel.rb @@ -317,12 +317,6 @@ def exec_browser(*args) end end - # GZips the given paths, and returns the gzipped paths. - def gzip(*paths) - odisabled "Utils.gzip", "Utils::Gzip.compress" - Utils::Gzip.compress(*paths) - end - def ignore_interrupts(_opt = nil) # rubocop:disable Style/GlobalVars $ignore_interrupts_nesting_level = 0 unless defined?($ignore_interrupts_nesting_level) @@ -502,18 +496,6 @@ def with_env(hash) end end - sig { returns(String) } - def preferred_shell - odisabled "preferred_shell" - Utils::Shell.preferred_path(default: "/bin/sh") - end - - sig { returns(String) } - def shell_profile - odisabled "shell_profile" - Utils::Shell.profile - end - def tap_and_name_comparison proc do |a, b| if a.include?("/") && b.exclude?("/") diff --git a/Library/Homebrew/extend/os/mac/tap.rb b/Library/Homebrew/extend/os/mac/tap.rb index 8d9bace415092f..487981af69cd6c 100644 --- a/Library/Homebrew/extend/os/mac/tap.rb +++ b/Library/Homebrew/extend/os/mac/tap.rb @@ -3,7 +3,7 @@ class Tap def self.install_default_cask_tap_if_necessary(force: false) - odeprecated "Tap.install_default_cask_tap_if_necessary", "CoreCaskTap.ensure_installed!" + odisabled "Tap.install_default_cask_tap_if_necessary", "CoreCaskTap.ensure_installed!" cask_tap = CoreCaskTap.instance return false if cask_tap.installed? diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index cb3bc7f106c569..ddd868f888b8b8 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -530,7 +530,7 @@ def versioned_formulae # @deprecated Use {#oldnames} instead. sig { returns(T.nilable(String)) } def oldname - odeprecated "Formula#oldname", "Formula#oldnames" + odisabled "Formula#oldname", "Formula#oldnames" @oldname ||= oldnames.first end @@ -567,9 +567,11 @@ def aliases delegate declared_deps: :active_spec # Dependencies provided by macOS for the currently active {SoftwareSpec}. + # @deprecated delegate uses_from_macos_elements: :active_spec # Dependency names provided by macOS for the currently active {SoftwareSpec}. + # @deprecated delegate uses_from_macos_names: :active_spec # The {Requirement}s for the currently active {SoftwareSpec}. @@ -1084,6 +1086,7 @@ def with_logging(log_type) # # @deprecated Please use {Homebrew::Service} instead. def plist + # odeprecated: consider removing entirely in 4.3.0 nil end @@ -1099,13 +1102,6 @@ def service_name service.service_name end - # The generated launchd {.plist} file path. - sig { returns(Pathname) } - def plist_path - odisabled "formula.plist_path", "formula.launchd_service_path" - launchd_service_path - end - # The generated launchd {.service} file path. sig { returns(Pathname) } def launchd_service_path @@ -1129,12 +1125,6 @@ def service @service ||= Homebrew::Service.new(self, &self.class.service) end - # @private - delegate plist_manual: :"self.class" - - # @private - delegate plist_startup: :"self.class" - # A stable path for this formula, when installed. Contains the formula name # but no version number. Only the active version will be linked here if # multiple versions are installed. @@ -1933,7 +1923,9 @@ def self.full_names # this should only be used when users specify `--all` to a command # @private def self.all(eval_all: false) - odisabled "Formula#all without --eval-all or HOMEBREW_EVAL_ALL" if !eval_all && !Homebrew::EnvConfig.eval_all? + if !eval_all && !Homebrew::EnvConfig.eval_all? + raise ArgumentError, "Formula#all without --eval-all or HOMEBREW_EVAL_ALL" + end (core_names + tap_files).map do |name_or_file| Formulary.factory(name_or_file) @@ -2928,7 +2920,6 @@ def inherited(child) @conflicts = [] @skip_clean_paths = Set.new @link_overwrite_paths = Set.new - @allowed_missing_libraries = Set.new @loaded_from_api = false end end @@ -2950,7 +2941,6 @@ def freeze @conflicts.freeze @skip_clean_paths.freeze @link_overwrite_paths.freeze - @allowed_missing_libraries.freeze super end @@ -3032,14 +3022,6 @@ def service? @service_block.present? end - # The `:startup` attribute set by {.plist_options}. - # @private - attr_reader :plist_startup - - # The `:manual` attribute set by {.plist_options}. - # @private - attr_reader :plist_manual - # @private attr_reader :conflicts @@ -3049,9 +3031,6 @@ def service? # @private attr_reader :link_overwrite_paths - # @private - attr_reader :allowed_missing_libraries - # If `pour_bottle?` returns `false` the user-visible reason to display for # why they cannot use the bottle. # @private @@ -3360,24 +3339,6 @@ def patch(strip = :p1, src = nil, &block) specs.each { |spec| spec.patch(strip, src, &block) } end - # Defines launchd plist handling. - # - # Does your plist need to be loaded at startup? - #
plist_options startup: true
- # - # Or only when necessary or desired by the user? - #
plist_options manual: "foo"
- # - # Or perhaps you'd like to give the user a choice? Ooh fancy. - #
plist_options startup: true, manual: "foo start"
- # - # @deprecated Please use {Homebrew::Service.require_root} instead. - def plist_options(options) - odisabled "plist_options", "service.require_root" - @plist_startup = options[:startup] - @plist_manual = options[:manual] - end - # One or more formulae that conflict with this one and why. #
conflicts_with "imagemagick", because: "both install `convert` binaries"
def conflicts_with(*names) @@ -3661,21 +3622,6 @@ def link_overwrite(*paths) paths.flatten! link_overwrite_paths.merge(paths) end - - # Permit links to certain libraries that don't exist. Available on Linux only. - def ignore_missing_libraries(*libs) - odisabled "ignore_missing_libraries" - unless Homebrew::SimulateSystem.simulating_or_running_on_linux? - raise FormulaSpecificationError, "#{__method__} is available on Linux only" - end - - libraries = libs.flatten - if libraries.any? { |x| !x.is_a?(String) && !x.is_a?(Regexp) } - raise FormulaSpecificationError, "#{__method__} can handle Strings and Regular Expressions only" - end - - allowed_missing_libraries.merge(libraries) - end end end diff --git a/Library/Homebrew/github_packages.rb b/Library/Homebrew/github_packages.rb index 98fab98f4d2504..7cbae8941b5956 100644 --- a/Library/Homebrew/github_packages.rb +++ b/Library/Homebrew/github_packages.rb @@ -124,8 +124,8 @@ def self.image_formula_name(formula_name) def self.image_version_rebuild(version_rebuild) return version_rebuild if version_rebuild.match?(VALID_OCI_TAG_REGEX) - # odeprecated "GitHub Packages versions that do not match #{VALID_OCI_TAG_REGEX.source}", - # "declaring a new `version` without these characters" + odeprecated "GitHub Packages versions that do not match #{VALID_OCI_TAG_REGEX.source}", + "declaring a new `version` without these characters" version_rebuild.gsub(INVALID_OCI_TAG_CHARS_REGEX, ".") end diff --git a/Library/Homebrew/language/python.rb b/Library/Homebrew/language/python.rb index cd509d83ae1667..1926755302723e 100644 --- a/Library/Homebrew/language/python.rb +++ b/Library/Homebrew/language/python.rb @@ -143,7 +143,15 @@ module Virtualenv # @return [Virtualenv] a {Virtualenv} instance def virtualenv_create(venv_root, python = "python", formula = self, system_site_packages: true, without_pip: true) - # odeprecated "Language::Python::Virtualenv.virtualenv_create's without_pip" unless without_pip + # Limit deprecation to 3.12+ for now (or if we can't determine the version). + # Some used this argument for setuptools, which we no longer bundle since 3.12. + unless without_pip + python_version = Language::Python.major_minor_version(python) + if python_version.nil? || python_version.null? || python_version >= "3.12" + raise ArgumentError, "virtualenv_create's without_pip is deprecated starting with Python 3.12" + end + end + ENV.refurbish_args venv = Virtualenv.new formula, venv_root, python venv.create(system_site_packages: system_site_packages, without_pip: without_pip) diff --git a/Library/Homebrew/linkage_checker.rb b/Library/Homebrew/linkage_checker.rb index d3befd6423ab79..e7c6e2c3b1961c 100644 --- a/Library/Homebrew/linkage_checker.rb +++ b/Library/Homebrew/linkage_checker.rb @@ -19,8 +19,6 @@ def initialize(keg, formula = nil, cache_db:, rebuild_cache: false) @system_dylibs = Set.new @broken_dylibs = Set.new - @unexpected_broken_dylibs = nil - @unexpected_present_dylibs = nil @variable_dylibs = Set.new @brewed_dylibs = Hash.new { |h, k| h[k] = Set.new } @reverse_links = Hash.new { |h, k| h[k] = Set.new } @@ -65,8 +63,7 @@ def display_reverse_output end def display_test_output(puts_output: true, strict: false) - display_items "Missing libraries", broken_dylibs_with_expectations, puts_output: puts_output - display_items "Unused missing linkage information", unexpected_present_dylibs, puts_output: puts_output + display_items "Missing libraries", @broken_dylibs, puts_output: puts_output display_items "Broken dependencies", @broken_deps, puts_output: puts_output display_items "Unwanted system libraries", @unwanted_system_dylibs, puts_output: puts_output display_items "Conflicting libraries", @version_conflict_deps, puts_output: puts_output @@ -81,54 +78,14 @@ def display_test_output(puts_output: true, strict: false) def broken_library_linkage?(test: false, strict: false) raise ArgumentError, "Strict linkage checking requires test mode to be enabled." if strict && !test - issues = [@broken_deps, unexpected_broken_dylibs] + issues = [@broken_deps, @broken_dylibs] if test - issues += [@unwanted_system_dylibs, @version_conflict_deps, unexpected_present_dylibs] + issues += [@unwanted_system_dylibs, @version_conflict_deps] issues += [@undeclared_deps, @files_missing_rpaths, @executable_path_dylibs] if strict end issues.any?(&:present?) end - def unexpected_broken_dylibs - return @unexpected_broken_dylibs if @unexpected_broken_dylibs - - @unexpected_broken_dylibs = @broken_dylibs.reject do |broken_lib| - @formula.class.allowed_missing_libraries.any? do |allowed_missing_lib| - case allowed_missing_lib - when Regexp - allowed_missing_lib.match? broken_lib - when String - broken_lib.include? allowed_missing_lib - end - end - end - end - - def unexpected_present_dylibs - @unexpected_present_dylibs ||= @formula.class.allowed_missing_libraries.reject do |allowed_missing_lib| - @broken_dylibs.any? do |broken_lib| - case allowed_missing_lib - when Regexp - allowed_missing_lib.match? broken_lib - when String - broken_lib.include? allowed_missing_lib - end - end - end - end - - def broken_dylibs_with_expectations - output = {} - @broken_dylibs.each do |broken_lib| - output[broken_lib] = if unexpected_broken_dylibs.include? broken_lib - ["unexpected"] - else - ["expected"] - end - end - output - end - private def dylib_to_dep(dylib) diff --git a/Library/Homebrew/livecheck/livecheck.rb b/Library/Homebrew/livecheck/livecheck.rb index ecef17c3ec026c..dd198c7d804f5d 100644 --- a/Library/Homebrew/livecheck/livecheck.rb +++ b/Library/Homebrew/livecheck/livecheck.rb @@ -255,7 +255,7 @@ def run_checks( next end - formula&.head&.downloader&.shutup! + formula&.head&.downloader&.quiet! # Use the `stable` version for comparison except for installed # head-only formulae. A formula with `stable` and `head` that's diff --git a/Library/Homebrew/macos_version.rb b/Library/Homebrew/macos_version.rb index b871c3d0c75a63..a4ff1e3029a5aa 100644 --- a/Library/Homebrew/macos_version.rb +++ b/Library/Homebrew/macos_version.rb @@ -143,7 +143,7 @@ def requires_nehalem_cpu? module MacOSVersionErrorCompat def const_missing(name) if name == :MacOSVersionError - odeprecated "MacOSVersionError", "MacOSVersion::Error" + odisabled "MacOSVersionError", "MacOSVersion::Error" return MacOSVersion::Error end @@ -160,7 +160,7 @@ class << self module MacOSVersions SYMBOLS = LazyObject.new do # rubocop:disable Style/MutableConstant - odeprecated "MacOSVersions::SYMBOLS", "MacOSVersion::SYMBOLS" + odisabled "MacOSVersions::SYMBOLS", "MacOSVersion::SYMBOLS" MacOSVersion::SYMBOLS end end @@ -169,7 +169,7 @@ module OS module Mac # TODO: Replace `::Version` with `Version` when this is removed. Version = LazyObject.new do # rubocop:disable Style/MutableConstant - odeprecated "OS::Mac::Version", "MacOSVersion" + odisabled "OS::Mac::Version", "MacOSVersion" MacOSVersion end end diff --git a/Library/Homebrew/os/linux.rb b/Library/Homebrew/os/linux.rb index 877255268def77..197c5ebda2c52e 100644 --- a/Library/Homebrew/os/linux.rb +++ b/Library/Homebrew/os/linux.rb @@ -55,60 +55,60 @@ module Mac raise "Loaded OS::Linux on generic OS!" if ENV["HOMEBREW_TEST_GENERIC_OS"] def self.version - # odeprecated "`MacOS.version` on Linux" + odeprecated "`MacOS.version` on Linux" MacOSVersion::NULL end def self.full_version - # odeprecated "`MacOS.full_version` on Linux" + odeprecated "`MacOS.full_version` on Linux" MacOSVersion::NULL end def self.languages - # odeprecated "`MacOS.languages` on Linux" + odeprecated "`MacOS.languages` on Linux" @languages ||= Array(ENV["LANG"]&.slice(/[a-z]+/)).uniq end def self.language - # odeprecated "`MacOS.language` on Linux" + odeprecated "`MacOS.language` on Linux" languages.first end def self.sdk_root_needed? - # odeprecated "`MacOS.sdk_root_needed?` on Linux" + odeprecated "`MacOS.sdk_root_needed?` on Linux" false end def self.sdk_path_if_needed(_version = nil) - # odeprecated "`MacOS.sdk_path_if_needed` on Linux" + odeprecated "`MacOS.sdk_path_if_needed` on Linux" nil end def self.sdk_path(_version = nil) - # odeprecated "`MacOS.sdk_path` on Linux" + odeprecated "`MacOS.sdk_path` on Linux" nil end module Xcode def self.version - # odeprecated "`MacOS::Xcode.version` on Linux" + odeprecated "`MacOS::Xcode.version` on Linux" ::Version::NULL end def self.installed? - # odeprecated "`MacOS::Xcode.installed?` on Linux" + odeprecated "`MacOS::Xcode.installed?` on Linux" false end end module CLT def self.version - # odeprecated "`MacOS::CLT.version` on Linux" + odeprecated "`MacOS::CLT.version` on Linux" ::Version::NULL end def self.installed? - # odeprecated "`MacOS::CLT.installed?` on Linux" + odeprecated "`MacOS::CLT.installed?` on Linux" false end end diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb index ed9a875e046278..dad9a2174d052c 100644 --- a/Library/Homebrew/os/mac.rb +++ b/Library/Homebrew/os/mac.rb @@ -24,7 +24,7 @@ module Mac # using the standard Ruby Comparable methods. sig { returns(MacOSVersion) } def self.version - # odeprecated "`MacOS.version` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux? + odeprecated "`MacOS.version` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux? @version ||= full_version.strip_patch end @@ -32,7 +32,7 @@ def self.version # using the standard Ruby Comparable methods. sig { returns(MacOSVersion) } def self.full_version - # odeprecated "`MacOS.full_version` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux? + odeprecated "`MacOS.full_version` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux? @full_version ||= if ENV["HOMEBREW_FAKE_EL_CAPITAN"] # for Portable Ruby building MacOSVersion.new("10.11.6") else @@ -65,7 +65,7 @@ def self.preferred_perl_version end def self.languages - # odeprecated "`MacOS.languages` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux? + odeprecated "`MacOS.languages` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux? return @languages if @languages os_langs = Utils.popen_read("defaults", "read", "-g", "AppleLanguages") @@ -79,7 +79,7 @@ def self.languages end def self.language - # odeprecated "`MacOS.language` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux? + odeprecated "`MacOS.language` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux? languages.first end @@ -90,7 +90,7 @@ def self.active_developer_dir sig { returns(T::Boolean) } def self.sdk_root_needed? - # odeprecated "`MacOS.sdk_root_needed?` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux? + odeprecated "`MacOS.sdk_root_needed?` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux? if MacOS::CLT.installed? # If there's no CLT SDK, return false return false unless MacOS::CLT.provides_sdk? @@ -139,13 +139,13 @@ def self.sdk_for_formula(formula, version = nil, check_only_runtime_requirements # Returns the path to an SDK or nil, following the rules set by {sdk}. def self.sdk_path(version = nil) - # odeprecated "`MacOS.sdk_path` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux? + odeprecated "`MacOS.sdk_path` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux? s = sdk(version) s&.path end def self.sdk_path_if_needed(version = nil) - # odeprecated "`MacOS.sdk_path_if_needed` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux? + odeprecated "`MacOS.sdk_path_if_needed` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux? # Prefer CLT SDK when both Xcode and the CLT are installed. # Expected results: # 1. On Xcode-only systems, return the Xcode SDK. diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb index e589d2d670c8ea..7673b2cae9ba9f 100755 --- a/Library/Homebrew/os/mac/xcode.rb +++ b/Library/Homebrew/os/mac/xcode.rb @@ -126,7 +126,7 @@ def self.bundle_path sig { returns(T::Boolean) } def self.installed? - # odeprecated "`MacOS::Xcode.installed?` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux? + odeprecated "`MacOS::Xcode.installed?` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux? !prefix.nil? end @@ -175,7 +175,7 @@ def self.update_instructions sig { returns(::Version) } def self.version - # odeprecated "`MacOS::Xcode.version` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux? + odeprecated "`MacOS::Xcode.version` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux? # may return a version string # that is guessed based on the compiler, so do not # use it in order to check if Xcode is installed. @@ -266,7 +266,7 @@ module CLT # Returns true even if outdated tools are installed. sig { returns(T::Boolean) } def self.installed? - # odeprecated "`MacOS::CLT.installed?` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux? + odeprecated "`MacOS::CLT.installed?` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux? !version.null? end @@ -400,7 +400,7 @@ def self.detect_version_from_clang_version # version numbers. sig { returns(::Version) } def self.version - # odeprecated "`MacOS::CLT.version` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux? + odeprecated "`MacOS::CLT.version` on Linux" if Homebrew::SimulateSystem.simulating_or_running_on_linux? if @version ||= detect_version ::Version.new @version else diff --git a/Library/Homebrew/rubocops/text.rb b/Library/Homebrew/rubocops/text.rb index 9ef5b63fecc2c4..636a79c70122bd 100644 --- a/Library/Homebrew/rubocops/text.rb +++ b/Library/Homebrew/rubocops/text.rb @@ -24,12 +24,11 @@ def audit_formula(node, _class_node, _parent_class_node, body_node) return if body_node.nil? - if !find_node_method_by_name(body_node, :plist_options) && - find_method_def(body_node, :plist) - problem "Please set plist_options when using a formula-defined plist." + if find_method_def(body_node, :plist) + problem "`def plist` is deprecated. Please use services instead: https://docs.brew.sh/Formula-Cookbook#service-files" end - if (depends_on?("openssl") || depends_on?("openssl@1.1")) && depends_on?("libressl") + if (depends_on?("openssl") || depends_on?("openssl@3")) && depends_on?("libressl") problem "Formulae should not depend on both OpenSSL and LibreSSL (even optionally)." end diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb index c1042875c9efed..1d47f14c858430 100644 --- a/Library/Homebrew/software_spec.rb +++ b/Library/Homebrew/software_spec.rb @@ -204,14 +204,16 @@ def uses_from_macos(deps, bounds = {}) # @deprecated def uses_from_macos_elements - # TODO: remove all @uses_from_macos_elements when disabling or removing this method - odeprecated "#uses_from_macos_elements", "#declared_deps" + # TODO: remove all @uses_from_macos_elements when removing this method + # Also remember to remove the delegate from formula.rb + odisabled "#uses_from_macos_elements", "#declared_deps" @uses_from_macos_elements end # @deprecated def uses_from_macos_names - odeprecated "#uses_from_macos_names", "#declared_deps" + # TODO: Remember to remove the delegate from formula.rb + odisabled "#uses_from_macos_names", "#declared_deps" uses_from_macos_elements.flat_map { |e| e.is_a?(Hash) ? e.keys : e } end diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index 965493574667fb..42f235fe91b5c7 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -67,14 +67,14 @@ def self.from_path(path) sig { returns(CoreCaskTap) } def self.default_cask_tap - odeprecated "Tap.default_cask_tap", "CoreCaskTap.instance" + odisabled "Tap.default_cask_tap", "CoreCaskTap.instance" CoreCaskTap.instance end sig { params(force: T::Boolean).returns(T::Boolean) } def self.install_default_cask_tap_if_necessary(force: false) - odeprecated "Tap.install_default_cask_tap_if_necessary", "CoreCaskTap.ensure_installed!" + odisabled "Tap.install_default_cask_tap_if_necessary", "CoreCaskTap.ensure_installed!" false end @@ -319,8 +319,7 @@ def install(quiet: false, clone_target: nil, force_auto_update: nil, path.cd { safe_system "git", *args } return elsif (core_tap? || core_cask_tap?) && !Homebrew::EnvConfig.no_install_from_api? && !force - # odeprecated: move to odie in the next minor release. This may break some CI so we should give notice. - opoo "Tapping #{name} is no longer typically necessary.\n" \ + odie "Tapping #{name} is no longer typically necessary.\n" \ "Add #{Formatter.option("--force")} if you are sure you need it done." end diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb index 560a88c16ee112..34191d95d749a0 100644 --- a/Library/Homebrew/version.rb +++ b/Library/Homebrew/version.rb @@ -341,7 +341,7 @@ def self.detect(url, **specs) sig { params(val: String).returns(Version) } def self.create(val) - odeprecated "Version.create", "Version.new" + odisabled "Version.create", "Version.new" new(val) end diff --git a/completions/bash/brew b/completions/bash/brew index 2ffe7b40fc0a47..38896782c8b023 100644 --- a/completions/bash/brew +++ b/completions/bash/brew @@ -1714,7 +1714,6 @@ _brew_pr_automerge() { --debug --help --ignore-failures - --no-autosquash --publish --quiet --tap @@ -1741,7 +1740,6 @@ _brew_pr_publish() { --help --large-runner --message - --no-autosquash --quiet --tap --verbose @@ -1769,7 +1767,6 @@ _brew_pr_pull() { --ignore-missing-artifacts --keep-old --message - --no-autosquash --no-cherry-pick --no-commit --no-upload diff --git a/completions/fish/brew.fish b/completions/fish/brew.fish index 60929b81db68ba..f285227f332bca 100644 --- a/completions/fish/brew.fish +++ b/completions/fish/brew.fish @@ -1166,7 +1166,6 @@ __fish_brew_complete_arg 'pr-automerge' -l autosquash -d 'Instruct `brew pr-publ __fish_brew_complete_arg 'pr-automerge' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'pr-automerge' -l help -d 'Show this message' __fish_brew_complete_arg 'pr-automerge' -l ignore-failures -d 'Include pull requests that have failing status checks' -__fish_brew_complete_arg 'pr-automerge' -l no-autosquash -d 'Instruct `brew pr-publish` to skip automatically reformatting and rewording commits in the pull request to the preferred format' __fish_brew_complete_arg 'pr-automerge' -l publish -d 'Run `brew pr-publish` on matching pull requests' __fish_brew_complete_arg 'pr-automerge' -l quiet -d 'Make some output more quiet' __fish_brew_complete_arg 'pr-automerge' -l tap -d 'Target tap repository (default: `homebrew/core`)' @@ -1184,7 +1183,6 @@ __fish_brew_complete_arg 'pr-publish' -l debug -d 'Display any debugging informa __fish_brew_complete_arg 'pr-publish' -l help -d 'Show this message' __fish_brew_complete_arg 'pr-publish' -l large-runner -d 'Run the upload job on a large runner' __fish_brew_complete_arg 'pr-publish' -l message -d 'Message to include when autosquashing revision bumps, deletions, and rebuilds' -__fish_brew_complete_arg 'pr-publish' -l no-autosquash -d 'Skip automatically reformatting and rewording commits in the pull request to the preferred format, even if supported on the target tap' __fish_brew_complete_arg 'pr-publish' -l quiet -d 'Make some output more quiet' __fish_brew_complete_arg 'pr-publish' -l tap -d 'Target tap repository (default: `homebrew/core`)' __fish_brew_complete_arg 'pr-publish' -l verbose -d 'Make some output more verbose' @@ -1203,7 +1201,6 @@ __fish_brew_complete_arg 'pr-pull' -l help -d 'Show this message' __fish_brew_complete_arg 'pr-pull' -l ignore-missing-artifacts -d 'Comma-separated list of workflows which can be ignored if they have not been run' __fish_brew_complete_arg 'pr-pull' -l keep-old -d 'If the formula specifies a rebuild version, attempt to preserve its value in the generated DSL' __fish_brew_complete_arg 'pr-pull' -l message -d 'Message to include when autosquashing revision bumps, deletions, and rebuilds' -__fish_brew_complete_arg 'pr-pull' -l no-autosquash -d 'Skip automatically reformatting and rewording commits in the pull request to our preferred format' __fish_brew_complete_arg 'pr-pull' -l no-cherry-pick -d 'Do not cherry-pick commits from the pull request branch' __fish_brew_complete_arg 'pr-pull' -l no-commit -d 'Do not generate a new commit before uploading' __fish_brew_complete_arg 'pr-pull' -l no-upload -d 'Download the bottles but don\'t upload them' diff --git a/completions/zsh/_brew b/completions/zsh/_brew index 60cd73c963b6f5..ee5c2f531d23f6 100644 --- a/completions/zsh/_brew +++ b/completions/zsh/_brew @@ -1449,7 +1449,6 @@ _brew_pr_automerge() { '--debug[Display any debugging information]' \ '--help[Show this message]' \ '--ignore-failures[Include pull requests that have failing status checks]' \ - '--no-autosquash[Instruct `brew pr-publish` to skip automatically reformatting and rewording commits in the pull request to the preferred format]' \ '--publish[Run `brew pr-publish` on matching pull requests]' \ '--quiet[Make some output more quiet]' \ '--tap[Target tap repository (default: `homebrew/core`)]' \ @@ -1469,7 +1468,6 @@ _brew_pr_publish() { '--help[Show this message]' \ '--large-runner[Run the upload job on a large runner]' \ '--message[Message to include when autosquashing revision bumps, deletions, and rebuilds]' \ - '--no-autosquash[Skip automatically reformatting and rewording commits in the pull request to the preferred format, even if supported on the target tap]' \ '--quiet[Make some output more quiet]' \ '--tap[Target tap repository (default: `homebrew/core`)]' \ '--verbose[Make some output more verbose]' \ @@ -1490,7 +1488,6 @@ _brew_pr_pull() { '--ignore-missing-artifacts[Comma-separated list of workflows which can be ignored if they have not been run]' \ '--keep-old[If the formula specifies a rebuild version, attempt to preserve its value in the generated DSL]' \ '--message[Message to include when autosquashing revision bumps, deletions, and rebuilds]' \ - '--no-autosquash[Skip automatically reformatting and rewording commits in the pull request to our preferred format]' \ '--no-cherry-pick[Do not cherry-pick commits from the pull request branch]' \ '--no-commit[Do not generate a new commit before uploading]' \ '--no-upload[Download the bottles but don'\''t upload them]' \ diff --git a/docs/Manpage.md b/docs/Manpage.md index ad21400356caf4..1a23de52401554 100644 --- a/docs/Manpage.md +++ b/docs/Manpage.md @@ -1384,8 +1384,6 @@ Find pull requests that can be automatically merged using `brew pr-publish`. Run `brew pr-publish` on matching pull requests. * `--autosquash`: Instruct `brew pr-publish` to automatically reformat and reword commits in the pull request to the preferred format. -* `--no-autosquash`: - Instruct `brew pr-publish` to skip automatically reformatting and rewording commits in the pull request to the preferred format. * `--ignore-failures`: Include pull requests that have failing status checks. @@ -1396,8 +1394,6 @@ Requires write access to the repository. * `--autosquash`: If supported on the target tap, automatically reformat and reword commits to our preferred format. -* `--no-autosquash`: - Skip automatically reformatting and rewording commits in the pull request to the preferred format, even if supported on the target tap. * `--large-runner`: Run the upload job on a large runner. * `--branch`: @@ -1429,8 +1425,6 @@ Requires write access to the repository. If the formula specifies a rebuild version, attempt to preserve its value in the generated DSL. * `--autosquash`: Automatically reformat and reword commits in the pull request to our preferred format. -* `--no-autosquash`: - Skip automatically reformatting and rewording commits in the pull request to our preferred format. * `--branch-okay`: Do not warn if pulling to a branch besides the repository default (useful for testing). * `--resolve`: diff --git a/manpages/brew.1 b/manpages/brew.1 index 400148d7e9fe17..b19ab3bf13dae3 100644 --- a/manpages/brew.1 +++ b/manpages/brew.1 @@ -1981,10 +1981,6 @@ Run \fBbrew pr\-publish\fR on matching pull requests\. Instruct \fBbrew pr\-publish\fR to automatically reformat and reword commits in the pull request to the preferred format\. . .TP -\fB\-\-no\-autosquash\fR -Instruct \fBbrew pr\-publish\fR to skip automatically reformatting and rewording commits in the pull request to the preferred format\. -. -.TP \fB\-\-ignore\-failures\fR Include pull requests that have failing status checks\. . @@ -1996,10 +1992,6 @@ Publish bottles for a pull request with GitHub Actions\. Requires write access t If supported on the target tap, automatically reformat and reword commits to our preferred format\. . .TP -\fB\-\-no\-autosquash\fR -Skip automatically reformatting and rewording commits in the pull request to the preferred format, even if supported on the target tap\. -. -.TP \fB\-\-large\-runner\fR Run the upload job on a large runner\. . @@ -2051,10 +2043,6 @@ If the formula specifies a rebuild version, attempt to preserve its value in the Automatically reformat and reword commits in the pull request to our preferred format\. . .TP -\fB\-\-no\-autosquash\fR -Skip automatically reformatting and rewording commits in the pull request to our preferred format\. -. -.TP \fB\-\-branch\-okay\fR Do not warn if pulling to a branch besides the repository default (useful for testing)\. .