Skip to content

Commit 2272df7

Browse files
committed
Do not perform all checks again in openssl/extconf.rb if extconf.h exists
* This reduces the time for recompiling the openssl C extension with `mx build --dependencies org.truffleruby.cext` when extconf.rb or a dependency changes from 42s to 13s.
1 parent a1d7fef commit 2272df7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/main/c/openssl/extconf.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,13 @@ def find_openssl_library
106106
end
107107
end
108108

109+
# TruffleRuby: do not perform all checks again if extconf.h already exists
110+
extconf_h = "#{__dir__}/extconf.h"
111+
if File.exist?(extconf_h) && File.mtime(extconf_h) >= File.mtime(__FILE__ )
112+
$extconf_h = extconf_h
113+
else
114+
### START of checks
115+
109116
unless checking_for("OpenSSL version is 1.0.1 or later") {
110117
try_static_assert("OPENSSL_VERSION_NUMBER >= 0x10001000L", "openssl/opensslv.h") }
111118
raise "OpenSSL >= 1.0.1 or LibreSSL is required"
@@ -175,5 +182,9 @@ def find_openssl_library
175182
Logging::message "=== Checking done. ===\n"
176183

177184
create_header
185+
186+
### END of checks
187+
end
188+
178189
create_makefile("openssl")
179190
Logging::message "Done.\n"

0 commit comments

Comments
 (0)