-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ARGV: freeze when using CLI::Parser. #5765
Conversation
7416e1f
to
de830e4
Compare
Not sure if you looked into it yet, but it unfortunately seems like the IRB code that ruby ships with modifies ARGV, which is causing those failures (for example, all the Also, though the most recent version of Ruby added an Not really sure how to handle this. Is there any way to pass IRB its own ARGV? I guess there can be a flag in the *_args methods that we can use to prevent argv from freezing, but that seems like something that should be avoided Edit: Looks like we can stop the ARGV mutation by adding Edit 2: Nevermind, the solution you added is definitely the best bet here |
Otherwise `Homebrew.args` values may not match those of modified `ARGV`.
de830e4
to
cee75b6
Compare
Also, curious: what do you think about overriding the operators that mutate ARGV to delegate to CLI::Parser and update Homebrew.args, instead of freezing ARGV? |
@BenMusch Thanks for the help with |
Sounds good, thanks for the help w/ this PR! |
- hopefully unneeded after Homebrew/brew#5429 (update default `-march`) - this approach is banned after Homebrew/brew#5765 (freeze `ARGV`)
It looks like there are some formulae that mutate ARGV as well: #5770 |
That was done for a 10x faster binary, and not being able to find a better way to set a default bottle arch; I've rebuilt without that code now, and (probably due to #5429) it's no longer significant. |
I'll follow up on a separate issue, but that's not accurate. we're seeing 19x slowdowns on some real workloads with nehalem vs sandybridge |
@fredemmott Suggestion for that issue would be to check the value of the build arch and fail unless a correct value has been passed in. |
@fredemmott but I'm also open to having a way to make formulae depend on a specific CPU architecture (or newer) or CPU features. In general while we're made Homebrew/homebrew-core less generic I'm happy for Homebrew itself to allow things like that to be done in external formulae as long as it's not adding huge amounts of code (and this wouldn't). |
Otherwise
Homebrew.args
values may not match those of modifiedARGV
.CC @BenMusch
brew style
with your changes locally?brew tests
with your changes locally?