-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
audit: Check if uses_from_macos
usage is correct
#7280
Conversation
c0c4ae6
to
f53ca5f
Compare
OK, via abusing
leads to:
Now to work out how to handle the hash elements... 🤔 |
9622fa4
to
e884a19
Compare
With the current code, I get |
Yeh, sounds about right. You can use Once tests are 💚 (or if you need help getting them there): give me a shout and I'll review! |
The strict vs. non-strict cop was discussed in the original review and it was decided to make it a strict cop because of reliability concerns. But that was back in July 2019, and |
👍. I'm confident this approach will be sufficiently robust. |
The one remaining style failure is:
After I've figured out how to fix this, I'll squash the commits and this'll be ready for review. The results when running |
👍 |
- This builds on @jonchang's work that started in Homebrew#6265. - We now use `uses_from_macos` to declare dependencies that are implicit on macOS because they ship with macOS, but they're needed on Linux. We have to be sure that the dependencies people specify as `uses_from_macos` are actually shipped with macOS. So, we maintain a safelist of those dependencies and check against it. - Also add more legitimate `uses_from_macos` dependencies to the list. - This is runnable with `brew audit --only-cops=FormulaAudit/UsesFromMacos`. - It produces different number of failures on macOS vs. Linux, because apparently we've not synced Homebrew/linuxbrew-core upstream thoroughly enough yet. - Originally this was designed as a `--strict` audit, but we flipped it to be a normal audit because - to quote Mike - this is "sufficiently robust" now.
8a92c61
to
857393c
Compare
@MikeMcQuaid and anyone else: I squashed the commits, CI is 💚and this is ready for review, please! |
Thanks again @issyl0, great work! |
brew style
with your changes locally?brew tests
with your changes locally?uses_from_macos
usage is legit, so we check against a safelist of dependencies that we know to ship with macOS.