Merge pull request #1698 from MikeMcQuaid/deprecate-32-bit

Deprecate 32-bit options.
This commit is contained in:
Mike McQuaid 2016-12-20 10:54:54 +00:00 committed by GitHub
commit 1d2390b2de
9 changed files with 29 additions and 23 deletions

View File

@ -84,13 +84,6 @@ class BuildOptions
include?("c++11") && option_defined?("c++11")
end
# True if a {Formula} is being built in 32-bit/x86 mode.
# This is needed for some use-cases though we prefer to build Universal
# when a 32-bit version is needed.
def build_32_bit?
include?("32-bit") && option_defined?("32-bit")
end
# @private
def used_options
@options & @args

View File

@ -19,3 +19,6 @@ require "compat/xcode"
require "compat/software_spec"
require "compat/utils"
require "compat/json"
require "compat/ARGV"
require "compat/build_options"
require "compat/tab"

View File

@ -0,0 +1,6 @@
module HomebrewArgvExtension
def build_32_bit?
# odeprecated "ARGV.build_32_bit?"
include? "--32-bit"
end
end

View File

@ -0,0 +1,6 @@
class BuildOptions
def build_32_bit?
# odeprecated "build.build_32_bit?"
include?("32-bit") && option_defined?("32-bit")
end
end

View File

@ -0,0 +1,6 @@
class Tab < OpenStruct
def build_32_bit?
# odeprecated "Tab.build_32_bit?"
include?("32-bit")
end
end

View File

@ -448,8 +448,13 @@ class FormulaAuditor
def audit_options
formula.options.each do |o|
if o.name != "32-bit"
problem "macOS has been 64-bit only since 10.6 so 32-bit options are deprecated."
end
next unless @strict
if o.name !~ /with(out)?-/ && o.name != "c++11" && o.name != "universal" && o.name != "32-bit"
if o.name !~ /with(out)?-/ && o.name != "c++11" && o.name != "universal"
problem "Options should begin with with/without. Migrate '--#{o.name}' with `deprecated_option`."
end

View File

@ -229,13 +229,6 @@ module HomebrewArgvExtension
include? "--universal"
end
# Request a 32-bit only build.
# This is needed for some use-cases though we prefer to build Universal
# when a 32-bit version is needed.
def build_32_bit?
include? "--32-bit"
end
def build_bottle?
include?("--build-bottle") || !ENV["HOMEBREW_BUILD_BOTTLE"].nil?
end
@ -294,7 +287,6 @@ module HomebrewArgvExtension
build_flags << "--HEAD" if build_head?
build_flags << "--universal" if build_universal?
build_flags << "--32-bit" if build_32_bit?
build_flags << "--build-bottle" if build_bottle?
build_flags << "--build-from-source" if build_from_source?

View File

@ -13,9 +13,8 @@ class SoftwareSpec
extend Forwardable
PREDEFINED_OPTIONS = {
:universal => Option.new("universal", "Build a universal binary"),
:cxx11 => Option.new("c++11", "Build using C++11 mode"),
"32-bit" => Option.new("32-bit", "Build 32-bit only"),
universal: Option.new("universal", "Build a universal binary"),
cxx11: Option.new("c++11", "Build using C++11 mode"),
}.freeze
attr_reader :name, :full_name, :owner

View File

@ -218,10 +218,6 @@ class Tab < OpenStruct
include?("c++11")
end
def build_32_bit?
include?("32-bit")
end
def head?
spec == :head
end