Skip to content

Commit

Permalink
Merge pull request #10694 from MikeMcQuaid/bootsnap_dev_tools
Browse files Browse the repository at this point in the history
homebrew_bootsnap: require some developer tools.
  • Loading branch information
Bo98 committed Feb 25, 2021
2 parents ac2c9df + 634efba commit 74f7d2f
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions Library/Homebrew/homebrew_bootsnap.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
# typed: false
# frozen_string_literal: true

if !ENV["HOMEBREW_NO_BOOTSNAP"] &&
ENV["HOMEBREW_BOOTSNAP"] &&
# portable ruby doesn't play nice with bootsnap
!ENV["HOMEBREW_FORCE_VENDOR_RUBY"] &&
(!ENV["HOMEBREW_MACOS_VERSION"] || ENV["HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH"]) &&
# Apple Silicon doesn't play nice with bootsnap
(ENV["HOMEBREW_PROCESSOR"] == "Intel")
homebrew_bootsnap_enabled = !ENV["HOMEBREW_NO_BOOTSNAP"] &&
ENV["HOMEBREW_BOOTSNAP"] &&
# portable ruby doesn't play nice with bootsnap
!ENV["HOMEBREW_FORCE_VENDOR_RUBY"] &&
(!ENV["HOMEBREW_MACOS_VERSION"] || ENV["HOMEBREW_MACOS_SYSTEM_RUBY_NEW_ENOUGH"]) &&
# Apple Silicon doesn't play nice with bootsnap
(ENV["HOMEBREW_PROCESSOR"] == "Intel")

# we need some development tools to build bootsnap native code
development_tools_installed = if !homebrew_bootsnap_enabled
false
elsif RbConfig::CONFIG["host_os"].include? "darwin"
File.directory?("/Applications/Xcode.app") || File.directory?("/Library/Developer/CommandLineTools")
else
File.executable?("/usr/bin/clang") || File.executable?("/usr/bin/gcc")
end

if homebrew_bootsnap_enabled && development_tools_installed
require "rubygems"

begin
Expand Down

0 comments on commit 74f7d2f

Please sign in to comment.