Module: OS Private

Defined in:
extend/os/mac/cleaner.rb,
extend/os/mac/keg.rb,
extend/os/mac/cleanup.rb,
extend/os/mac/formula.rb,
extend/os/mac/readall.rb,
extend/os/linux/cleanup.rb,
extend/os/linux/formula.rb,
extend/os/mac/diagnostic.rb,
extend/os/linux/cli/parser.rb,
extend/os/linux/diagnostic.rb,
extend/os/mac/hardware/cpu.rb,
extend/os/mac/keg_relocate.rb,
extend/os/mac/utils/socket.rb,
extend/os/mac/system_config.rb,
extend/os/mac/dev-cmd/bottle.rb,
extend/os/mac/linkage_checker.rb,
extend/os/mac/simulate_system.rb,
extend/os/linux/simulate_system.rb,
extend/os/mac/development_tools.rb,
extend/os/mac/formula_installer.rb,
extend/os/linux/development_tools.rb,
extend/os/mac/dependency_collector.rb,
extend/os/linux/dependency_collector.rb,
os.rb,
os/mac.rb,
os/linux.rb,
cask/macos.rb,
os/mac/sdk.rb,
os/linux/ld.rb,
os/linux/elf.rb,
os/mac/xcode.rb,
os/linux/glibc.rb,
os/linux/kernel.rb

This module is part of a private API. This module may only be used in the Homebrew/brew repository. Third parties should avoid using this module if possible, as it may be removed or changed without warning.

Defined Under Namespace

Modules: Linux, Mac

Constant Summary collapse

LINUX_CI_OS_VERSION =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

See Linux-CI.md

"Ubuntu 22.04"
LINUX_GLIBC_CI_VERSION =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

"2.35"
LINUX_GLIBC_NEXT_CI_VERSION =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

"2.35"
LINUX_GCC_CI_VERSION =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

"11.0"
LINUX_PREFERRED_GCC_COMPILER_FORMULA =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

https://packages.ubuntu.com/jammy/gcc

"gcc@11"
LINUX_PREFERRED_GCC_RUNTIME_FORMULA =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

"gcc"
ISSUES_URL =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

"https://docs.brew.sh/Troubleshooting"
PATH_OPEN =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

if OS::Linux.wsl? && (wslview = which("wslview").presence)
  wslview.to_s
else
  "xdg-open"
end.freeze

Class Method Summary collapse

Class Method Details

.kernel_nameString

Get the kernel name.

Returns:



41
42
43
44
# File 'os.rb', line 41

def self.kernel_name
  require "etc"
  @kernel_name ||= T.let(Etc.uname.fetch(:sysname), T.nilable(String))
end

.kernel_versionVersion

Get the kernel version.

Returns:



32
33
34
35
# File 'os.rb', line 32

def self.kernel_version
  require "etc"
  @kernel_version ||= T.let(Version.new(Etc.uname.fetch(:release)), T.nilable(Version))
end

.linux?Boolean

Check whether the operating system is Linux.

Returns:

  • (Boolean)


22
23
24
25
26
# File 'os.rb', line 22

def self.linux?
  return false if ENV["HOMEBREW_TEST_GENERIC_OS"]

  RbConfig::CONFIG["host_os"].include? "linux"
end

.mac?Boolean

Check whether the operating system is macOS.

Returns:

  • (Boolean)


12
13
14
15
16
# File 'os.rb', line 12

def self.mac?
  return false if ENV["HOMEBREW_TEST_GENERIC_OS"]

  RbConfig::CONFIG["host_os"].include? "darwin"
end

.unsupported_configuration?Boolean

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Returns:

  • (Boolean)


79
80
81
# File 'os.rb', line 79

def self.unsupported_configuration?
  !defined?(OS::ISSUES_URL)
end