Module: Homebrew::Pkgconf Private

Defined in:
extend/os/mac/pkgconf.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.

Class Method Summary collapse

Class Method Details

.macos_sdk_mismatchArray<(String, String)>?

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:



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'extend/os/mac/pkgconf.rb', line 9

def macos_sdk_mismatch
  # We don't provide suitable bottles for these versions.
  return if OS::Mac.version.prerelease? || OS::Mac.version.outdated_release?

  pkgconf = begin
    ::Formula["pkgconf"]
  rescue FormulaUnavailableError
    nil
  end
  return unless pkgconf&.any_version_installed?

  tab = Tab.for_formula(pkgconf)
  return unless tab.built_on

  built_on_version = tab.built_on["os_version"]
                        &.delete_prefix("macOS ")
                        &.sub(/\.\d+$/, "")
  return unless built_on_version

  current_version = MacOS.version.to_s
  return if built_on_version == current_version

  [built_on_version, current_version]
end

.mismatch_warning_message(mismatch) ⇒ String

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.

Parameters:

Returns:



35
36
37
38
39
40
41
42
43
44
45
46
# File 'extend/os/mac/pkgconf.rb', line 35

def mismatch_warning_message(mismatch)
  <<~EOS
    You have pkgconf installed that was built on macOS #{mismatch[0]},
             but you are running macOS #{mismatch[1]}.

    This can cause issues with packages that depend on system libraries, such as libffi.
    To fix this issue, reinstall pkgconf:
      brew reinstall pkgconf

    For more information, see: https://github.com/Homebrew/brew/issues/16137
  EOS
end