Make Cask CI generate correctly for partial arch dependencies#21380
Make Cask CI generate correctly for partial arch dependencies#21380SMillerDev wants to merge 6 commits intomainfrom
Conversation
|
Partially split from: #20334 |
644dfa9 to
22ab6a6
Compare
There was a problem hiding this comment.
Pull request overview
This pull request enhances Cask CI matrix generation to correctly handle partial architecture dependencies, particularly when casks have OS-specific architecture requirements (e.g., requiring x86_64 on macOS but arm64 on Linux). The changes introduce per-OS architecture filtering to ensure CI runners are properly selected based on platform-specific constraints.
Key Changes
- Modified the
architecturesmethod to accept anosparameter, enabling OS-specific architecture filtering based on simulated system environments - Updated
filter_runnersto separately filter macOS and Linux runners based on their respective architecture requirements - Added
contains_os_specific_artifacts?method to detect casks with platform-specific artifacts that affect OS compatibility - Introduced comprehensive test coverage for various combinations of OS and architecture dependencies
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| Library/Homebrew/dev-cmd/generate-cask-ci-matrix.rb | Enhanced architecture filtering to support OS-specific dependencies; modified filter_runners and architectures methods to handle per-OS architecture constraints |
| Library/Homebrew/cask/cask.rb | Added contains_os_specific_artifacts? method to improve Linux support detection by checking for OS-specific artifact constraints |
| Library/Homebrew/cask/artifact.rb | Added LINUX_ONLY_ARTIFACTS constant (empty placeholder for future Linux-specific artifacts) |
| Library/Homebrew/test/dev-cmd/generate-cask-ci-matrix_spec.rb | Added comprehensive test cases covering various scenarios including mixed OS/arch dependencies, OS-specific dependencies, and system-wide constraints |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b8bbc6a to
e4c9380
Compare
MikeMcQuaid
left a comment
There was a problem hiding this comment.
Thanks! A few small comments.
e4c9380 to
a7f52e7
Compare
|
@SMillerDev I've opened a new pull request, #21432, to work on those changes. Once the pull request is ready, I'll request review from you. |
de5afca to
1750f36
Compare
|
No idea why this issue happens here and not on my local install: |
|
I can reproduce it using Did a bit of discovery with help from Claude. It looks like when the The fix below seems to get this working for me, but there may be a better approach. It stores the value before calling diff --git a/Library/Homebrew/cask/cask.rb b/Library/Homebrew/cask/cask.rb
index 55de9a0613..f2fe086ddd 100644
--- a/Library/Homebrew/cask/cask.rb
+++ b/Library/Homebrew/cask/cask.rb
@@ -167,9 +167,14 @@ module Cask
sig { returns(T::Boolean) }
def supports_linux?
return true if font?
+
+ # Cache the os value before contains_os_specific_artifacts? refreshes the cask
+ # (the refresh clears @dsl.os in generic/non-OS-specific contexts)
+ os_value = @dsl.os
+
return false if contains_os_specific_artifacts?
- @dsl.os.present?
+ os_value.present?
end
sig { returns(T::Boolean) } |
ef77a7b to
c50786b
Compare
MikeMcQuaid
left a comment
There was a problem hiding this comment.
thanks, looks fine bar weird tests.
cb4ec6d to
2556ef8
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Cache the OS value before checking for OS-specific artifacts. Co-Authored-By: Bevan Kay <email@bevankay.me>
2556ef8 to
e3e8f5a
Compare
brew lgtm(style, typechecking and tests) with your changes locally?