Closed fxcoudert closed 12 months ago
lua
has an error for ENV.cflags
, which seems to be shared with other formulas:
c/cabocha.rb: s.change_make_var! "CFLAGS", ENV.cflags
c/cabocha.rb: s.change_make_var! "CXXFLAGS", ENV.cflags
c/calc.rb: ENV["EXTRA_CFLAGS"] = ENV.cflags
d/dnsmasq.rb: s.change_make_var! "CFLAGS", ENV.cflags
g/glade.rb: flags = (ENV.cflags || "").split + (ENV.cppflags || "").split + (ENV.ldflags || "").split
g/gmime.rb: flags = (ENV.cflags || "").split + (ENV.cppflags || "").split + (ENV.ldflags || "").split
g/gnome-autoar.rb: flags = (ENV.cflags || "").split + (ENV.cppflags || "").split + (ENV.ldflags || "").split
j/jsonrpc-glib.rb: flags = (ENV.cflags || "").split + (ENV.cppflags || "").split + (ENV.ldflags || "").split
l/llvm.rb: cflags = ENV.cflags&.split || []
l/lua.rb: s.change_make_var! "MYCFLAGS", ENV.cflags
lib/libdazzle.rb: flags = (ENV.cflags || "").split + (ENV.cppflags || "").split + (ENV.ldflags || "").split
lib/libgedit-amtk.rb: flags = (ENV.cflags || "").split + (ENV.cppflags || "").split + (ENV.ldflags || "").split
o/openssl@1.1.rb: args += (ENV.cflags || "").split
o/openssl@3.0.rb: args += (ENV.cflags || "").split
o/openssl@3.rb: args += (ENV.cflags || "").split
q/quictls.rb: args += (ENV.cflags || "").split
t/template-glib.rb: flags = (ENV.cflags || "").split + (ENV.cppflags || "").split + (ENV.ldflags || "").split
t/tepl.rb: flags = (ENV.cflags || "").split + (ENV.cppflags || "").split + (ENV.ldflags || "").split
If we decide that updating the related type signatures to allow for more types that can be cast to a String
is fine, https://github.com/Homebrew/brew/pull/16002 will address the xcodebuild
/Hardware::CPU.arch
type errors without requiring changes to formulae. If we instead decide that it's preferable to maintain the existing type signatures and manually cast the values as strings (e.g., using #to_s
), then I can help with updating related formulae.
Past that, I've addressed usage of ENV.cflags
/ENV.ldflags
in formulae where a nil
value wasn't handled, so those shouldn't produce type errors now. Most of the instances above already use || ""
to fall back to an empty string, so they were fine. [Some others use a combination of #to_s
and #split
when an array is expected.]
The one exception above is calc
but it follows a slightly different pattern and built fine for me on Sonoma (ARM64) without adding || ""
.
I think this is fixed now
There are type errors with
Hardware::CPU.arch
which tends to be used as a string in formulas:Now this gives errors like this: