Skip to content

brew install --cask may fail on Linux if os stanza is missing #23427

Description

@AlternateRT

brew doctor output

Your system is ready to brew.

Verification

  • I ran brew update twice and am still able to reproduce my issue.
  • My "brew doctor output" above says Your system is ready to brew or a definitely unrelated Tier message.
  • This issue's title and/or description do not reference a single formula e.g. brew install wget. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.
  • I did not use AI/LLM to create this issue, or I disclosed the tool and model used; I will answer maintainer questions myself without AI/LLM.

brew config output

HOMEBREW_VERSION: 6.0.15-35-gf4a703c
ORIGIN: https://github.com/Homebrew/brew
HEAD: f4a703c7267440943171ac0716a764b81442b673
Last commit: 22 minutes ago
Branch: main
Core tap: N/A
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
Homebrew Ruby: 4.0.6 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/4.0.6/bin/ruby
CPU: hexa-core 64-bit arm
Clang: N/A
Git: 2.53.0 => /bin/git
Curl: 8.18.0 => /bin/curl
Kernel: Linux 7.0.0-15-generic aarch64 GNU/Linux
Landlock ABI: 8
OS: Ubuntu 26.04 LTS (resolute)
Host glibc: 2.43
Host libstdc++: 6.0.35
/usr/bin/gcc: 15.2.0
/usr/bin/ruby: N/A
glibc: N/A
gcc@13: N/A
gcc: N/A
xorg: N/A

What were you trying to do (and why)?

I was trying to install casks that support both macOS and Linux inside an Ubuntu VM.

Right now, the only cask affected by this issue is unity-hub, but I'm bringing it up because there seems to be something wrong with cask auditing.

I will also note that that unity-hub does not support arm64 hardware, but that is not relevant to this report - the issue being reported here would also occur in a machine with x86_64 hardware.

The zen cask also had this problem before, but the issue was circumvented by adding the os stanza to it in Homebrew/homebrew-cask#273871 - this PR is what prompted me to test this.

What happened (include all command output)?

The cask was not installed because Homebrew declared that it required macOS (even though it is a Linux cask as well).

% brew install --cask unity-hub   
==> Would install 1 cask:
unity-hub
==> Fetching downloads for: unity-hub
Error: unity-hub: unity-hub: This cask requires macOS.

What did you expect to happen?

In x86_64 hardware, the cask should have been installed successfully.

In arm64 hardware, the install process should have failed with a more relevant error, i.e.

Error: unity-hub: This cask depends on hardware architecture being one of [{type: :intel, bits: 64}], but you are running {type: :arm, bits: 64}.

Step-by-step reproduction instructions (running brew commands)

brew install --cask unity-hub

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions