ocaml / flexdll

a dlopen-like API for Windows
Other
97 stars 30 forks source link

Fatal Error: Cannot run cygpath -m - command - The command line is too long #67

Closed bryphe closed 4 years ago

bryphe commented 5 years ago

Our esy build fails on Windows when running ocamlopt.exe w/ lots of includes.

The relevant portion is:

** Fatal error: Cannot run cygpath -m "libadvapi32" "libadvapi32.lib" "libadvapi32.dll.a" "libadvapi32.a" "C:/Users/bryph/.esy/3_/i/opam__slash__ocamlfind-1.8.0-12c842a0/lib/ocaml\libadvapi32" "C:/Users/bryph/.esy/3_/i/opam__slash__ocamlfind-1.8.0-12c842a0/lib/ocaml\libadvapi32.lib" 
...

Full log

This is running ocaml 4.6.0, with v0.37 of flexdll.

bryphe commented 5 years ago

Looking through the code, it appears there is faculty to handle this case: https://github.com/alainfrisch/flexdll/blob/5f0011a3db1f3a499eeaaae2254e806cbe6b8035/reloc.ml#L71

But for some reason, it's not working correctly in our environment.

It appears that there is a padding of 10 characters (The check is for String.length cmd' < 8182, vs 8192...). I suspect that we must be hitting a case where that 'padding' isn't sufficient.