OpenC3 / cosmos

OpenC3 COSMOS
https://openc3.com
Other
111 stars 31 forks source link

Bridge support installation fails over missing openssl; sys/socket.h #1170

Closed jurgensymynck closed 7 months ago

jurgensymynck commented 7 months ago

Hi,

After quite some time I picked up working om my OpenC3 COSMOS project again...

I have a clean installed pc, Windows 11, I followed the correct steps involving cloning openc3-project repo, running the demo and can compile my plugins for OpenC3 I have Ruby 3.2 including full dev kit. I installed this as admin, not as user... When running gem install openc3 as instructed here, the installation failed over missing openssl.h file. An intermediate fix was gem install openssl, but ultimately the installer stops again over missing ´sys/socket.h´... no idea what gem I should install here to make further progress.

Any ideas? Thanks in advance! Below is my (abriged) command line session in Windows Powershell (running as Admin), including a printout of gem environment

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

PS C:\Windows\system32> gem install openc3
Fetching yard-0.9.36.gem
Fetching websocket-native-1.0.0.gem
Fetching websocket-1.2.10.gem
Fetching webrick-1.8.1.gem
Fetching uuidtools-2.2.0.gem
Fetching concurrent-ruby-1.2.3.gem
Fetching tzinfo-2.0.6.gem
Fetching tzinfo-data-1.2024.1.gem
Fetching raabro-1.4.0.gem
Fetching et-orbi-1.2.11.gem
Fetching fugit-1.10.1.gem
Fetching rufus-scheduler-3.9.1.gem
Fetching rubyzip-2.3.2.gem
Fetching connection_pool-2.4.1.gem
Fetching redis-client-0.21.1.gem
Fetching redis-5.1.0.gem
Fetching rack-3.0.10.gem
Fetching rackup-2.1.0.gem
Fetching nio4r-2.7.1.gem
Fetching puma-6.4.2.gem
Fetching opentelemetry-api-1.2.5.gem
Fetching opentelemetry-semantic_conventions-1.10.0.gem
Fetching opentelemetry-registry-0.3.1.gem
Fetching opentelemetry-common-0.20.1.gem
Fetching opentelemetry-sdk-1.4.1.gem
Fetching opentelemetry-instrumentation-base-0.22.3.gem
Fetching opentelemetry-instrumentation-redis-0.25.3.gem
Fetching opentelemetry-instrumentation-rack-0.24.0.gem
Fetching opentelemetry-instrumentation-faraday-0.24.1.gem
Fetching opentelemetry-instrumentation-aws_sdk-0.5.1.gem
Fetching opentelemetry-instrumentation-action_pack-0.9.0.gem
Fetching google-protobuf-3.25.3-x64-mingw-ucrt.gem
Fetching googleapis-common-protos-types-1.14.0.gem
Fetching opentelemetry-exporter-otlp-0.26.3.gem
Fetching nokogiri-1.16.3-x64-mingw-ucrt.gem
Fetching mqtt-0.6.0.gem
Fetching multi_json-1.15.0.gem
Fetching jsonpath-1.1.5.gem
Fetching httpclient-2.8.3.gem
Fetching hiredis-client-0.21.1.gem
Fetching ffi-1.16.3-x64-mingw-ucrt.gem
Fetching multipart-post-2.4.0.gem
Fetching faraday-multipart-1.0.4.gem
Fetching faraday-net_http-3.1.0.gem
Fetching faraday-2.9.0.gem
Fetching faraday-follow_redirects-0.3.0.gem
Fetching childprocess-4.1.0.gem
Fetching cbor-0.5.9.8.gem
Fetching openc3-5.15.2.gem
Fetching aws-eventstream-1.3.0.gem
Fetching aws-sigv4-1.8.0.gem
Fetching jmespath-1.6.2.gem
Fetching aws-partitions-1.908.0.gem
Fetching aws-sdk-core-3.191.6.gem
Fetching aws-sdk-kms-1.78.0.gem
Fetching aws-sdk-s3-1.146.1.gem
Successfully installed yard-0.9.36
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
Successfully installed websocket-native-1.0.0
Successfully installed websocket-1.2.10
Successfully installed webrick-1.8.1
Successfully installed uuidtools-2.2.0
Successfully installed concurrent-ruby-1.2.3
Successfully installed tzinfo-2.0.6
Successfully installed tzinfo-data-1.2024.1
Successfully installed raabro-1.4.0
Successfully installed et-orbi-1.2.11
Successfully installed fugit-1.10.1
Successfully installed rufus-scheduler-3.9.1
RubyZip 3.0 is coming!
...
Successfully installed rubyzip-2.3.2
Successfully installed connection_pool-2.4.1
Successfully installed redis-client-0.21.1
Successfully installed redis-5.1.0
Successfully installed rack-3.0.10
Successfully installed rackup-2.1.0
Building native extensions. This could take a while...
Successfully installed nio4r-2.7.1
Building native extensions. This could take a while...
Successfully installed puma-6.4.2
Successfully installed opentelemetry-api-1.2.5
Successfully installed opentelemetry-semantic_conventions-1.10.0
Successfully installed opentelemetry-registry-0.3.1
Successfully installed opentelemetry-common-0.20.1
Successfully installed opentelemetry-sdk-1.4.1
Successfully installed opentelemetry-instrumentation-base-0.22.3
Successfully installed opentelemetry-instrumentation-redis-0.25.3
Successfully installed opentelemetry-instrumentation-rack-0.24.0
Successfully installed opentelemetry-instrumentation-faraday-0.24.1
Successfully installed opentelemetry-instrumentation-aws_sdk-0.5.1
Successfully installed opentelemetry-instrumentation-action_pack-0.9.0
Successfully installed google-protobuf-3.25.3-x64-mingw-ucrt
Successfully installed googleapis-common-protos-types-1.14.0
Successfully installed opentelemetry-exporter-otlp-0.26.3
Successfully installed nokogiri-1.16.3-x64-mingw-ucrt
Successfully installed mqtt-0.6.0
Successfully installed multi_json-1.15.0
Successfully installed jsonpath-1.1.5
Successfully installed httpclient-2.8.3
Building native extensions. This could take a while...
ERROR:  Error installing openc3:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby32/lib/ruby/gems/3.2.0/gems/hiredis-client-0.21.1/ext/redis_client/hiredis
C:/Ruby32/bin/ruby.exe extconf.rb
checking for openssl/ssl.h... no
ERROR: OpenSSL library could not be found.
Use --with-openssl-dir=<dir> option to specify the prefix where OpenSSL is installed.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.
...
Provided configuration options:
...
        --with-openssl-dir
        --without-openssl-dir
        --with-openssl-include
        --without-openssl-include=${openssl-dir}/include
        --with-openssl-lib
        --without-openssl-lib=${openssl-dir}/lib

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  C:/Ruby32/lib/ruby/gems/3.2.0/extensions/x64-mingw-ucrt/3.2.0/hiredis-client-0.21.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby32/lib/ruby/gems/3.2.0/gems/hiredis-client-0.21.1 for inspection.
Results logged to C:/Ruby32/lib/ruby/gems/3.2.0/extensions/x64-mingw-ucrt/3.2.0/hiredis-client-0.21.1/gem_make.out

PS C:\Windows\system32> gem install openssl
Fetching openssl-3.2.0.gem
Temporarily enhancing PATH for MSYS/MINGW...
Installing required msys2 packages: mingw-w64-ucrt-x86_64-openssl
Building native extensions. This could take a while...
Successfully installed openssl-3.2.0
Parsing documentation for openssl-3.2.0
Installing ri documentation for openssl-3.2.0
Done installing documentation for openssl after 2 seconds
1 gem installed

PS C:\Windows\system32> gem install openc3
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR:  Error installing openc3:
        ERROR: Failed to build gem native extension.
...
current directory: C:/Ruby32/lib/ruby/gems/3.2.0/gems/hiredis-client-0.21.1/ext/redis_client/hiredis
make DESTDIR\= sitearchdir\=./.gem.20240404-13420-m09gmt sitelibdir\=./.gem.20240404-13420-m09gmt
generating hiredis_connection-x64-mingw-ucrt.def
compiling hiredis_connection.c
hiredis_connection.c:37:10: fatal error: sys/socket.h: No such file or directory
   37 | #include <sys/socket.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:248: hiredis_connection.o] Fout 1

make failed, exit code 2

Gem files will remain installed in C:/Ruby32/lib/ruby/gems/3.2.0/gems/hiredis-client-0.21.1 for inspection.
Results logged to C:/Ruby32/lib/ruby/gems/3.2.0/extensions/x64-mingw-ucrt/3.2.0/hiredis-client-0.21.1/gem_make.out

PS C:\Windows\system32> gem environment
RubyGems Environment:
  - RUBYGEMS VERSION: 3.4.19
  - RUBY VERSION: 3.2.3 (2024-01-18 patchlevel 157) [x64-mingw-ucrt]
  - INSTALLATION DIRECTORY: C:/Ruby32/lib/ruby/gems/3.2.0
  - USER INSTALLATION DIRECTORY: C:/Users/XXXXXXXXXXXXXXXXXXX/.local/share/gem/ruby/3.2.0
  - RUBY EXECUTABLE: C:/Ruby32/bin/ruby.exe
  - GIT EXECUTABLE: C:\Git\cmd/git.EXE
  - EXECUTABLE DIRECTORY: C:/Ruby32/bin
  - SPEC CACHE DIRECTORY: C:/Users/XXXXXXXXXXXXXXXXXXX/.local/share/gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: C:/ProgramData
  - RUBYGEMS PLATFORMS:
     - ruby
     - x64-mingw-ucrt
  - GEM PATHS:
     - C:/Ruby32/lib/ruby/gems/3.2.0
     - C:/Users/XXXXXXXXXXXXXXXXXXX/.local/share/gem/ruby/3.2.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => true
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - C:\Windows\system32
     - C:\Windows
     - C:\Windows\System32\Wbem
     - C:\Windows\System32\WindowsPowerShell\v1.0\
     - C:\Windows\System32\OpenSSH\
     - C:\ImageMagick
     - C:\Ruby32\bin
     - C:\Python3\Scripts\
     - C:\Python3\
     - C:\Strawberry\c\bin
     - C:\Strawberry\perl\site\bin
     - C:\Strawberry\perl\bin
     - C:\gs10\bin
     - C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
     - C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\
     - C:\Program Files\dotnet\
     - C:\Program Files\Microsoft VS Code\bin
     - C:\Git\cmd
     - C:\WinSCP\
     - C:\ffmpeg\bin
     - C:\putty\
     - C:\Program Files (x86)\GitExtensions\
     - C:\cygwin64\bin
     - C:\Program Files\F3D\bin
     - C:\Program Files\Docker\Docker\resources\bin
     - C:\openc3-project
     - C:\Users\XXXXXXXXXXXXXXXXXXX\AppData\Local\Microsoft\WindowsApps
     - C:\Users\XXXXXXXXXXXXXXXXXXX\AppData\Local\Programs\MiKTeX\miktex\bin\x64\
PS C:\Windows\system32>
ryanmelt commented 7 months ago

I haven't tried to install the gem directly on Windows since we added hiredis in 5.15.0.
You might need to go back to using version 5.14.2 of the gem on the host until then. gem install openc3 -v 5.14.2

jmthomas commented 7 months ago

You're supposed to be able to install hiredis in Windows and this line won't compile on Windows.

Can you open irb and type: RUBY_PLATFORM and see what it says

jurgensymynck commented 7 months ago

Thanks fior the quick response! Here is the output:

irb(main):001:0> RUBY_PLATFORM
=> "x64-mingw-ucrt"
irb(main):002:0>
jurgensymynck commented 7 months ago

I haven't tried to install the gem directly on Windows since we added hiredis in 5.15.0. You might need to go back to using version 5.14.2 of the gem on the host until then. gem install openc3 -v 5.14.2

thanks for the workaround, I'm up and running!

greetings, Jurgen

jmthomas commented 7 months ago

@jurgensymynck I just submitted a patch to the redis-client so when that gets fixed upstream this should resolve. Thanks for raising this!

I'll leave this open until we merge a new version of redis-client.