From e3c8ad33ffae87595e495404e55d5c52d7852844 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Thu, 25 May 2023 16:36:44 -0700 Subject: [PATCH] Properly handle when header file is not found When header file is not found, generate a dummy Makefile and target result so extension build will be successful but essentially a no-op --- ext/vagrant_ssl/extconf.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ext/vagrant_ssl/extconf.rb b/ext/vagrant_ssl/extconf.rb index 44b307d1b..b551b18ae 100644 --- a/ext/vagrant_ssl/extconf.rb +++ b/ext/vagrant_ssl/extconf.rb @@ -8,4 +8,11 @@ if have_header("openssl/opensslv.h") end append_ldflags(["-lssl"]) create_makefile("vagrant_ssl") +else + # If the header file isn't found, just create a dummy + # Makefile and stub the library to make it a noop + File.open("Makefile", "wb") do |f| + f.write(dummy_makefile(__dir__).join("\n")) + end + FileUtils.touch("vagrant_ssl.so") end