Remove compatibility layer

This commit is contained in:
Douglas Eichelberger 2023-03-14 14:49:34 -07:00
parent 0d5e291fe1
commit cc5b013cb9
20 changed files with 2 additions and 56 deletions

View File

@ -255,9 +255,6 @@ jobs:
- name: tests (online) - name: tests (online)
test-flags: --online --coverage test-flags: --online --coverage
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
- name: tests (no-compatibility mode)
test-flags: --no-compat --coverage
runs-on: ubuntu-22.04
- name: tests (generic OS) - name: tests (generic OS)
test-flags: --generic --coverage test-flags: --generic --coverage
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04

View File

@ -63,7 +63,6 @@ SimpleCov.start do
add_filter %r{^/constants.rb$} add_filter %r{^/constants.rb$}
add_filter %r{^/postinstall.rb$} add_filter %r{^/postinstall.rb$}
add_filter %r{^/test.rb$} add_filter %r{^/test.rb$}
add_filter %r{^/compat/}
add_filter %r{^/dev-cmd/tests.rb$} add_filter %r{^/dev-cmd/tests.rb$}
add_filter %r{^/test/} add_filter %r{^/test/}
add_filter %r{^/vendor/} add_filter %r{^/vendor/}

View File

@ -6,7 +6,6 @@
--template-path yard/templates --template-path yard/templates
--exclude test/ --exclude test/
--exclude vendor/ --exclude vendor/
--exclude compat/
extend/os/**/*.rb extend/os/**/*.rb
**/*.rb **/*.rb
- -

View File

@ -1,2 +0,0 @@
# typed: true
# frozen_string_literal: true

View File

@ -1,2 +0,0 @@
# typed: strict
# frozen_string_literal: true

View File

@ -1,2 +0,0 @@
# typed: true
# frozen_string_literal: true

View File

@ -1,5 +0,0 @@
# typed: strict
# frozen_string_literal: true
require "compat/formula"
require "compat/cask"

View File

@ -19,8 +19,6 @@ module Homebrew
description: "Generate code coverage reports." description: "Generate code coverage reports."
switch "--generic", switch "--generic",
description: "Run only OS-agnostic tests." description: "Run only OS-agnostic tests."
switch "--no-compat",
description: "Do not load the compatibility layer when running tests."
switch "--online", switch "--online",
description: "Include tests that use the GitHub API and tests that use any of the taps for " \ description: "Include tests that use the GitHub API and tests that use any of the taps for " \
"official external commands." "official external commands."
@ -125,7 +123,6 @@ module Homebrew
end end
parallel_rspec_log_name = "parallel_runtime_rspec" parallel_rspec_log_name = "parallel_runtime_rspec"
parallel_rspec_log_name = "#{parallel_rspec_log_name}.no_compat" if args.no_compat?
parallel_rspec_log_name = "#{parallel_rspec_log_name}.generic" if args.generic? parallel_rspec_log_name = "#{parallel_rspec_log_name}.generic" if args.generic?
parallel_rspec_log_name = "#{parallel_rspec_log_name}.online" if args.online? parallel_rspec_log_name = "#{parallel_rspec_log_name}.online" if args.online?
parallel_rspec_log_name = "#{parallel_rspec_log_name}.log" parallel_rspec_log_name = "#{parallel_rspec_log_name}.log"
@ -230,7 +227,6 @@ module Homebrew
ENV["HOMEBREW_TESTS"] = "1" ENV["HOMEBREW_TESTS"] = "1"
ENV["HOMEBREW_NO_AUTO_UPDATE"] = "1" ENV["HOMEBREW_NO_AUTO_UPDATE"] = "1"
ENV["HOMEBREW_NO_ANALYTICS_THIS_RUN"] = "1" ENV["HOMEBREW_NO_ANALYTICS_THIS_RUN"] = "1"
ENV["HOMEBREW_NO_COMPAT"] = "1" if args.no_compat?
ENV["HOMEBREW_TEST_GENERIC_OS"] = "1" if args.generic? ENV["HOMEBREW_TEST_GENERIC_OS"] = "1" if args.generic?
ENV["HOMEBREW_TEST_ONLINE"] = "1" if args.online? ENV["HOMEBREW_TEST_ONLINE"] = "1" if args.online?
ENV["HOMEBREW_SORBET_RUNTIME"] = "1" ENV["HOMEBREW_SORBET_RUNTIME"] = "1"

View File

@ -288,10 +288,6 @@ module Homebrew
default_text: "`$NO_COLOR`.", default_text: "`$NO_COLOR`.",
boolean: true, boolean: true,
}, },
HOMEBREW_NO_COMPAT: {
description: "If set, disable all use of legacy compatibility code.",
boolean: true,
},
HOMEBREW_NO_EMOJI: { HOMEBREW_NO_EMOJI: {
description: "If set, do not print `HOMEBREW_INSTALL_BADGE` on a successful build.", description: "If set, do not print `HOMEBREW_INSTALL_BADGE` on a successful build.",
boolean: true, boolean: true,

View File

@ -169,9 +169,6 @@ module Homebrew::EnvConfig
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
def self.no_color?; end def self.no_color?; end
sig { returns(T::Boolean) }
def self.no_compat?; end
sig { returns(T::Boolean) } sig { returns(T::Boolean) }
def self.no_emoji?; end def self.no_emoji?; end

View File

@ -112,7 +112,6 @@ module Kernel
# Try to show the most relevant location in message, i.e. (if applicable): # Try to show the most relevant location in message, i.e. (if applicable):
# - Location in a formula. # - Location in a formula.
# - Location outside of 'compat/'.
# - Location of caller of deprecated method (if all else fails). # - Location of caller of deprecated method (if all else fails).
backtrace = caller backtrace = caller

View File

@ -70,7 +70,6 @@ HOMEBREW_PULL_OR_COMMIT_URL_REGEX =
HOMEBREW_BOTTLES_EXTNAME_REGEX = /\.([a-z0-9_]+)\.bottle\.(?:(\d+)\.)?tar\.gz$/.freeze HOMEBREW_BOTTLES_EXTNAME_REGEX = /\.([a-z0-9_]+)\.bottle\.(?:(\d+)\.)?tar\.gz$/.freeze
require "env_config" require "env_config"
require "compat/early" unless Homebrew::EnvConfig.no_compat?
require "macos_versions" require "macos_versions"
require "os" require "os"
require "messages" require "messages"
@ -151,5 +150,3 @@ require "utils"
require "official_taps" require "official_taps"
require "tap" require "tap"
require "tap_constants" require "tap_constants"
require "compat/late" unless Homebrew::EnvConfig.no_compat?

View File

@ -206,8 +206,7 @@ module RuboCop
end end
def file_path_allowed? def file_path_allowed?
paths_to_exclude = [%r{/Library/Homebrew/compat/}, paths_to_exclude = [%r{/Library/Homebrew/test/}]
%r{/Library/Homebrew/test/}]
return true if @file_path.nil? # file_path is nil when source is directly passed to the cop, e.g. in specs return true if @file_path.nil? # file_path is nil when source is directly passed to the cop, e.g. in specs
@file_path !~ Regexp.union(paths_to_exclude) @file_path !~ Regexp.union(paths_to_exclude)

View File

@ -118,10 +118,6 @@ RSpec.configure do |config|
config.include(Test::Helper::MkTmpDir) config.include(Test::Helper::MkTmpDir)
config.include(Test::Helper::OutputAsTTY) config.include(Test::Helper::OutputAsTTY)
config.before(:each, :needs_compat) do
skip "Requires the compatibility layer." if ENV["HOMEBREW_NO_COMPAT"]
end
config.before(:each, :needs_linux) do config.before(:each, :needs_linux) do
skip "Not running on Linux." unless OS.linux? skip "Not running on Linux." unless OS.linux?
end end

View File

@ -2090,7 +2090,6 @@ _brew_tests() {
--debug --debug
--generic --generic
--help --help
--no-compat
--online --online
--only --only
--quiet --quiet

View File

@ -1415,7 +1415,6 @@ __fish_brew_complete_arg 'tests' -l coverage -d 'Generate code coverage reports'
__fish_brew_complete_arg 'tests' -l debug -d 'Display any debugging information' __fish_brew_complete_arg 'tests' -l debug -d 'Display any debugging information'
__fish_brew_complete_arg 'tests' -l generic -d 'Run only OS-agnostic tests' __fish_brew_complete_arg 'tests' -l generic -d 'Run only OS-agnostic tests'
__fish_brew_complete_arg 'tests' -l help -d 'Show this message' __fish_brew_complete_arg 'tests' -l help -d 'Show this message'
__fish_brew_complete_arg 'tests' -l no-compat -d 'Do not load the compatibility layer when running tests'
__fish_brew_complete_arg 'tests' -l online -d 'Include tests that use the GitHub API and tests that use any of the taps for official external commands' __fish_brew_complete_arg 'tests' -l online -d 'Include tests that use the GitHub API and tests that use any of the taps for official external commands'
__fish_brew_complete_arg 'tests' -l only -d 'Run only test_script`_spec.rb`. Appending `:`line_number will start at a specific line' __fish_brew_complete_arg 'tests' -l only -d 'Run only test_script`_spec.rb`. Appending `:`line_number will start at a specific line'
__fish_brew_complete_arg 'tests' -l quiet -d 'Make some output more quiet' __fish_brew_complete_arg 'tests' -l quiet -d 'Make some output more quiet'

View File

@ -1728,7 +1728,6 @@ _brew_tests() {
'--debug[Display any debugging information]' \ '--debug[Display any debugging information]' \
'--generic[Run only OS-agnostic tests]' \ '--generic[Run only OS-agnostic tests]' \
'--help[Show this message]' \ '--help[Show this message]' \
'--no-compat[Do not load the compatibility layer when running tests]' \
'--online[Include tests that use the GitHub API and tests that use any of the taps for official external commands]' \ '--online[Include tests that use the GitHub API and tests that use any of the taps for official external commands]' \
'(--changed)--only[Run only test_script`_spec.rb`. Appending `:`line_number will start at a specific line]' \ '(--changed)--only[Run only test_script`_spec.rb`. Appending `:`line_number will start at a specific line]' \
'--quiet[Make some output more quiet]' \ '--quiet[Make some output more quiet]' \

View File

@ -46,7 +46,7 @@ There are many checks that run on every PR. The following is a quick list of the
- `CI / tap syntax`: This runs `brew style` and `brew audit` on all official taps (note that although this runs on Linux, it does check all cask repos). - `CI / tap syntax`: This runs `brew style` and `brew audit` on all official taps (note that although this runs on Linux, it does check all cask repos).
- `CI / docker`: This builds and deploys a new Homebrew Docker image to GitHub Packages and Docker Hub. - `CI / docker`: This builds and deploys a new Homebrew Docker image to GitHub Packages and Docker Hub.
- `CI / test everything (macOS)`: This runs several checks on macOS including `brew tests`, `brew update-tests`, `brew test-bot --only-formulae --test-default-formula`, `brew readall` and `brew doctor`. - `CI / test everything (macOS)`: This runs several checks on macOS including `brew tests`, `brew update-tests`, `brew test-bot --only-formulae --test-default-formula`, `brew readall` and `brew doctor`.
- `CI / tests (no-compatibility mode)`, `CI / tests (generic OS)` and `CI / tests (Linux)`: These run `brew tests` with various options on Linux. - `CI / tests (generic OS)` and `CI / tests (Linux)`: These run `brew tests` with various options on Linux.
- `Documentation CI / linting` and `rubydoc`: These check the prose and formatting of the written documentation, and verify the [rubydoc API documentation](https://rubydoc.brew.sh) can be built without issue. - `Documentation CI / linting` and `rubydoc`: These check the prose and formatting of the written documentation, and verify the [rubydoc API documentation](https://rubydoc.brew.sh) can be built without issue.
_Note that this list is non-exhaustive and can change over time._ _Note that this list is non-exhaustive and can change over time._

View File

@ -1511,8 +1511,6 @@ Run Homebrew's unit and integration tests.
Generate code coverage reports. Generate code coverage reports.
* `--generic`: * `--generic`:
Run only OS-agnostic tests. Run only OS-agnostic tests.
* `--no-compat`:
Do not load the compatibility layer when running tests.
* `--online`: * `--online`:
Include tests that use the GitHub API and tests that use any of the taps for official external commands. Include tests that use the GitHub API and tests that use any of the taps for official external commands.
* `--byebug`: * `--byebug`:
@ -2204,9 +2202,6 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just
*Default:* `$NO_COLOR`. *Default:* `$NO_COLOR`.
- `HOMEBREW_NO_COMPAT`
<br>If set, disable all use of legacy compatibility code.
- `HOMEBREW_NO_EMOJI` - `HOMEBREW_NO_EMOJI`
<br>If set, do not print `HOMEBREW_INSTALL_BADGE` on a successful build. <br>If set, do not print `HOMEBREW_INSTALL_BADGE` on a successful build.

View File

@ -2165,10 +2165,6 @@ Generate code coverage reports\.
Run only OS\-agnostic tests\. Run only OS\-agnostic tests\.
. .
.TP .TP
\fB\-\-no\-compat\fR
Do not load the compatibility layer when running tests\.
.
.TP
\fB\-\-online\fR \fB\-\-online\fR
Include tests that use the GitHub API and tests that use any of the taps for official external commands\. Include tests that use the GitHub API and tests that use any of the taps for official external commands\.
. .
@ -3234,12 +3230,6 @@ If set, do not print text with colour added\.
\fIDefault:\fR \fB$NO_COLOR\fR\. \fIDefault:\fR \fB$NO_COLOR\fR\.
. .
.TP .TP
\fBHOMEBREW_NO_COMPAT\fR
.
.br
If set, disable all use of legacy compatibility code\.
.
.TP
\fBHOMEBREW_NO_EMOJI\fR \fBHOMEBREW_NO_EMOJI\fR
. .
.br .br