d-language-server / dls

A Language Server implementation for D
http://dls.dub.pm
106 stars 14 forks source link

dls blocks dmd's libcurl.dll, stalling dmd installation. #31

Closed veelo closed 5 years ago

veelo commented 5 years ago

I just filed https://issues.dlang.org/show_bug.cgi?id=19707.

Not sure whether it should be addressed by the dmd installer or by dls, or elsewhere...

Thanks, Bastiaan.

LaurentTreguier commented 5 years ago

That's because of dls, yes. Since Windows doesn't bundle libcurl, dls will use dmd or ldc's libcurl instead, and Windows unfortunately doesn't allow touching files that are in use. For now all I can advise is to stop dls during a dmd install (that's what I do).

veelo commented 5 years ago

Thanks. I never used libcurl myself, but read that it is for file transfer. In case dls depends on libcurls' services relatively infrequently, maybe that functionality can be isolated into a separate process that terminates after the transfer, so that libcurl is not in use when dls is idle?

andre2007 commented 5 years ago

I assume you use std.net.curl. You may could use the http library from arsd, vibe.d or even use Windows library (on windows) for downloading files.

LaurentTreguier commented 5 years ago

I prefer keeping a single binary for simplicity, and I also prefer avoiding adding new dependencies; so among the three ideas, I'll probably go with trying to use Windows' API.

LaurentTreguier commented 5 years ago

So what I have coming up now is that Wininet will be used whenever DLS is linked against Microsoft's C runtime. When using Digital Mars's C runtime, those functions are unavailable (or I'm doing something wrong). So when running dub run dls:bootstrap for the initial installation, libcurl will still be used because dmd defaults to linking against DM's C runtime. However this shouldn't be a problem as it's just a command run once and not a long-running binary; meanwhile the actual dls.exe binary is built on Appveyor and has already been linked against MS's C runtime for a number of releases.

andre2007 commented 5 years ago

@wilzbach is working on this:) https://github.com/dlang/dub/pull/1661

LaurentTreguier commented 5 years ago

Great ! Now my only fear is that dub itself starts using curl when I'm using it as a library... I should have only one place where this is the case, and it's trivial to remove

wilzbach commented 5 years ago

AFAICT my PR is unrelated to this and besides I don't have a Windows machine, so the mentioned PR isn't really actively being worked on. It was just a PoC to show to Windows users how easy it would be to change the status quo.

andre2007 commented 5 years ago

@wilzbach thanks for the info and starting the pr. I thought coff is also using the Microsoft c runtime instead of the DM c runtime but my knowledge is limited here.

If I find some time I check whether I can get your pr working.

wilzbach commented 5 years ago

I thought coff is also using the Microsoft c runtime instead of the DM c runtime but my knowledge is limited here.

Yes, sorry. I skimmed to quickly over the issue.

veelo commented 5 years ago

Thank you!