Skip to content
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

Extend SimulateSystem to MacOS.version #15985

Closed
1 task done
apainintheneck opened this issue Sep 9, 2023 · 3 comments
Closed
1 task done

Extend SimulateSystem to MacOS.version #15985

apainintheneck opened this issue Sep 9, 2023 · 3 comments
Labels
cask Homebrew Cask enhancement outdated PR was locked due to age stale No recent activity

Comments

@apainintheneck
Copy link
Contributor

Verification

Provide a detailed description of the proposed feature

Currently, we use SimulateSystem in a few places to allow us to evaluate on_system blocks without having to change physical machines. This would extend that to allow us to simulate the system version. The difficult thing would be adding this in in such a way that it doesn't break current installs/builds when people are simulating things (using environment variables for instance).

What is the motivation for the feature?

This is needed to easily and accurately evaluate if a cask/formula runs on a specific OS. We could use this information to exclude unsupported OS versions from audits and the like.

Recent discussion in:

How will the feature be relevant to at least 90% of Homebrew users?

It would potentially reduce CI time somewhat since audits take less time and some command output would be more relevant since it could skip over unsupported casks/formulae. I haven't looked at CI though so I'm not sure if it will be relevant there.

What alternatives to the feature have been considered?

Option 1

We could mandate not defining depends_on macos: inside on_system blocks and only define them in the base level of the cask. This would require a new linter rule but then we wouldn't need to simulate anything to get the macOS version requirement for a cask.

For example, Homebrew/homebrew-cask#154556 changed some PRs to use the version array syntax which while being slightly more verbose ends up allowing us to tell the supported OS versions without simulating anything.

depends_on macos: [
  :catalina,
  :big_sur,
]

Option 2

We could rewrite the on_system DSL to automatically update a global MacOSRequirement for each on_system stanza. This would be a bit magical though and would require changing a large number of casks along with adding new linter rules but would just work without forcing people to think about where to put the depends_on macos: rules.

@apainintheneck
Copy link
Contributor Author

Does anyone know if this is also relevant on the formula side?

@MikeMcQuaid
Copy link
Member

Thanks for the write-up @apainintheneck! I agree this is needed.

My preference would be Option 2. I don't really like the DSL usage on Homebrew/homebrew-cask#154556

Does anyone know if this is also relevant on the formula side?

@apainintheneck Unsure but I wouldn't be surprised either way. Sorry I'm not more help 😁.

@github-actions
Copy link

github-actions bot commented Oct 3, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale No recent activity label Oct 3, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 11, 2023
@github-actions github-actions bot added the outdated PR was locked due to age label Nov 10, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cask Homebrew Cask enhancement outdated PR was locked due to age stale No recent activity
Projects
None yet
Development

No branches or pull requests

2 participants