nim-lang / choosenim

Official tool for easily installing and managing multiple versions of the Nim programming language.
BSD 3-Clause "New" or "Revised" License
36 stars 8 forks source link

Fails to run on Windows 10: "could not find symbol: SSL_library_init [LibraryError]" #27

Open akavel opened 2 months ago

akavel commented 2 months ago

After downloading and unpacking the 0.8.5 zip, I get the following errors in cmd.exe window:

C:\dnload\general-utils\choosenim-0.8.5_windows_amd64\choosenim>choosenim.exe
D:\a\choosenim\choosenim\.nim_runtime\lib\pure\net.nim(553) net
D:\a\choosenim\choosenim\.nim_runtime\lib\wrappers\openssl.nim(409) SSL_library_init
D:\a\choosenim\choosenim\.nim_runtime\lib\wrappers\openssl.nim(382) sslSymThrows
D:\a\choosenim\choosenim\.nim_runtime\lib\pure\dynlib.nim(64) raiseInvalidLibrary
Error: unhandled exception: could not find symbol: SSL_library_init [LibraryError]

C:\dnload\general-utils\choosenim-0.8.5_windows_amd64\choosenim>cd ..

C:\dnload\general-utils\choosenim-0.8.5_windows_amd64>runme.bat
D:\a\choosenim\choosenim\.nim_runtime\lib\pure\net.nim(553) net
D:\a\choosenim\choosenim\.nim_runtime\lib\wrappers\openssl.nim(409) SSL_library_init
D:\a\choosenim\choosenim\.nim_runtime\lib\wrappers\openssl.nim(382) sslSymThrows
D:\a\choosenim\choosenim\.nim_runtime\lib\pure\dynlib.nim(64) raiseInvalidLibrary
Error: unhandled exception: could not find symbol: SSL_library_init [LibraryError]
D:\a\choosenim\choosenim\.nim_runtime\lib\pure\net.nim(553) net
D:\a\choosenim\choosenim\.nim_runtime\lib\wrappers\openssl.nim(409) SSL_library_init
D:\a\choosenim\choosenim\.nim_runtime\lib\wrappers\openssl.nim(382) sslSymThrows
D:\a\choosenim\choosenim\.nim_runtime\lib\pure\dynlib.nim(64) raiseInvalidLibrary
Error: unhandled exception: could not find symbol: SSL_library_init [LibraryError]
Odmowa dostępu.
        0 file(s) copied.
            Work finished.
            Now you must ensure that the Nimble bin dir is in your PATH:
ECHO is off.
Press any key to continue . . .

Note: Odmowa dostępu means Access denied in English.

Chris3606 commented 2 months ago

Same issue here.

K0-RR commented 2 months ago

Same issue on W11

flowstate247 commented 2 months ago

Same issue here

ringabout commented 2 months ago

Does https://github.com/nim-lang/choosenim/releases/tag/master work for you?

It worked for me

PS D:\Documents> ./choosenim-0.8.7_windows_amd64 choosenim: The Nim toolchain installer.

Choose a job. Choose a mortgage. Choose life. Choose Nim.

flowstate247 commented 2 months ago

Still doesn't work here.

E:\Packages\Coding\choosenim-0.8.7_windows_amd64\choosenim>choosenim.exe
D:\a\choosenim\choosenim\.nim_runtime\lib\pure\net.nim(553) net
D:\a\choosenim\choosenim\.nim_runtime\lib\wrappers\openssl.nim(409) SSL_library_init
D:\a\choosenim\choosenim\.nim_runtime\lib\wrappers\openssl.nim(382) sslSymThrows
D:\a\choosenim\choosenim\.nim_runtime\lib\pure\dynlib.nim(64) raiseInvalidLibrary
Error: unhandled exception: could not find symbol: SSL_library_init [LibraryError]

E:\Packages\Coding\choosenim-0.8.7_windows_amd64\choosenim>cd ..

E:\Packages\Coding\choosenim-0.8.7_windows_amd64>runme
D:\a\choosenim\choosenim\.nim_runtime\lib\pure\net.nim(553) net
D:\a\choosenim\choosenim\.nim_runtime\lib\wrappers\openssl.nim(409) SSL_library_init
D:\a\choosenim\choosenim\.nim_runtime\lib\wrappers\openssl.nim(382) sslSymThrows
D:\a\choosenim\choosenim\.nim_runtime\lib\pure\dynlib.nim(64) raiseInvalidLibrary
Error: unhandled exception: could not find symbol: SSL_library_init [LibraryError]
D:\a\choosenim\choosenim\.nim_runtime\lib\pure\net.nim(553) net
D:\a\choosenim\choosenim\.nim_runtime\lib\wrappers\openssl.nim(409) SSL_library_init
D:\a\choosenim\choosenim\.nim_runtime\lib\wrappers\openssl.nim(382) sslSymThrows
D:\a\choosenim\choosenim\.nim_runtime\lib\pure\dynlib.nim(64) raiseInvalidLibrary
Error: unhandled exception: could not find symbol: SSL_library_init [LibraryError]
        1 fichier(s) copié(s).
            Work finished.
            Now you must ensure that the Nimble bin dir is in your PATH:
Commande ECHO désactivée.
Appuyez sur une touche pour continuer...

Note that the path is very weird. What is going on with this D:\a\

flowstate247 commented 2 months ago

I've just tested the latest tag/master. There are some differences, but the issue is still not resolved.

E:\Packages\Coding\choosenim-master_windows_amd64\choosenim>choosenim.exe
dynlib.nim(64)           raiseInvalidLibrary
Error: unhandled exception: could not find symbol: SSL_library_init [LibraryError]

E:\Packages\Coding\choosenim-master_windows_amd64\choosenim>cd ..

E:\Packages\Coding\choosenim-master_windows_amd64>runme.bat
dynlib.nim(64)           raiseInvalidLibrary
Error: unhandled exception: could not find symbol: SSL_library_init [LibraryError]
dynlib.nim(64)           raiseInvalidLibrary
Error: unhandled exception: could not find symbol: SSL_library_init [LibraryError]
        1 fichier(s) copié(s).
            Work finished.
            Now you must ensure that the Nimble bin dir is in your PATH:
Commande ECHO désactivée.
Appuyez sur une touche pour continuer...
gushromp commented 1 month ago

EDIT5: Can confirm that manually downloading the files from https://nim-lang.org/download/dlls.zip and putting them in the same folder as the exe works. Also, why is choosenim looking for ssleay/libeay DLLs when the files in that archive have libcrypto/libssl DLLs instead?


If I run it from my downloads directory c:\Users\my_user\Downloads\choosenim-0.8.7_windows_amd64.exe it works, if I move it anywhere e.g. c:\choosenim\choosenim-0.8.7_windows_amd64.exe I get the same error as everyone else... Weird

EDIT: It might be related to the Windows SmartScreen stuff, basically I double clicked the executable once in the downloads folder and allowed it to run and now it only runs from there and with that. If I move it I don't get another smartscreen prompt and it doesnt work at all

EDIT2: I tried the master release and even though I allowed it in smartscreen I only get:

dynlib.nim(64)           raiseInvalidLibrary
Error: unhandled exception: could not find symbol: SSL_library_init [LibraryError]

EDIT3: Whatever happened I can't get it to run at all anymore. Even though I turned of smartscreen completely. Scanning my system I found that I have tens of libeay32.dll and ssleay32.dll scattered all over my system. Some of those are very old. It might be the case that choosenim shouldn't rely on finding the first one in path but rather always downloading a version that is known to work

ringabout commented 1 month ago

Can confirm that manually downloading the files from https://nim-lang.org/download/dlls.zip and putting them in the same folder as the exe works.

Cool, perhaps we can ship the DLLs in the choosenim zip files

ringabout commented 1 month ago

Hello, since https://github.com/nim-lang/choosenim/pull/40, it has bundled DLLs with the choosenim binary. Would you mind checking the zip file of https://github.com/nim-lang/choosenim/releases/tag/master ?

flowstate247 commented 1 month ago

Here is what I get now:

E:\Packages\Coding\choosenim-master_windows_amd64>runme
      Info: C:\Users\phili\.choosenim\downloads\mingw64.zip already downloaded
 Extracting mingw64.zip
      Info: C:\Users\phili\.choosenim\downloads\dlls.zip already downloaded
 Extracting dlls.zip
   Warning: Error copying 'cacert.pem' to 'C:\Users\phili\.nimble\bin': Le chemin d’accès spécifié est introuvable.
        ... Additional info: ("C:\\Users\\phili\\AppData\\Local\\Temp\\choosenim-dlls\\cacert.pem", "C:\\Users\\phili\\.nimble\\bin\\cacert.pem")
   Warning: Error copying 'libcrypto-1_1-x64.dll' to 'C:\Users\phili\.nimble\bin': Le chemin d’accès spécifié est introuvable.
        ... Additional info: ("C:\\Users\\phili\\AppData\\Local\\Temp\\choosenim-dlls\\libcrypto-1_1-x64.dll", "C:\\Users\\phili\\.nimble\\bin\\libcrypto-1_1-x64.dll")
   Warning: Error copying 'libcrypto-1_1.dll' to 'C:\Users\phili\.nimble\bin': Le chemin d’accès spécifié est introuvable.
        ... Additional info: ("C:\\Users\\phili\\AppData\\Local\\Temp\\choosenim-dlls\\libcrypto-1_1.dll", "C:\\Users\\phili\\.nimble\\bin\\libcrypto-1_1.dll")
   Warning: Error copying 'libcurl.dll' to 'C:\Users\phili\.nimble\bin': Le chemin d’accès spécifié est introuvable.
        ... Additional info: ("C:\\Users\\phili\\AppData\\Local\\Temp\\choosenim-dlls\\libcurl.dll", "C:\\Users\\phili\\.nimble\\bin\\libcurl.dll")
   Warning: Error copying 'libssl-1_1-x64.dll' to 'C:\Users\phili\.nimble\bin': Le chemin d’accès spécifié est introuvable.
        ... Additional info: ("C:\\Users\\phili\\AppData\\Local\\Temp\\choosenim-dlls\\libssl-1_1-x64.dll", "C:\\Users\\phili\\.nimble\\bin\\libssl-1_1-x64.dll")
   Warning: Error copying 'libssl-1_1.dll' to 'C:\Users\phili\.nimble\bin': Le chemin d’accès spécifié est introuvable.
        ... Additional info: ("C:\\Users\\phili\\AppData\\Local\\Temp\\choosenim-dlls\\libssl-1_1.dll", "C:\\Users\\phili\\.nimble\\bin\\libssl-1_1.dll")
   Warning: Error copying 'pcre.dll' to 'C:\Users\phili\.nimble\bin': Le chemin d’accès spécifié est introuvable.
        ... Additional info: ("C:\\Users\\phili\\AppData\\Local\\Temp\\choosenim-dlls\\pcre.dll", "C:\\Users\\phili\\.nimble\\bin\\pcre.dll")
   Warning: Error copying 'pcre32.dll' to 'C:\Users\phili\.nimble\bin': Le chemin d’accès spécifié est introuvable.
        ... Additional info: ("C:\\Users\\phili\\AppData\\Local\\Temp\\choosenim-dlls\\pcre32.dll", "C:\\Users\\phili\\.nimble\\bin\\pcre32.dll")
   Warning: Error copying 'pcre64.dll' to 'C:\Users\phili\.nimble\bin': Le chemin d’accès spécifié est introuvable.
        ... Additional info: ("C:\\Users\\phili\\AppData\\Local\\Temp\\choosenim-dlls\\pcre64.dll", "C:\\Users\\phili\\.nimble\\bin\\pcre64.dll")
   Warning: Error copying 'pdcurses.dll' to 'C:\Users\phili\.nimble\bin': Le chemin d’accès spécifié est introuvable.
        ... Additional info: ("C:\\Users\\phili\\AppData\\Local\\Temp\\choosenim-dlls\\pdcurses.dll", "C:\\Users\\phili\\.nimble\\bin\\pdcurses.dll")
   Warning: Error copying 'pdcurses32.dll' to 'C:\Users\phili\.nimble\bin': Le chemin d’accès spécifié est introuvable.
        ... Additional info: ("C:\\Users\\phili\\AppData\\Local\\Temp\\choosenim-dlls\\pdcurses32.dll", "C:\\Users\\phili\\.nimble\\bin\\pdcurses32.dll")
   Warning: Error copying 'pdcurses64.dll' to 'C:\Users\phili\.nimble\bin': Le chemin d’accès spécifié est introuvable.
        ... Additional info: ("C:\\Users\\phili\\AppData\\Local\\Temp\\choosenim-dlls\\pdcurses64.dll", "C:\\Users\\phili\\.nimble\\bin\\pdcurses64.dll")
   Warning: Error copying 'sqlite3_32.dll' to 'C:\Users\phili\.nimble\bin': Le chemin d’accès spécifié est introuvable.
        ... Additional info: ("C:\\Users\\phili\\AppData\\Local\\Temp\\choosenim-dlls\\sqlite3_32.dll", "C:\\Users\\phili\\.nimble\\bin\\sqlite3_32.dll")
   Warning: Error copying 'sqlite3_64.dll' to 'C:\Users\phili\.nimble\bin': Le chemin d’accès spécifié est introuvable.
        ... Additional info: ("C:\\Users\\phili\\AppData\\Local\\Temp\\choosenim-dlls\\sqlite3_64.dll", "C:\\Users\\phili\\.nimble\\bin\\sqlite3_64.dll")
  Installed component 'nim'
  Installed component 'nimble'
  Installed component 'nimgrep'
  Installed component 'nimpretty'
  Installed component 'nimsuggest'
  Installed component 'testament'
  Installed component 'nim-gdb'
  Installed component 'gcc'
  Installed component 'g++'
  Installed component 'gdb'
  Installed component 'ld'
      Hint: Use 'choosenim <version/channel> --firstInstall' to add
        ... C:\Users\phili\.nimble\bin to your PATH.
   Switched to Nim 2.0.8
      Note: PATH changes will only take effect in new sessions.
        1 fichier(s) copié(s).
            Work finished.
            Now you must ensure that the Nimble bin dir is in your PATH:
              C:\Users\phili\.nimble\bin
Appuyez sur une touche pour continuer...
flowstate247 commented 1 month ago

I think I found the issue with these warnings:

Warning: Error copying 'cacert.pem' to 'C:\Users\phili\.nimble\bin': Le chemin d’accès spécifié est introuvable.
        ... Additional info: ("C:\\Users\\phili\\AppData\\Local\\Temp\\choosenim-dlls\\cacert.pem", "C:\\Users\\phili\\.nimble\\bin\\cacert.pem")

When I checked in the file explorer, I didn't find the "C:\Users\phili\AppData\Local\Temp\choosenim-dlls" folder.

Instead, there is a folder "C:\Users\phili\AppData\Local\Temp\choosenim-extraction" that contains all the dlls to be copied.

I hope it is useful to you.