Disable Java requirement versions on Big Sur
It would be possible to work around this but I'm not convinced it's worth it given https://github.com/Homebrew/homebrew-core/issues/63290 Fixes #9194
This commit is contained in:
parent
181baaafb0
commit
35db40fe25
@ -26,6 +26,13 @@ class JavaRequirement < Requirement
|
||||
end
|
||||
|
||||
def java_home_cmd
|
||||
# TODO: enable for all macOS versions and Linux on next minor release
|
||||
# but --version is broken on Big Sur today.
|
||||
if @version && MacOS.version >= :big_sur
|
||||
odisabled "depends_on :java",
|
||||
'"depends_on "openjdk@11", "depends_on "openjdk@8" or "depends_on "openjdk"'
|
||||
end
|
||||
|
||||
return unless File.executable?("/usr/libexec/java_home")
|
||||
|
||||
args = %w[--failfast]
|
||||
|
@ -5,9 +5,11 @@ require "language/java"
|
||||
|
||||
describe Language::Java do
|
||||
describe "::java_home" do
|
||||
it "returns valid JAVA_HOME if version is specified", :needs_java do
|
||||
java_home = described_class.java_home("1.6+")
|
||||
expect(java_home/"bin/java").to be_an_executable
|
||||
if !OS.mac? || MacOS.version < :big_sur
|
||||
it "returns valid JAVA_HOME if version is specified", :needs_java do
|
||||
java_home = described_class.java_home("1.6+")
|
||||
expect(java_home/"bin/java").to be_an_executable
|
||||
end
|
||||
end
|
||||
|
||||
it "returns valid JAVA_HOME if version is not specified", :needs_java do
|
||||
|
@ -68,9 +68,11 @@ describe JavaRequirement do
|
||||
describe "#satisfied?" do
|
||||
subject(:requirement) { described_class.new(%w[1.8]) }
|
||||
|
||||
it "returns false if no `java` executable can be found" do
|
||||
allow(File).to receive(:executable?).and_return(false)
|
||||
expect(requirement).not_to be_satisfied
|
||||
if !OS.mac? || MacOS.version < :big_sur
|
||||
it "returns false if no `java` executable can be found" do
|
||||
allow(File).to receive(:executable?).and_return(false)
|
||||
expect(requirement).not_to be_satisfied
|
||||
end
|
||||
end
|
||||
|
||||
it "returns true if #preferred_java returns a path" do
|
||||
|
@ -110,7 +110,7 @@ RSpec.configure do |config|
|
||||
|
||||
config.before(:each, :needs_java) do
|
||||
java_installed = if OS.mac?
|
||||
Utils.popen_read("/usr/libexec/java_home", "--failfast", "--version", "1.0+")
|
||||
Utils.popen_read("/usr/libexec/java_home", "--failfast")
|
||||
$CHILD_STATUS.success?
|
||||
else
|
||||
which("java")
|
||||
|
Loading…
x
Reference in New Issue
Block a user