Skip to content

Commit 73e5cb6

Browse files
committed
[GR-39628] OpenSSL darwin-aarch64 fixes
PullRequest: truffleruby/3422
2 parents be96ee5 + c2250b9 commit 73e5cb6

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

lib/truffle/truffle/openssl-prefix.rb

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88

99
# Set OPENSSL_PREFIX in ENV to find the OpenSSL headers
1010

11-
module Truffle
12-
OPENSSL_PREFIX_WAS_SET = ENV.key?('OPENSSL_PREFIX')
13-
end
14-
1511
search_homebrew = -> homebrew {
1612
if prefix = "#{homebrew}/opt/[email protected]" and Dir.exist?(prefix)
1713
prefix
@@ -20,10 +16,9 @@ module Truffle
2016
end
2117
}
2218

23-
macOS = RUBY_PLATFORM.include?('darwin')
24-
25-
if macOS && !ENV['OPENSSL_PREFIX']
26-
if prefix = search_homebrew.call('/usr/local')
19+
if Truffle::Platform.darwin? && !ENV['OPENSSL_PREFIX']
20+
default_homebrew_prefix = Truffle::System.host_cpu == 'aarch64' ? '/opt/homebrew' : '/usr/local'
21+
if prefix = search_homebrew.call(default_homebrew_prefix)
2722
# found
2823
else
2924
homebrew = `brew --prefix 2>/dev/null`.strip

src/main/c/openssl/extconf.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ def find_openssl_library
112112

113113
# TruffleRuby: do not perform all checks again if extconf.h already exists
114114
extconf_h = "#{__dir__}/extconf.h"
115-
if File.exist?(extconf_h) && File.mtime(extconf_h) >= File.mtime(__FILE__ ) && !Truffle::OPENSSL_PREFIX_WAS_SET
115+
in_development = ENV.key?('MX_HOME')
116+
if in_development && File.exist?(extconf_h) && File.mtime(extconf_h) >= File.mtime(__FILE__)
116117
$extconf_h = extconf_h
117118
else
118119
### START of checks

0 commit comments

Comments
 (0)