aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2016-12-20 10:22:30 +0000
committerMike McQuaid2016-12-20 10:22:30 +0000
commitf98304026bcb3bc68b47210f2434e09683987363 (patch)
treefd5075fd3e7a63efbac0455b8891f2e1933bc5de
parent482568579b8c9e699ca19207643cc483975869a4 (diff)
downloadbrew-f98304026bcb3bc68b47210f2434e09683987363.tar.bz2
Deprecate 32-bit options.
These were formerly supported but as it has been a very long time since 32-bit software was necessary on macOS these have been deprecated with a `brew audit` warning and a future `odeprecated`.
-rw-r--r--Library/Homebrew/build_options.rb7
-rw-r--r--Library/Homebrew/compat.rb3
-rw-r--r--Library/Homebrew/compat/ARGV.rb6
-rw-r--r--Library/Homebrew/compat/build_options.rb6
-rw-r--r--Library/Homebrew/compat/tab.rb6
-rw-r--r--Library/Homebrew/dev-cmd/audit.rb7
-rw-r--r--Library/Homebrew/extend/ARGV.rb8
-rw-r--r--Library/Homebrew/software_spec.rb5
-rw-r--r--Library/Homebrew/tab.rb4
9 files changed, 29 insertions, 23 deletions
diff --git a/Library/Homebrew/build_options.rb b/Library/Homebrew/build_options.rb
index 44b6440dc..d9020ecba 100644
--- a/Library/Homebrew/build_options.rb
+++ b/Library/Homebrew/build_options.rb
@@ -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
diff --git a/Library/Homebrew/compat.rb b/Library/Homebrew/compat.rb
index 0b81e037a..5d78c715f 100644
--- a/Library/Homebrew/compat.rb
+++ b/Library/Homebrew/compat.rb
@@ -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"
diff --git a/Library/Homebrew/compat/ARGV.rb b/Library/Homebrew/compat/ARGV.rb
new file mode 100644
index 000000000..23d02ce1a
--- /dev/null
+++ b/Library/Homebrew/compat/ARGV.rb
@@ -0,0 +1,6 @@
+module HomebrewArgvExtension
+ def build_32_bit?
+ # odeprecated "ARGV.build_32_bit?"
+ include? "--32-bit"
+ end
+end
diff --git a/Library/Homebrew/compat/build_options.rb b/Library/Homebrew/compat/build_options.rb
new file mode 100644
index 000000000..52aa9b951
--- /dev/null
+++ b/Library/Homebrew/compat/build_options.rb
@@ -0,0 +1,6 @@
+class BuildOptions
+ def build_32_bit?
+ # odeprecated "build.build_32_bit?"
+ include?("32-bit") && option_defined?("32-bit")
+ end
+end
diff --git a/Library/Homebrew/compat/tab.rb b/Library/Homebrew/compat/tab.rb
new file mode 100644
index 000000000..58fdc4913
--- /dev/null
+++ b/Library/Homebrew/compat/tab.rb
@@ -0,0 +1,6 @@
+class Tab < OpenStruct
+ def build_32_bit?
+ # odeprecated "Tab.build_32_bit?"
+ include?("32-bit")
+ end
+end
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index 0112c524f..5545a3d36 100644
--- a/Library/Homebrew/dev-cmd/audit.rb
+++ b/Library/Homebrew/dev-cmd/audit.rb
@@ -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
diff --git a/Library/Homebrew/extend/ARGV.rb b/Library/Homebrew/extend/ARGV.rb
index 3e4e7f5c7..d361a99a8 100644
--- a/Library/Homebrew/extend/ARGV.rb
+++ b/Library/Homebrew/extend/ARGV.rb
@@ -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?
diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb
index 0c230f643..fb07f6c55 100644
--- a/Library/Homebrew/software_spec.rb
+++ b/Library/Homebrew/software_spec.rb
@@ -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
diff --git a/Library/Homebrew/tab.rb b/Library/Homebrew/tab.rb
index d355e838d..40626bad1 100644
--- a/Library/Homebrew/tab.rb
+++ b/Library/Homebrew/tab.rb
@@ -218,10 +218,6 @@ class Tab < OpenStruct
include?("c++11")
end
- def build_32_bit?
- include?("32-bit")
- end
-
def head?
spec == :head
end