Closed villesau closed 5 years ago
I have not enough time to address your issue. You can use ocaml-debugger to debug ocaml-debugger to debug flow to check out what happens.
First you need clone git@github.com:hackwaly/ocamlearlybird.git, Use vscode open the project folder. Then use this configuration to debug ocamlearlybird.
{
"name": "Debugger",
"type": "ocaml-debugger",
"request": "launch",
"program": "${workspaceRoot}/_build/default/ocaml_debug_adapter/main.bc",
"arguments": ["--server", "--port=4712"],
"preLaunchTask": "build",
"console": "internalConsole",
"env": {
"OCAMLRUNPARAM": "b"
}
},
Then use the debugged ocamlearlybird to debug flow:
{
"name": "OCaml",
"type": "ocaml-debugger",
"request": "launch",
"program": "${workspaceFolder}/bin/flow",
"console": "internalConsole",
"stopOnEntry": false,
"arguments": ["check", "${workspaceFolder}/my-own-test/test.js", "--max-workers", "0"],
"debugServer": 4712
}
Hi @hackwaly,
In sessiom.ml Initialize_command gets following args:
and Launch_command gets following args:
Also noticed that the program is apparently launched with ocamlrun
command? Something like: ocamlrun bin/flow check my-own-test/test.js --max-workers 0
but when running that manually I'm getting:
Fatal error: unknown C primitive `unix_waitpid'
Maybe this is the culprit? Taking the ocamlrun
off runs the program fine. I'm trying to debug on macOS.
E: When downgrading Ocaml from 4.06.0 to 4.05.0, the error changes to:
Fatal error: unknown C primitive `caml_floatarray_create'
Looks like this issue https://github.com/ocaml-community/utop/issues/34
@villesau This should be fixed as I removed the unnecessary ocamlrun
.
Track progress https://github.com/ocaml/opam-repository/pull/13149
@hackwaly Nice, thanks! Works like a charm now!
Flow has issue of debugging, and people has succeeded to debug it with certain configurations: https://github.com/facebook/flow/issues/4181
Anyhow, with
vscode-ocaml-debugger
I have not been able to start debug session with flow. Looks like nothing happens with following config, just endless blue loading bar appears and thats it:Would be nice to see some logging if there is e.g something that goes wrong.