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

Error "Command line is too long" in all reason and ocaml files on windows #262

Open
Yakimych opened this issue Apr 3, 2019 · 7 comments
Labels
bug Something isn't working help wanted Extra attention is needed windows things that are windows-specific

Comments

@Yakimych
Copy link

Yakimych commented Apr 3, 2019

Hi. I am working on a medium-sized React/Typescript project with bucklescript/reason/genType added manually. For a while everything worked fine, but at some point I started getting "command line is too long" errors in every Reason and OCaml file.

Running diagnostics for file:///c%3A/path_to_project/src/Api/reason/Api.mli
➡️ running bsc C:\path_to_project\node_modules\bs-platform\lib\bsc.exe -c -I "C:\path_to_project\lib\bs" -I "C:\path_to_project\lib\bs\src/ac-common" -I "C:\path_to_project\lib\bs\src/ac-common\AcButton" -I "C:\path_to_project\lib\bs\src/ac-common\AcButton\components" -I "C:\path_to_project\lib\bs\src/ac-common\AcClickOutsideListener" -I ...this goes on for around 9000 characters... "C:\path_to_project\node_modules\bs-platform\lib\ocaml" -bin-annot -bs-no-builtin-ppx-ml -bs-package-name react-js-app -open ReactJsApp -ppx "C:\path_to_project\node_modules\bs-platform\lib\reactjs_jsx_ppx_2.exe" -ppx C:\path_to_project\node_modules\bs-platform\lib\bsppx.exe -nostdlib -color always -w -30-40+6+7+27+32..39+44+45+101 -intf C:\path_to_project\node_modules\.lsp\Api-ReactJsApp.asti with pwd C:\path_to_project
<< Making lastDefinitions with type error for file:///c%3A/path_to_project/src/ac-common/Api/reason/Api.mli
type error here The command line is too long.

It seems like paths to all subfolders in the src folder (configured in bsconfig) are listed in one command, that is almost 10K characters long. As a result, this error masks any other errors or the possibility to have intellisense in any ReasonML/OCaml code.

I initially suspected it was the same issue as #232, but reverting to 1.4.1 didn't solve the problem.

@jaredly
Copy link
Owner

jaredly commented Apr 3, 2019

wowza

@jaredly
Copy link
Owner

jaredly commented Apr 6, 2019

I don't have much idea about how to go about fixing this ... I wonder how dune does it?

@jaredly jaredly added bug Something isn't working help wanted Extra attention is needed windows things that are windows-specific labels Apr 6, 2019
@xavierzwirtz
Copy link

I have seen other projects solve this by sticking the arguments in a temp text file, and passing the path to that text file instead.

@jaredly
Copy link
Owner

jaredly commented Apr 11, 2019

Would that involve modifying bsc to accept arguments from a file?

@jaredly
Copy link
Owner

jaredly commented Apr 11, 2019

Oh actually - @Yakimych does running bsb from the command line work?

@Yakimych
Copy link
Author

@jaredly - oops, sorry - missed this one completely.

Yes, compiling/building/running from the terminal works just fine - the only issue is that VSCode "fails" with this error and becomes completely useless in terms of displaying other errors, Intellisense, etc.

@bdunn313
Copy link

@jaredly Just to add more color to this issue, running into this problem as well: bsb works for me via the CLI.

Can you help me understand why we need to leverage bsc directly in this package? I'm not super well versed in this world so I'm sure that I'm just ignorant of this low-level stuff, but I'd love to understand the need to use bsc directly any why that's the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed windows things that are windows-specific
Projects
None yet
Development

No branches or pull requests

4 participants