Have you tried copying all the files in the debugger directory (+ genprintval.ml* from the toplevel directory) into a separate directory, and sticking a standard dune file in it ? The debugger is relatively independent, it depends on compiler-libs.common, unix and dynlink but you should be able to build it from the installed versions of the libraries. I assume that ocaml-lsp would work as expected in this situation.
Don’t forget to declare it as a bytecode-only project; ocamldebug isn’t supposed to be compiled to a native executable.
I had only printed a small excerpt of the dune file above to indicate it was all commented out. Here is the full dune file ( debugger/dune ):
;**************************************************************************
;* *
;* OCaml *
;* *
;* Thomas Refis, Jane Street Europe *
;* *
;* Copyright 2018 Jane Street Group LLC *
;* *
;* All rights reserved. This file is distributed under the terms of *
;* the GNU Lesser General Public License version 2.1, with the *
;* special exception on linking described in the file LICENSE. *
;* *
;**************************************************************************
; mshinwell: Disabled for now -- otherlibs/dynlink/dune needs fixing first.
;(ocamllex lexer)
;(ocamlyacc parser)
;
;(executable
; (name main)
; (modes byte)
; (flags (:standard -w -9))
; (modules_without_implementation parser_aux)
; (libraries ocamlcommon ocamltoplevel runtime stdlib unix))
;
;(rule (copy main.exe ocamldebug.byte))
I wasn’t suggesting to reuse the dune file. You should write a new, standard dune file.
If you absolutely want to start from the existing file, I assume that you simply need to remove the rule stanza and replace the libraries with the installed versions (compiler-libs.common, unix, dynlink). But I’m far from an expert on dune.
Thanks for your help so far. Yes you were not suggesting removal of the comments. You were suggesting a different strategy – though I think that might be even more complicated than just messing around with the current dune file in-situ.
I was able to make more progress by changing the lex and parser related dune lines: