On 2024/10/04 3:57, Johan Corveleyn wrote:
> Hi,
> 
> Another small bump when building on Windows: when gen-make.py runs, or
> when starting to run tests, I always get the following printed on the
> console:
> 
> [[[
> 'ruby' is not recognized as an internal or external command,
> operable program or batch file.
> ]]]
> 
> This is quite correct, because I don't have ruby installed. However,
> nowhere did I ask for any ruby bindings or trying to execute ruby.
> Maybe it's part of some ruby auto-detection, but then this warning
> should probably be suppressed?
> 
> Don't have time to dig deeper right now, but maybe it rings a bell to someone.

I think we could check whether the interpreter is existent without the
warnings before retrieving configurations from the interpreter.

Also, gen-make.py on Windows doesn't have options like --without-swig-ruby,
so that, it is unable to disable the auto-detection.

[[[
Index: build/generator/gen_win_dependencies.py
===================================================================
--- build/generator/gen_win_dependencies.py     (revision 1921101)
+++ build/generator/gen_win_dependencies.py     (working copy)
@@ -935,6 +935,11 @@
   def _find_perl(self, show_warnings):
     "Find the right perl library name to link swig bindings with"

+    try:
+      subprocess.run(['perl', '-v'], capture_output=True)
+    except OSError:
+      return  # not found, permission error, ...
+
     fp = os.popen('perl -MConfig -e ' + escape_shell_arg(
                   'print "$Config{libperl}\\n"; '
                   'print "$Config{PERL_REVISION}.$Config{PERL_VERSION}.'
@@ -974,6 +979,11 @@
   def _find_ruby(self, show_warnings):
     "Find the right Ruby library name to link swig bindings with"

+    try:
+      subprocess.run(['ruby', '--version'], capture_output=True)
+    except OSError:
+      return  # not found, permission error, ...
+
     lib_dir = None
     inc_dirs = []

]]]

-- 
Jun Omae <jun6...@gmail.com> (大前 潤)

Reply via email to