hackwaly/ocamlearlybird

Unsupported file format error

Opened this issue · 10 comments

Anytime I run the extension, I get this un-informative error "Unsupported file format". This is my launch.json file:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Ocamlearlybird",
            "type": "ocamlearlybird",
            "request": "launch",
            "program": "${workspaceRoot}/_build/default/src/main/main.exe",
            "console": "integratedTerminal",
            "cwd": "${workspaceRoot}",
            "arguments": ["${workspaceRoot}/src/tests/test_code/parser.mly"],
            "dotMerlins": [
                "${workspaceRoot}/.merlin"
            ],
            "noDebug": false,
            "stopOnEntry": false
        }
    ]
}

What's the version of your ocaml compiler?

There are two sections to this comment.

(1)
When I run Ocamlearlybird, I get a "unsupported file format" error. This is how I get the error -
I enter into VS Code a hello world program - print_string "Hello world!\n";;
I click "Run without Debugging".
Under "Select Environment" (pull down menu), I select Ocamlearlybird.
I get the "Unsupported file format" error.

(2) When I launch a terminal and type in the following commands -
$ ocamlc -o helloworld helloworld.ml # to compile 'helloworld.ml' into an executable 'helloworld'
$ ./helloworld # to run the program
, I successfully get a "Hello world! output.

Question - I would like to use the first method (clicking on "Run without Debugging") to get the "Hello world!" output. What must I do?

The debuggee program should be bytecode file. Native executable is not supported. And currently only ocaml.4.10 4.11 is supported

bytecode

how to provide bytecode file in this case.

I have same problem. I followed the example [https://i.imgur.com/U3GDHXM.gif], but get "Unsupported file format".

I test with Ocaml Version 4.14.0 and 5.0.0 and get same problem. What should I do?

You need install the ext built from master branch

You need install the ext built from master branch

I clone this repo and install with "opam install .". If I command ocamlearlybird --help, I can get Ocamlearybird Manual. Anything more to do?

sim642 commented

Right now you also need to build the VSCode extension yourself. The one published on VSCode marketplace isn't compatible with newer OCaml versions.

sim642 commented

By the way, I'm planning to revive the effort to simply make the official VSCode OCaml Platform extension take care of that side: ocamllabs/vscode-ocaml-platform#534 and ocamllabs/vscode-ocaml-platform#650.
This should make the process more user-friendly.

Right now you also need to build the VSCode extension yourself. The one published on VSCode marketplace isn't compatible with newer OCaml versions.

It works well. Thank you so much. I look forward to being added to the offical OCaml Platform extension.