113 questions
0 votes
0 answers
28 views
How can I copy a file (index.html) to the same directory as the one (*.js) just built using dune?
I have the following tree for a webapp project. I'd like to copy the index.html file to the same _build directory that the built javascript gets placed in. I tried using ChatGPT a few days ago but all ...
0 votes
0 answers
81 views
How to include an icon file in the source?
I am developing a server with Ocaml/Dream. The server can be installed with Opam and called from anywhere in the disk. For the server icon, I use : Dream.get (favicon_path) (fun request -> ...
0 votes
1 answer
211 views
Unbound module error in dune project even with library specified in build config
let read_file path = In_channel.with_open_bin path In_channel.input_all let solve input = input let () = read_file "input.txt" |> solve |> print_endline I am currently trying ...
0 votes
0 answers
61 views
How to debug this makefile error on a dune project
I cloned this repo https://github.com/cucapra/gator and tried to run the makefile as per the first instruction in README. It seems to have already setup a dune project and just needs a build but I ...
2 votes
1 answer
103 views
How to access private definition from other library for testing
I have two libraries: lib/ dune src.ml src.mli test/ dune test.ml both are libraries and I am testing in the test library with ppx_inline_test as i do not want them to be ...
0 votes
1 answer
99 views
How can I run inline unit tests in ocamldebug?
With the Dune buildsystem, it is easy to output a bytecode file for an executable for use with ocamldebug. However, it isn't clear how to do the same with inline unit tests; the Dune docs say how to ...
0 votes
1 answer
394 views
Installing Opam and OCaml on Windows with WSL Ubuntu
I am trying to install OCaml on Windows using WSL. I followed these instructions: Install WSL So I opened a PowerShell and typed wsl --install After having rebooted, I started the Windows Command ...
0 votes
0 answers
82 views
How do you connect a src module in Melange with it's associated test file that's using Melange-Jest?
I have a Melange project with the following directory structure: ├── src │ ├── dune │ ├── App.re ├── __tests__ │ ├── dune │ ├── App_test.re The dune files in both the src and __tests__ ...
2 votes
1 answer
161 views
Include Non-OCaml/Reason Files in Dune Build?
I'm new to OCaml and Dune, and I'm trying to set up a basic project with test cases. I want my test module to be able to read in text files from a subdirectory and process the input of those files. ...
0 votes
1 answer
484 views
Library ounit2 not found
I want to run unit test with OCaml and OUnit2 I have followed the instructions in this tutorial https://cs3110.github.io/textbook/chapters/data/ounit.html However, when I run dune build I get the ...
0 votes
1 answer
93 views
How to solve linking problem on Z3 in OCaml?
when I suppose to use Z3 lib in OCaml open Z3 the first line is getting Unbound module Z3, which is not able to solve. the code is able to run correctly when I add #use "topfind";; #require ...
0 votes
1 answer
378 views
Downgrade Dune/Opam OR workaround for dune build
I have just installed ocaml, opam and dune on my computer and tried to run a new project using $ dune init project calculator $ cd calculator/ $ code . which creates the project and opens it in VS ...
0 votes
1 answer
251 views
How to generate Menhir .automaton files with dune in OCaml?
I'm trying to generate .automaton files I added this to the dune file inside lib/ folder (menhir (flags --explain --dump) (modules parser)) Then I run dune build, if I do find . -name '*....
0 votes
1 answer
465 views
Installing Dune with the help of Opam
I have somehow managed to install Opam on MSYS2 on Windows. When I open the MSYS2 MING64 (the blue one) shell and enter opam --version it tells me that it is installed. When I run opam install dune ,...
4 votes
0 answers
996 views
ocaml-lsp-server giving "unbound module" errors
I am developing an Ocaml project using WSL and VSCode with the Ocaml Platform extension running ocaml-lsp-server. My project builds and runs correctly, but in VSCode there are a bunch of red squiggly ...