Quantcast
Channel: OCaml - Topics tagged dune
Browsing all 517 articles
Browse latest View live

Dune: how to depend and include a generated .js file into a .ml

Hi, I have a web server library which should embed a js_of_ocaml-generated .js file. Embedding is done using ppx_blob. But I can’t find the way to: tell dune that this library depends on this...

View Article


[dune] How to specify dependency to an executable?

I’m developing an executable and want to cram-test it. But I don’t know a way to add a strict dependency from tests to my executable. MVP. The call dune build @install && dune test helps but I...

View Article


Problems compiling ppx package

Im trying to make a ppx rewriter. It already compiled just fine, but now I want to test it. So I wrote a public_name into my dune and made a .opam file. But I get the error: (according to opam...

View Article

Dune can't find my module Lex

I have been using ocamlbuild but am trying to switch to Dune. I’m getting the error message “Error: Unbound module Lex” even though the source file for my lexer, lex.mll, is in the same directory as...

View Article

Make a binary depend on non-code files in Dune

I have an OCaml binary that I’m building and installing through Dune. The binary depends on non-code files that are also being generated and installed by dune. Currently I’m using the sites mechanism...

View Article


Dune: changing `js_of_ocaml link` flags

By default in the dev profile, dune runs js_of_ocaml link with the --source-map-inline flag. I want to disable this, but I can’t seem to find a way to change the flags sent to link (just the main...

View Article

Where a library without expanded ppx_inline_tests is located in `_build`?...

I’m writing a library with ppx_inline_test and I want to link this library to my ppx and camlp5 rewriters. For historical reasons I was compiling PPX and camlp5 rewriters using custom dune (rule ...)...

View Article

How to pass flags to dune?

I am trying to write a compiler for a simple C inspired language. My dune file looks like this (ocamllex scanner) (ocamlyacc mylanguageparse) (executable (name mylanguage) (libraries llvm...

View Article


How to package Javascript stubs / support code

Background: I’m trying to create OCaml (js_of_ocaml) bindings to the tree-sitter.js library. My repository is at GitHub - joelburget/brr-web-tree-sitter: Ocaml (Brr) bindings to web-tree-sitter....

View Article


Tool to compute dependencies between OCaml modules in a dune project?

Hi, I’m looking for a tool that automatically computes the fine-grained dependencies between the .ml files of a dune project. Does such a tool exist already ? More precisely: given a dune-managed...

View Article

How to dunify project that uses volt

I’m a little confused about the dependencies of the modules involved. --hello.ml-- let foo = "bar" in INFO_MSG "msg %s" foo; --dune-- (executable (name hello) (preprocess (action (run camlp4 -I...

View Article

Opam install does not install dependencies automatically

Hi, I’m building a project with opam and dune. According to the documentation of opam, command opam install . --deps-only --working-dir should install all the dependencies for me, but it didn’t do...

View Article

How does one create a proper OCaml project?

How do I use files like Makefiles, dune, _tags, .ocamlinit, and other to make a proper OCaml project? What do I have to do to be able to use online libraries into my projects? And finally, what...

View Article


Having an outside library and using it for a project

Hello, I’m having trouble setting up my project. Here is a the structure of my directory : ├─ lib │ ├── lib1 │ │ ├── dune │ │ ├── lib1.ml │ │ └── lib1.mli │ ├── lib2 │ │ ├── dune │ │ └── lib2.ml │ └──...

View Article

Question on opam, dune, and managing multiple projects in git submodules

What are people doing to manage dependencies when a repository contain multiple dune projects (possibly in git submodule)? For example I have dir1/foo.opam that has some opam dependencies, but depends...

View Article


Supporting both standard and multicore compilers in a dune project

I am developing a library which uses multicore. However to support users on Mac M1, I would like to provide a version of the library which can be compiled with a standard (non-multicore) compiler. All...

View Article

Module ... is used in several stanzas

I’ve written a bunch of ml files that I’d like to pull together into multiple executables that pipeline together nicely because they share types defined in one ml file. Dune firstly objects to...

View Article


Image may be NSFW.
Clik here to view.

Dune build error

Hi, I am new to Ocaml, and follow this tutorial, try a helloworld , run dune build, it doesn’t work as I expected. dune version: 3.0.2 ocaml: 4.11.1 How can I solve this? 17 posts - 5 participants...

View Article

Generate a parser enabling incremental API and inspection API

I have a big project built by menhir and traditional makefile. First, I wanted to add a mechanism of error handling like this project to my project. By following the dune of the sample project, I...

View Article

Dependency cycle while boostrapping dune 3.0

It seems dune 3.0 can not be bootstrapped anymore if there is just an ocaml compiler. I’m running ocaml configure.ml && ocaml bootstrap.ml, then declare ./dune.exe as dune by putting it first...

View Article
Browsing all 517 articles
Browse latest View live