Questions tagged [ocaml-dune]

Use for questions relating to dune, previously jbuilder, a build system for [ocaml] and [reason]

Dune is a build system for and .

Resources

96 questions
2
votes
1 answer

Error: Version 1.11 of dune is not supported

I want to test this project: https://github.com/nt591/monkey-ocaml on my Mac. After downloading the project, dune runtest returned the following error: $ dune runtest File "dune-project", line 1, characters 11-15: 1 | (lang dune 1.11) …
SoftTimur
  • 5,630
  • 38
  • 140
  • 292
2
votes
0 answers

How to run dune build @doc with arguments

I have an ocaml project using Dune. I want to generate documentation using Odoc. Currently, running dune build @doc works, but I want to pass in the -short-functors option to Odoc. How do I pass options to Odoc through Dune?
nosman
  • 95
  • 1
  • 7
2
votes
0 answers

how to use OCaml's Cohttp library to make a HTTPS request

How can I use the Cohttp library to GET a URL over HTTPS? Here is the code I'm trying to use: open Lwt open Cohttp open Cohttp_lwt_unix let url = "https://google.com" let do_request = Client.get (Uri.of_string url) >>= fun (resp, body) -> body…
illabout
  • 3,517
  • 1
  • 18
  • 39
1
vote
1 answer

Why is dune refusing to download dependencies?

I expected dune to automatically download dependencies when running dune build, but that doesn't happen. I've tried multiple variants of this, and I tried with ocaml versions 4.14 and 5.0, and with different dune versions written in the dune-project…
fiatjaf
  • 11,479
  • 5
  • 56
  • 72
1
vote
1 answer

OCaml Module Naming

I'm trying to get started with OCaml, and I've created a new project with: dune init project 01_calorie_counting And that created a sensible enough looking project skeleton: . ├── 01_calorie_counting.opam ├── _build │ └── log ├── bin │ ├── dune │…
ScottishTapWater
  • 3,656
  • 4
  • 38
  • 81
1
vote
1 answer

Including header / footer in a file generated by extraction

I'm using Extraction "foo.ml" main. to extract the relevant parts of my development into an OCaml file, and I'm currently using dune to build everything. For practical reasons, I'm using several native types, and map many functions to library…
nobody
  • 4,074
  • 1
  • 23
  • 33
1
vote
0 answers

build failing on Mac M1 for open ssl ( with killed: 9 error )

I am building an application written in OCaml using yarn and esy. The build process fails trying to build open ssl source code, each time at a random library ( like dsa etc ). For my colleagues using Intel chips, the app builds fine. I am using a…
1
vote
2 answers

How to disable ocamlformat in the vendor folder?

I have OCaml project and in vendor folder I have some libraries that are not of my own, I don't want to run ocamlformat on them I tried this # .ocamlformat profile = default version = 0.24.1 # .ocamlformat-ignore vendor/* But when I run dune build…
geckos
  • 5,687
  • 1
  • 41
  • 53
1
vote
1 answer

Include OCaml library with dune

I'm trying to make an OCaml program that uses the Str library I'm using dune for compiling My Makefile is dune build src/myProgram.exe My dune textfile in the src folder is (env (_ (flags :standard -w -27-26-32-33))) (executable (name myProgram)…
babaoreum
  • 23
  • 5
1
vote
1 answer

How do I add Batteries to the dependency in dune-project?

I am wondering how to add Batteries to the dependency of the dune-project file. It seems the relevant part is: (package ... (depends ocaml dune **here?**) ...) but I have no idea what I should put there.
aqjune
  • 478
  • 1
  • 3
  • 17
1
vote
0 answers

Usage of select with include_subdirs and module in subdirectory

Consider the following file structure in a dune project: ... src/ | +-- analysis/ | +-- file.mli | +-- file.enabled.ml | +-- file.disabled.ml That is, I have an src folder with an analysis subfolder containing two versions…
anol
  • 8,264
  • 3
  • 34
  • 78
1
vote
1 answer

Does dune support glob patterns for libraries?

Background I'm trying to expose two dune libraries from the same directory - one for some interfaces, and the other for their implementations. For example, let's say I have the following sources: foo_api.ml module type Foo = sig val foo:…
Trent Small
  • 1,213
  • 8
  • 12
1
vote
0 answers

Error installation with some OCaml packages

I am trying to install some Ocaml packages but for some reason I am having some errors with installing dune, ocamlbuild, and ocamlfind. By running sudo opam install ocamlfind ounit utop dune qcheck, the following error came up: [ERROR] The…
hnsvhns
  • 31
  • 5
1
vote
0 answers

Is there a way to write dune files programatically from OCaml?

I am generating OCaml code in OCaml. This code includes several Dune files which may be updated and have specific parts change. I am reaching the limit of what I can do with some clever printf, and would like to know if there is an easy way to use…
user3078439
  • 305
  • 1
  • 10
1
vote
1 answer

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 managed to generate .mly, .mli, .ml, .cmi and .cmo of…
SoftTimur
  • 5,630
  • 38
  • 140
  • 292