Skip to content

Commit e66bb7e

Browse files
authored
Merge pull request #20092 from Homebrew/revert-20080-cask-variations-only-supported
Revert "Only generate cask variations for supported macOS configurations"
2 parents ec53914 + 54b349b commit e66bb7e

4 files changed

Lines changed: 0 additions & 177 deletions

File tree

Library/Homebrew/cask/cask.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -426,12 +426,6 @@ def to_hash_with_variations
426426
Homebrew::SimulateSystem.with_tag(bottle_tag) do
427427
refresh
428428

429-
next if bottle_tag.macos? && depends_on.macos && !depends_on.macos.allows?(bottle_tag.to_macos_version)
430-
next if depends_on.arch&.none? do |arch|
431-
arch_tag = ::Utils::Bottles::Tag.new(system: bottle_tag.system, arch: arch[:type])
432-
arch_tag.standardized_arch == bottle_tag.standardized_arch
433-
end
434-
435429
to_h.each do |key, value|
436430
next if HASH_KEYS_TO_SKIP.include? key
437431
next if value.to_s == hash[key].to_s

Library/Homebrew/test/cask/cask_spec.rb

Lines changed: 0 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -484,108 +484,6 @@
484484
}
485485
JSON
486486
end
487-
let(:expected_depends_on_macos_variations_os) do
488-
<<~JSON
489-
{
490-
"tahoe": {
491-
"depends_on": {
492-
"macos": {
493-
">=": [
494-
"10.15"
495-
]
496-
}
497-
}
498-
},
499-
"sequoia": {
500-
"depends_on": {
501-
"macos": {
502-
">=": [
503-
"10.15"
504-
]
505-
}
506-
}
507-
},
508-
"sonoma": {
509-
"depends_on": {
510-
"macos": {
511-
">=": [
512-
"10.15"
513-
]
514-
}
515-
}
516-
},
517-
"ventura": {
518-
"depends_on": {
519-
"macos": {
520-
">=": [
521-
"10.15"
522-
]
523-
}
524-
}
525-
},
526-
"monterey": {
527-
"depends_on": {
528-
"macos": {
529-
">=": [
530-
"10.15"
531-
]
532-
}
533-
}
534-
},
535-
"big_sur": {
536-
"sha256": "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94",
537-
"depends_on": {
538-
"macos": {
539-
">=": [
540-
"10.15"
541-
]
542-
}
543-
}
544-
},
545-
"arm64_big_sur": {
546-
"sha256": "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94"
547-
},
548-
"catalina": {
549-
"sha256": "67cdb8a02803ef37fdbf7e0be205863172e41a561ca446cd84f0d7ab35a99d94",
550-
"depends_on": {
551-
"macos": {
552-
">=": [
553-
"10.15"
554-
]
555-
}
556-
}
557-
}
558-
}
559-
JSON
560-
end
561-
let(:expected_depends_on_arch_variations_os) do
562-
<<~JSON
563-
{
564-
"ventura": {
565-
"sha256": "a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890"
566-
},
567-
"arm64_ventura": {
568-
"sha256": "a1b2c3d4e5f67890abcdef1234567890abcdef1234567890abcdef1234567890"
569-
},
570-
"big_sur": {
571-
"sha256": "d5b2dfbef7ea28c25f7a77cd7fa14d013d82b626db1d82e00e25822464ba19e2",
572-
"depends_on": {
573-
"arch": [
574-
{
575-
"type": "intel",
576-
"bits": 64
577-
}
578-
],
579-
"macos": {
580-
">=": [
581-
"10.11"
582-
]
583-
}
584-
}
585-
}
586-
}
587-
JSON
588-
end
589487

590488
before do
591489
# For consistency, always run on Monterey and ARM
@@ -621,22 +519,6 @@
621519
expect(JSON.pretty_generate(h["variations"])).to eq expected_sha256_variations_os.strip
622520
end
623521

624-
it "returns the correct variations hash for a cask with a different `depends_on macos:` for each arch and os" do
625-
c = Cask::CaskLoader.load("with-depends-on-macos-inside-on-arch")
626-
h = c.to_hash_with_variations
627-
628-
expect(h).to be_a(Hash)
629-
expect(JSON.pretty_generate(h["variations"])).to eq expected_depends_on_macos_variations_os.strip
630-
end
631-
632-
it "returns the correct variations hash for a cask with a different `depends_on arch:` for some os values" do
633-
c = Cask::CaskLoader.load("with-depends-on-arch-inside-on-os")
634-
h = c.to_hash_with_variations
635-
636-
expect(h).to be_a(Hash)
637-
expect(JSON.pretty_generate(h["variations"])).to eq expected_depends_on_arch_variations_os.strip
638-
end
639-
640522
# NOTE: The calls to `Cask.generating_hash!` and `Cask.generated_hash!`
641523
# are not idempotent so they can only be used in one test.
642524
it "returns the correct hash placeholders" do

Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-arch-inside-on-os.rb

Lines changed: 0 additions & 26 deletions
This file was deleted.

Library/Homebrew/test/support/fixtures/cask/Casks/with-depends-on-macos-inside-on-arch.rb

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)