Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore missing DLL for libcurl #3109

Merged
merged 2 commits into from
Jul 10, 2020
Merged

Conversation

HebaruSan
Copy link
Member

Problem

https://ci.ksp-ckan.space/job/NetKAN/9883/console

Fetching latest ckan.exe

Unhandled Exception:
System.DllNotFoundException: libcurl assembly:<unknown assembly> type:<unknown type> member:(null)
  at (wrapper managed-to-native) CurlSharp.NativeMethods.curl_global_init(int)
  at CurlSharp.Curl.GlobalInit (CurlSharp.CurlInitFlag flags) [0x00001] in <5257a4b91e0a46648a337ec8fa636dea>:0 
  at CKAN.Curl.Init () [0x00017] in <5257a4b91e0a46648a337ec8fa636dea>:0 
  at CKAN.CmdLine.MainClass.Main (System.String[] args) [0x00091] in <5257a4b91e0a46648a337ec8fa636dea>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: System.DllNotFoundException: libcurl assembly:<unknown assembly> type:<unknown type> member:(null)
  at (wrapper managed-to-native) CurlSharp.NativeMethods.curl_global_init(int)
  at CurlSharp.Curl.GlobalInit (CurlSharp.CurlInitFlag flags) [0x00001] in <5257a4b91e0a46648a337ec8fa636dea>:0 
  at CKAN.Curl.Init () [0x00017] in <5257a4b91e0a46648a337ec8fa636dea>:0 
  at CKAN.CmdLine.MainClass.Main (System.String[] args) [0x00091] in <5257a4b91e0a46648a337ec8fa636dea>:0 
Build step 'Execute shell' marked build as failure

The command that's failing is mono ckan.exe version.

Cause

In #3107 we started calling Curl.Init() unconditionally at the start of ckan.exe and netkan.exe to suppress the "non-threadsafe init" message.

Curl.Init() throws that exception if libcurl isn't installed.

Background

https://github.com/KSP-CKAN/CKAN/wiki/libcurl

libcurl is a third party package that CKAN uses. It was required as of CKAN 1.6.6 and made optional in CKAN 1.22.2. Currently it is only used as a fallback if the main downloader fails. In normal use you should be able to get by without libcurl.

We just made it required again. That's no good.

Changes

Now Curl.Init() doesn't care if the DLL isn't found.

@HebaruSan HebaruSan requested a review from techman83 July 10, 2020 03:49
@HebaruSan HebaruSan added Bug Something is not working as intended Network Issues affecting internet connections of CKAN Pull request labels Jul 10, 2020
Core/Net/Curl.cs Outdated Show resolved Hide resolved
@techman83
Copy link
Member

Good catch, merging with thanks!

@techman83 techman83 merged commit ba54c79 into KSP-CKAN:master Jul 10, 2020
@HebaruSan HebaruSan deleted the fix/curl-optional branch July 10, 2020 04:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something is not working as intended Network Issues affecting internet connections of CKAN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants