Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove compatibility layer #14985

Merged
merged 1 commit into from Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/tests.yml
Expand Up @@ -255,9 +255,6 @@ jobs:
- name: tests (online)
test-flags: --online --coverage
runs-on: ubuntu-22.04
- name: tests (no-compatibility mode)
test-flags: --no-compat --coverage
runs-on: ubuntu-22.04
- name: tests (generic OS)
test-flags: --generic --coverage
runs-on: ubuntu-22.04
Expand Down
1 change: 0 additions & 1 deletion Library/Homebrew/.simplecov
Expand Up @@ -63,7 +63,6 @@ SimpleCov.start do
add_filter %r{^/constants.rb$}
add_filter %r{^/postinstall.rb$}
add_filter %r{^/test.rb$}
add_filter %r{^/compat/}
add_filter %r{^/dev-cmd/tests.rb$}
add_filter %r{^/test/}
add_filter %r{^/vendor/}
Expand Down
1 change: 0 additions & 1 deletion Library/Homebrew/.yardopts
Expand Up @@ -6,7 +6,6 @@
--template-path yard/templates
--exclude test/
--exclude vendor/
--exclude compat/
extend/os/**/*.rb
**/*.rb
-
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/compat/cask.rb

This file was deleted.

2 changes: 0 additions & 2 deletions Library/Homebrew/compat/early.rb

This file was deleted.

2 changes: 0 additions & 2 deletions Library/Homebrew/compat/formula.rb

This file was deleted.

5 changes: 0 additions & 5 deletions Library/Homebrew/compat/late.rb

This file was deleted.

4 changes: 0 additions & 4 deletions Library/Homebrew/dev-cmd/tests.rb
Expand Up @@ -19,8 +19,6 @@ def tests_args
description: "Generate code coverage reports."
switch "--generic",
description: "Run only OS-agnostic tests."
switch "--no-compat",
description: "Do not load the compatibility layer when running tests."
switch "--online",
description: "Include tests that use the GitHub API and tests that use any of the taps for " \
"official external commands."
Expand Down Expand Up @@ -125,7 +123,6 @@ def tests
end

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}.online" if args.online?
parallel_rspec_log_name = "#{parallel_rspec_log_name}.log"
Expand Down Expand Up @@ -230,7 +227,6 @@ def setup_environment!(args)
ENV["HOMEBREW_TESTS"] = "1"
ENV["HOMEBREW_NO_AUTO_UPDATE"] = "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_ONLINE"] = "1" if args.online?
ENV["HOMEBREW_SORBET_RUNTIME"] = "1"
Expand Down
4 changes: 0 additions & 4 deletions Library/Homebrew/env_config.rb
Expand Up @@ -288,10 +288,6 @@ module EnvConfig
default_text: "`$NO_COLOR`.",
boolean: true,
},
HOMEBREW_NO_COMPAT: {
description: "If set, disable all use of legacy compatibility code.",
boolean: true,
},
HOMEBREW_NO_EMOJI: {
description: "If set, do not print `HOMEBREW_INSTALL_BADGE` on a successful build.",
boolean: true,
Expand Down
3 changes: 0 additions & 3 deletions Library/Homebrew/env_config.rbi
Expand Up @@ -169,9 +169,6 @@ module Homebrew::EnvConfig
sig { returns(T::Boolean) }
def self.no_color?; end

sig { returns(T::Boolean) }
def self.no_compat?; end

sig { returns(T::Boolean) }
def self.no_emoji?; end

Expand Down
1 change: 0 additions & 1 deletion Library/Homebrew/extend/kernel.rb
Expand Up @@ -112,7 +112,6 @@ def odeprecated(method, replacement = nil,

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

Expand Down
3 changes: 0 additions & 3 deletions Library/Homebrew/global.rb
Expand Up @@ -70,7 +70,6 @@
HOMEBREW_BOTTLES_EXTNAME_REGEX = /\.([a-z0-9_]+)\.bottle\.(?:(\d+)\.)?tar\.gz$/.freeze

require "env_config"
require "compat/early" unless Homebrew::EnvConfig.no_compat?
require "macos_versions"
require "os"
require "messages"
Expand Down Expand Up @@ -151,5 +150,3 @@ def auto_update_command?
require "official_taps"
require "tap"
require "tap_constants"

require "compat/late" unless Homebrew::EnvConfig.no_compat?
3 changes: 1 addition & 2 deletions Library/Homebrew/rubocops/extend/formula_cop.rb
Expand Up @@ -206,8 +206,7 @@ def formula_class?(node)
end

def file_path_allowed?
paths_to_exclude = [%r{/Library/Homebrew/compat/},
%r{/Library/Homebrew/test/}]
paths_to_exclude = [%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

@file_path !~ Regexp.union(paths_to_exclude)
Expand Down
4 changes: 0 additions & 4 deletions Library/Homebrew/test/spec_helper.rb
Expand Up @@ -118,10 +118,6 @@
config.include(Test::Helper::MkTmpDir)
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
skip "Not running on Linux." unless OS.linux?
end
Expand Down
1 change: 0 additions & 1 deletion completions/bash/brew
Expand Up @@ -2090,7 +2090,6 @@ _brew_tests() {
--debug
--generic
--help
--no-compat
--online
--only
--quiet
Expand Down
1 change: 0 additions & 1 deletion completions/fish/brew.fish
Expand Up @@ -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 generic -d 'Run only OS-agnostic tests'
__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 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'
Expand Down
1 change: 0 additions & 1 deletion completions/zsh/_brew
Expand Up @@ -1728,7 +1728,6 @@ _brew_tests() {
'--debug[Display any debugging information]' \
'--generic[Run only OS-agnostic tests]' \
'--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]' \
'(--changed)--only[Run only test_script`_spec.rb`. Appending `:`line_number will start at a specific line]' \
'--quiet[Make some output more quiet]' \
Expand Down
2 changes: 1 addition & 1 deletion docs/Homebrew-brew-Maintainer-Guide.md
Expand Up @@ -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 / 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 / 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.

_Note that this list is non-exhaustive and can change over time._
Expand Down
5 changes: 0 additions & 5 deletions docs/Manpage.md
Expand Up @@ -1511,8 +1511,6 @@ Run Homebrew's unit and integration tests.
Generate code coverage reports.
* `--generic`:
Run only OS-agnostic tests.
* `--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.
* `--byebug`:
Expand Down Expand Up @@ -2204,9 +2202,6 @@ example, run `export HOMEBREW_NO_INSECURE_REDIRECT=1` rather than just

*Default:* `$NO_COLOR`.

- `HOMEBREW_NO_COMPAT`
<br>If set, disable all use of legacy compatibility code.

- `HOMEBREW_NO_EMOJI`
<br>If set, do not print `HOMEBREW_INSTALL_BADGE` on a successful build.

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