As far as I can tell these methods have only ever been used in the test
suite.
Since Formula includes FileUtils, it is generally simpler (and in the
case of cp, more readable) to use the FileUtils methods directly.
ClosesHomebrew/homebrew#30081.
Ruby 2.2 will define Pathname#/ as a simple alias of Pathname#+.
In practice, this means that it will raise a TypeError unless the
argument responds to to_path or to_str.
Currently we blindly convert the argument to a string using to_s, so
deprecate this in the interest of matching the upstream behavior. In the
future we can replace this with
alias_method :/, :+ unless method_defined?(:/)
ClosesHomebrew/homebrew#30079.
Pathname#inspect on Ruby 2.0 throws away the encoding of the object's
underlying string and returns a string tagged as ASCII-8BIT.
If you simply write
puts Pathname.new("some string with non-ascii bytes").inspect
no error will be raised, because the implementation of Pathname#inspect
does not call into Object#inspect.
However, if you wrap that pathname object in an array first, then
puts [Pathname.new("some string with non-ascii bytes")].inspect
will raise Encoding::CompatibilityError: "inspected result must be ASCII
only or use the same encoding with default external".
Raising an error in this codepath is new in Ruby 2.0, and this specific
bug is fixed in Ruby 2.1. I've opened a bug upstream:
https://bugs.ruby-lang.org/issues/9915FixesHomebrew/homebrew#29947.
I found the dual use of CMAKE_*_PATH variables to make it difficult to
reason about this code. Now a separate set of variables are used to
communicate with the cc wrapper, and less work is performed in the
wrapper itself.
We no longer pass the SDK include path as a -isystem directory on
Xcode-only setups. Doing so is redundant with `--sysroot` and has other
side effects, namely changing the include path search order, which can
break compilation of some software (e.g. qemu).
On Xcode-only 10.9, we can additionally omit `--sysroot`, as the correct
paths are built into the tools.
A new variable, HOMEBREW_SYSROOT, is used to this information to the
wrapper. It will be unset on Xcode-only 10.9. HOMEBREW_SDKROOT will
continue to be set, as it is used for other things besides setting the
include search path.
Avoid throwing unnecessary exceptions by checking for paths existing and
creating formulae as late as possible. Additionally use instance
variables for some caching.
Without it, String#undent would fail on unindented strings, e.g.:
"foo".undent
NoMethodError: undefined method `length' for nil:NilClass`
ClosesHomebrew/homebrew#28873.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>