diff --git a/Library/Homebrew/os.rb b/Library/Homebrew/os.rb index da59954324..97f849c131 100644 --- a/Library/Homebrew/os.rb +++ b/Library/Homebrew/os.rb @@ -55,6 +55,7 @@ module OS LINUX_PREFERRED_GCC_COMPILER_FORMULA = "gcc@11" # https://packages.ubuntu.com/jammy/gcc LINUX_PREFERRED_GCC_RUNTIME_FORMULA = "gcc" + require "os/generic" if OS.mac? require "os/mac" # Don't tell people to report issues on unsupported configurations. diff --git a/Library/Homebrew/os/generic.rb b/Library/Homebrew/os/generic.rb new file mode 100644 index 0000000000..516c74764b --- /dev/null +++ b/Library/Homebrew/os/generic.rb @@ -0,0 +1,8 @@ +# typed: strict +# frozen_string_literal: true + +module OS + module Mac + ::MacOS = OS::Mac + end +end diff --git a/Library/Homebrew/os/linux.rb b/Library/Homebrew/os/linux.rb index 2b5df8cfc3..a48836ded1 100644 --- a/Library/Homebrew/os/linux.rb +++ b/Library/Homebrew/os/linux.rb @@ -54,8 +54,6 @@ module OS module Mac module_function - ::MacOS = OS::Mac - raise "Loaded OS::Linux on generic OS!" if ENV["HOMEBREW_TEST_GENERIC_OS"] def version diff --git a/Library/Homebrew/os/mac.rb b/Library/Homebrew/os/mac.rb index b52a965130..f8e0f3bba7 100644 --- a/Library/Homebrew/os/mac.rb +++ b/Library/Homebrew/os/mac.rb @@ -13,8 +13,6 @@ module OS module_function - ::MacOS = OS::Mac - raise "Loaded OS::Mac on generic OS!" if ENV["HOMEBREW_TEST_GENERIC_OS"] VERSION = ENV.fetch("HOMEBREW_MACOS_VERSION").chomp.freeze