Module: OS::Linux::Glibc Private

Extended by:
T::Sig
Defined in:
os/linux/glibc.rb

Overview

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.

Helper functions for querying glibc information.

Class Method Summary collapse

Class Method Details

.below_minimum_version?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)


41
42
43
# File 'os/linux/glibc.rb', line 41

def below_minimum_version?
  system_version < minimum_version
end

.minimum_versionVersion

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:



37
38
39
# File 'os/linux/glibc.rb', line 37

def minimum_version
  Version.new(ENV.fetch("HOMEBREW_LINUX_MINIMUM_GLIBC_VERSION"))
end

.system_versionObject

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.



14
15
16
17
18
19
20
21
22
23
# File 'os/linux/glibc.rb', line 14

def system_version
  @system_version ||= begin
    version = Utils.popen_read("/usr/bin/ldd", "--version")[/ (\d+\.\d+)/, 1]
    if version
      Version.new version
    else
      Version::NULL
    end
  end
end

.versionObject

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.



25
26
27
28
29
30
31
32
33
34
# File 'os/linux/glibc.rb', line 25

def version
  @version ||= begin
    version = Utils.popen_read(HOMEBREW_PREFIX/"opt/glibc/bin/ldd", "--version")[/ (\d+\.\d+)/, 1]
    if version
      Version.new version
    else
      system_version
    end
  end
end