Skip to content

Conversation

@MikeMcQuaid
Copy link
Member

  • Avoid requiring --cask and implicitly adding --formula on Linux
  • Fix some hardcoded system utility paths and system groups that don't apply on Linux

Fixes #20916

@MikeMcQuaid MikeMcQuaid force-pushed the linux_cask_handling branch 2 times, most recently from f4770b6 to 95e991f Compare October 23, 2025 10:03
@MikeMcQuaid MikeMcQuaid marked this pull request as ready for review October 23, 2025 10:28
Copilot AI review requested due to automatic review settings October 23, 2025 10:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves cask handling on Linux by removing platform-specific command-line parsing behavior and fixing hardcoded system utility paths. The changes ensure casks work more naturally on Linux without requiring special flags and make system commands portable across platforms.

  • Removes Linux-specific CLI parser that auto-enabled --formula flag
  • Replaces hardcoded macOS system utility paths (/bin/chmod, /usr/sbin/chown, etc.) with plain command names
  • Adds Linux-specific override for caskroom group ownership (using root instead of admin)

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Library/Homebrew/cli/parser.rb Removes require for OS-specific parser extensions
Library/Homebrew/extend/os/parser.rb File deleted - no longer needed
Library/Homebrew/extend/os/linux/cli/parser.rb File deleted - removes auto---formula behavior on Linux
Library/Homebrew/test/cli/parser_spec.rb Updates test expectations to reflect that --formula is no longer set by default
Library/Homebrew/cask/caskroom.rb Extracts group change logic to allow OS-specific overrides; removes hardcoded paths
Library/Homebrew/extend/os/cask/caskroom.rb New file to load Linux-specific caskroom extensions
Library/Homebrew/extend/os/linux/cask/caskroom.rb New file providing Linux override for group ownership (uses root instead of admin)
Library/Homebrew/cask/staged.rb Removes hardcoded paths for chmod and chown
Library/Homebrew/cask/utils.rb Removes hardcoded paths for mkdir, rmdir, chmod, and chown
Library/Homebrew/cask/utils/rmdir.sh Removes hardcoded paths for rmdir and test
Library/Homebrew/cask/quarantine.rb Removes hardcoded path for chmod
Library/Homebrew/cask/artifact/relocated.rb Removes hardcoded path for chmod
Library/Homebrew/cask/artifact/binary.rb Removes hardcoded path for chmod
Library/Homebrew/test/cask/dsl/shared_examples/staged.rb Updates test expectations to use plain command names instead of hardcoded paths

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

chatgpt-codex-connector[bot]

This comment was marked as duplicate.

- Avoid requiring `--cask` and implicitly adding `--formula` on Linux
- Fix some hardcoded system utility paths and system groups that don't
  apply on Linux
@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Oct 23, 2025
Merged via the queue into main with commit 64d6ddf Oct 23, 2025
37 checks passed
@MikeMcQuaid MikeMcQuaid deleted the linux_cask_handling branch October 23, 2025 15:33
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.

#18808 breaks brew upgrade --greedy

3 participants