Quantcast
Channel: OCaml - Topics tagged dune
Viewing all articles
Browse latest Browse all 536

Use Dune to compile a specific file, in memory (stdin?)

$
0
0

Suppose I have a dune project with such a basic structure:

dune-project
src/
  dune
  main.ml
lib/
  dune
  myFile.ml

If I have a different version of myFile (or main.ml) in-memory only, I want to use dune to compile that version of the file and get the compilation output for errors or warnings.

is one of this possible?:

  • can I ask dune to compile that edited source code from stdin and get the compilation output ? (ideal scenario)
  • can I save the file to a temp directory and ask dune to build just that file from a project directory ?
  • If not possible can I ask dune for some compilation flags and use ocamlc to do the compilation ?

context: this is for editor integration. I don’t use LSP/merlin.

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 536