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

feat: allow linux binaries in casks #19121

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

SMillerDev
Copy link
Member

@SMillerDev SMillerDev commented Jan 19, 2025

  • 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?

That was actually easier than expected.

TODO:

  • Add --zap support for Linux

@SMillerDev SMillerDev force-pushed the feat/cask/bin_install branch from ddf1c8e to 852e228 Compare January 19, 2025 16:38
@SMillerDev SMillerDev changed the title feat: allow linux blocks in casks feat: allow linux binaries in casks Jan 19, 2025
@SMillerDev
Copy link
Member Author

Okay, as far as I can tell from https://sorbet.org/docs/class-of this should work since NeverSudoSystemCommand is a child of SystemCommand.

I'm also fine removing the types, but that seems counterproductive.

include OnSystem::MacOSOnly
include OnSystem::MacOSAndLinux
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI: I think this is the last reference to OnSystem::MacOSOnly in the codebase so the definition and associated types can probably be removed too.

@Rylan12
Copy link
Member

Rylan12 commented Jan 20, 2025

In order to generate the linux variations in the API, I believe you'll need to update the #each loop in to_hash_with_variations for casks. This line:

MacOSVersion::SYMBOLS.keys.product(OnSystem::ARCH_OPTIONS).each do |os, arch|

should become something like this (copied from the formula equivalent):

OnSystem::ALL_OS_ARCH_COMBINATIONS.each do |os, arch|

This may cause problems until on_linux/on_macos blocks have been added to homebrew/cask since that change would cause API generation task to load every cask as Linux, so this might be something for the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants