 b01e0abcf8
			
		
	
	
		b01e0abcf8
		
			
		
	
	
	
	
		
			
			- Change `LINUX_CI_OS_VERSION` from `Ubuntu 16.04` to `Ubuntu 22.04` - Change `LINUX_GLIBC_CI_VERSION` from `2.23` to `2.35` - Change `LINUX_GCC_CI_VERSION` from `5.0` to `11.0` - Change `LINUX_PREFERRED_GCC_FORMULA` from `gcc@5` to `gcc@11` - Build the Docker image `ghcr.io/homebrew/ubuntu22.04:master`
		
			
				
	
	
		
			72 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Ruby
		
	
	
	
	
	
			
		
		
	
	
			72 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Ruby
		
	
	
	
	
	
| # typed: true
 | |
| # frozen_string_literal: true
 | |
| 
 | |
| # Helper functions for querying operating system information.
 | |
| #
 | |
| # @api private
 | |
| module OS
 | |
|   extend T::Sig
 | |
| 
 | |
|   # Check if the operating system is macOS.
 | |
|   #
 | |
|   # @api public
 | |
|   sig { returns(T::Boolean) }
 | |
|   def self.mac?
 | |
|     return false if ENV["HOMEBREW_TEST_GENERIC_OS"]
 | |
| 
 | |
|     RbConfig::CONFIG["host_os"].include? "darwin"
 | |
|   end
 | |
| 
 | |
|   # Check if the operating system is Linux.
 | |
|   #
 | |
|   # @api public
 | |
|   sig { returns(T::Boolean) }
 | |
|   def self.linux?
 | |
|     return false if ENV["HOMEBREW_TEST_GENERIC_OS"]
 | |
| 
 | |
|     RbConfig::CONFIG["host_os"].include? "linux"
 | |
|   end
 | |
| 
 | |
|   # Get the kernel version.
 | |
|   #
 | |
|   # @api public
 | |
|   sig { returns(Version) }
 | |
|   def self.kernel_version
 | |
|     @kernel_version ||= Version.new(Utils.safe_popen_read("uname", "-r").chomp)
 | |
|   end
 | |
| 
 | |
|   # Get the kernel name.
 | |
|   #
 | |
|   # @api public
 | |
|   sig { returns(String) }
 | |
|   def self.kernel_name
 | |
|     @kernel_name ||= Utils.safe_popen_read("uname", "-s").chomp
 | |
|   end
 | |
| 
 | |
|   ::OS_VERSION = ENV.fetch("HOMEBREW_OS_VERSION").freeze
 | |
| 
 | |
|   # See Linux-CI.md
 | |
|   LINUX_CI_OS_VERSION = "Ubuntu 22.04"
 | |
|   LINUX_GLIBC_CI_VERSION = "2.35"
 | |
|   LINUX_GLIBC_NEXT_CI_VERSION = "2.35"
 | |
|   LINUX_GCC_CI_VERSION = "11.0"
 | |
|   LINUX_PREFERRED_GCC_FORMULA = "gcc@11"
 | |
| 
 | |
|   if OS.mac?
 | |
|     require "os/mac"
 | |
|     # Don't tell people to report issues on unsupported configurations.
 | |
|     if !OS::Mac.version.prerelease? &&
 | |
|        !OS::Mac.version.outdated_release? &&
 | |
|        ARGV.none? { |v| v.start_with?("--cc=") } &&
 | |
|        (HOMEBREW_PREFIX == HOMEBREW_DEFAULT_PREFIX ||
 | |
|        (HOMEBREW_PREFIX == HOMEBREW_MACOS_ARM_DEFAULT_PREFIX && Hardware::CPU.arm?))
 | |
|       ISSUES_URL = "https://docs.brew.sh/Troubleshooting"
 | |
|     end
 | |
|     PATH_OPEN = "/usr/bin/open"
 | |
|   elsif OS.linux?
 | |
|     require "os/linux"
 | |
|     ISSUES_URL = "https://docs.brew.sh/Troubleshooting"
 | |
|     PATH_OPEN = "xdg-open"
 | |
|   end
 | |
| end
 |