Skip to content

Allow deps auditing to run on Linux via HOMEBREW_SIMULATE_MACOS_ON_LINUX#10767

Merged
Bo98 merged 5 commits intoHomebrew:masterfrom
Bo98:audit_deps-force_homebrew_on_linux
Mar 5, 2021
Merged

Allow deps auditing to run on Linux via HOMEBREW_SIMULATE_MACOS_ON_LINUX#10767
Bo98 merged 5 commits intoHomebrew:masterfrom
Bo98:audit_deps-force_homebrew_on_linux

Conversation

@Bo98
Copy link
Copy Markdown
Member

@Bo98 Bo98 commented Mar 3, 2021

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

brew audit currently fails on macOS because audit_deps is not run on Linux and all auditing on homebrew-core is done on Linux.

This attempts to prevent that happening again by allowing the audit to run under HOMEBREW_FORCE_HOMEBREW_ON_LINUX.

This PR reverts 9336254 which removed the conditional. This PR also restores a867e78 for uses_for_macos handling, with a fix for it not working due to the :since handling. In addition, I've added handling of on_os blocks.

To ensure this works, I've added a step to the Linux CI.

See: Homebrew/homebrew-core#70826 (comment)

@BrewTestBot
Copy link
Copy Markdown
Contributor

Review period will end on 2021-03-04 at 00:47:12 UTC.

@BrewTestBot BrewTestBot added the waiting for feedback Merging is blocked until sufficient time has passed for review label Mar 3, 2021
@Bo98 Bo98 force-pushed the audit_deps-force_homebrew_on_linux branch from b7bb4dc to 156de0c Compare March 3, 2021 01:13
@Bo98
Copy link
Copy Markdown
Member Author

Bo98 commented Mar 3, 2021

If I'm not here: pr-publish/automerge Homebrew/homebrew-core#72357 to fix the audit that's currently failing.

@MikeMcQuaid
Copy link
Copy Markdown
Member

brew audit currently fails on macOS because audit_deps is not run on Linux and all auditing on homebrew-core is done on Linux.

To be exact: the tap-wide auditing is done only on macOS but individual brew audit of modified formulae is still done on macOS.

Can you remove this auditing from the test everything (macOS) job if it's no longer reliable/needed?

@Bo98
Copy link
Copy Markdown
Member Author

Bo98 commented Mar 3, 2021

individual brew audit of modified formulae is still done on macOS.

Yes, indeed - I made that statement too broad.

audit_deps only reliably works on tap-wide auditing, since formulae not directly modified by the PR can be affected. The Qt6 PR is an example or this.

Can you remove this auditing from the test everything (macOS) job if it's no longer reliable/needed?

It is reliable, but the behaviour on Linux should now match macOS so I suppose I can remove it as unneeded.

@Bo98
Copy link
Copy Markdown
Member Author

Bo98 commented Mar 3, 2021

the behaviour on Linux should now match macOS so I suppose I can remove it as unneeded.

Actually, Cask auditing is not included in Linux CI so maybe shouldn't remove this yet.

@MikeMcQuaid
Copy link
Copy Markdown
Member

audit_deps only reliably works on tap-wide auditing, since formulae not directly modified by the PR can be affected. The Qt6 PR is an example or this.

Gotcha 👍🏻

Actually, Cask auditing is not included in Linux CI so maybe shouldn't remove this yet.

Could it be limited to just do cask tap auditing in this case?

@Bo98
Copy link
Copy Markdown
Member Author

Bo98 commented Mar 3, 2021

I think HOMEBREW_FORCE_HOMEBREW_ON_LINUX is getting too broad. We're using it a bit to emulate macOS logic on Linux, but we're also using it on Linux as a part of migrating to homebrew-core.

We should probably separate this and introduce a HOMEBREW_SIMULATE_MACOS_ON_LINUX or something.

@MikeMcQuaid
Copy link
Copy Markdown
Member

We should probably separate this and introduce a HOMEBREW_SIMULATE_MACOS_ON_LINUX or something.

Works for me.

I think HOMEBREW_FORCE_HOMEBREW_ON_LINUX is getting too broad. We're using it a bit to emulate macOS logic on Linux, but we're also using it on Linux as a part of migrating to homebrew-core.

The original intent was pretty much just to use homebrew-core on Linuxbrew.

@Bo98 Bo98 force-pushed the audit_deps-force_homebrew_on_linux branch from c2229f0 to aafd3aa Compare March 3, 2021 16:14
@Bo98 Bo98 changed the title Allow deps auditing to run on Linux via HOMEBREW_FORCE_HOMEBREW_ON_LINUX Allow deps auditing to run on Linux via HOMEBREW_SIMULATE_MACOS_ON_LINUX Mar 3, 2021
@Bo98 Bo98 force-pushed the audit_deps-force_homebrew_on_linux branch from aafd3aa to 03a56e5 Compare March 3, 2021 18:10
@BrewTestBot
Copy link
Copy Markdown
Contributor

Review period ended.

@BrewTestBot BrewTestBot removed the waiting for feedback Merging is blocked until sufficient time has passed for review label Mar 4, 2021
Copy link
Copy Markdown
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I wonder if any other HOMEBREW_FORCE_HOMEBREW_ON_LINUX uses warrant replacing with the new variable?

@Bo98 Bo98 force-pushed the audit_deps-force_homebrew_on_linux branch from 03a56e5 to 4091fdb Compare March 4, 2021 16:40
@Bo98
Copy link
Copy Markdown
Member Author

Bo98 commented Mar 4, 2021

I think the other references are fine as far as I can tell.

Copy link
Copy Markdown
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! One question, non-blocking, feel free to merge without if desired.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any situation where you'd want just HOMEBREW_SIMULATE_MACOS_ON_LINUX and not HOMEBREW_FORCE_HOMEBREW_ON_LINUX? If not, could we make HOMEBREW_SIMULATE_MACOS_ON_LINUX automatically set/imply HOMEBREW_FORCE_HOMEBREW_ON_LINUX?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any situation where you'd want just HOMEBREW_SIMULATE_MACOS_ON_LINUX and not HOMEBREW_FORCE_HOMEBREW_ON_LINUX?

Probably not - or at least not for any of our use cases. In theory, HOMEBREW_SIMULATE_MACOS_ON_LINUX should work on linuxbrew-core and pass brew audit without issue - but that's not something we particularly care about.

make HOMEBREW_SIMULATE_MACOS_ON_LINUX automatically set/imply HOMEBREW_FORCE_HOMEBREW_ON_LINUX?

Yeah that makes sense.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that makes sense.

👍🏻 cool, let's do/document that then.

@Bo98 Bo98 force-pushed the audit_deps-force_homebrew_on_linux branch from c197986 to 5660a1b Compare March 5, 2021 12:22
@Bo98 Bo98 merged commit 344ab02 into Homebrew:master Mar 5, 2021
@Bo98 Bo98 deleted the audit_deps-force_homebrew_on_linux branch March 5, 2021 23:46
@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Apr 5, 2021
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Apr 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated PR was locked due to age

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants