-
-
Notifications
You must be signed in to change notification settings - Fork 10k
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 cleanup: Deprecate ARGV methods that are never used internally #5762
Conversation
cc_arg = "--cc=clang" | ||
ARGV << cc_arg | ||
expect(Homebrew.args.cc).to be nil | ||
allow(Homebrew.args).to receive(:cc).and_return("clang") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wanna make sure: This is a valid replacement in tests for adding values to ARGV
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep 👍
@@ -47,7 +48,7 @@ | |||
end | |||
|
|||
it "ignores bogus Python error" do | |||
ENV["HOMEBREW_VERBOSE"] = "1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here: Wanna make sure it's okay to replace env var values with Homebrew.args stubs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep 👍
Not really sure I follow why tests are failing ( |
Good catch! The following will likely need updates: |
Also https://github.com/Homebrew/homebrew-livecheck Perhaps we could deprecate these old methods to give downstream taps a chance to notice the changes (see #5477 for an example). Then we could merge this without being blocked or breaking homebrew commands in external taps. |
This seems like a good call 👍 . For those that we notice have been used anywhere outside Homebrew/brew an |
Looks like the deprecations are still failing the build -- should I be doing this differently? https://dev.azure.com/Homebrew/Homebrew/_build/results?buildId=4180 |
The issue is in https://github.com/Homebrew/homebrew-test-bot/, not your pull request. I believe you'll have to do the pull request in several parts: first to add the new API, then a pull request to test-bot to use the new API, then the deprecations in a final pull request to deprecate the old API. Probably a pull request to homebrew-core fixing all uses of the old API should be in there somewhere as well. Longer term we should probably look at moving the homebrew/test-bot code into homebrew/brew. |
Actually it looks like you're not adding any new APIs here, just deprecating old ones. So a pull request to homebrew-test-bot fixing its calls should be sufficient. |
Ah thanks @jonchang! Didn't see the line about throwing an error when |
ed0eeb8
to
e7a997e
Compare
@BenMusch Some failing tests but not |
Cross-posting from Homebrew/homebrew-test-bot#240:
|
@MikeMcQuaid should we also find a way to prevent modification of |
@BenMusch Good question. I don't believe there are (m)any cases where |
Sounds good. Just posting this as a heads up: probably won't be able to make progress on the PR for a week or so due to some schoolwork that's come up. But definitely intend on getting back to it once I'm free |
No worries, thanks @BenMusch! |
Just a heads up: Busier with schoolwork than I thought so it might not be a while until I pick this up again. Will check-in periodically to keep the PR up-to-date with |
@BenMusch Would you be able to extract the minimal version that still passes tests (perhaps into a new PR)? Thanks! |
@MikeMcQuaid Definitely, would a minimal version of this be: not deprecating existing methods, and only changing the |
that sounds good to me |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
brew style
with your changes locally?brew tests
with your changes locally?Addresses part of #5730
This PR deletes
ARGV
methods which are never used internally inARGV
(for example, it keepsbuild_head?
because it is used inbuild_stable?
, and refactoring methods which have internal usage is a bit more complex of a question in terms of how it is refactored. Will definitely look into cleaning that up later, but wanted to open this PR for all the work which could be done without too much thought