Skip to content

Commit 205c5fe

Browse files
authored
Merge branch 'main' into oxcaml-ci-opam
2 parents 33629e2 + ce35d8c commit 205c5fe

File tree

42 files changed

+188
-119
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+188
-119
lines changed

bench/micro/dune_bench/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
(library
22
(name dune_bench)
3-
(libraries stdune fiber dune_engine dune_rules)
3+
(libraries stdune fiber dune_engine)
44
(library_flags -linkall)
55
(preprocess
66
(pps ppx_bench)))

bench/micro/memo_bench/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
(library_flags -linkall)
44
(preprocess
55
(pps ppx_bench))
6-
(libraries fiber stdune memo core_bench.inline_benchmarks))
6+
(libraries fiber stdune memo))

doc/howto/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ These guides will help you use Dune's features in your project.
2424
rule-generation
2525
override-default-entrypoint
2626
release-binaries-with-github-action
27+
use-opam-alongside-dune-package-management
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
How to Use Opam Alongside Dune Package Management
2+
==================================================
3+
4+
This guide will show you a workflow for gradually adopting Dune Package
5+
Management, while retaining the use of an Opam switch as the default way of
6+
resolving dependencies of a project. It assumes you have a project with
7+
dependencies, and are managing those dependencies with an Opam switch.
8+
By the end of this guide you'll have enabled Dune Package Management for your
9+
project, however by default Dune will still use an Opam switch to resolve your
10+
project's dependencies. By setting an environment variable or passing an extra
11+
argument to commands like ``dune build`` you'll be able to toggle between an
12+
Opam-based workflow and a purely Dune-based workflow.
13+
14+
Create a file named ``dune-workspace`` at the root of your project, with the following
15+
contents:
16+
17+
.. code:: scheme
18+
19+
(lang dune 3.20)
20+
21+
(pkg disabled)
22+
23+
Since ``dune-workspace`` is the default workspace file, this tells Dune that by
24+
default, don't use its internal package management mechanism to resolve the
25+
project's dependencies, even in the presence of a lockdir.
26+
27+
Now create a second file in the project root named ``dune-workspace.pkg``. The
28+
name of this file isn't important, but conventionally alternative workspace
29+
files begin with the ``dune-workspace.`` prefix. Add the following to this new
30+
file:
31+
32+
.. code:: scheme
33+
34+
(lang dune 3.20)
35+
36+
(pkg enabled)
37+
38+
With these two files in place, by default Dune will use the specified Opam
39+
switch to resolve your project's dependencies. However, setting the environment
40+
variable ``DUNE_WORKSPACE=dune-workspace.pkg`` will cause Dune to use
41+
its internal package management mechanism to resolve dependencies instead. Unset
42+
the ``DUNE_WORKSPACE`` environment variable to return to an Opam-based workflow.
43+
44+
Alternatively to setting the ``DUNE_WORKSPACE`` environment variable, invoking
45+
commands like ``dune build``, ``dune exec``, and ``dune pkg lock`` with the
46+
argument ``--workspace=dune-workspace.pkg`` also has the effect of changing
47+
which workspace file Dune will use to the one which enables package management.

otherlibs/dune-rpc-lwt/test/dune

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
(package dune)))
88
(libraries
99
dune_rpc
10-
csexp_rpc
1110
unix
12-
dune_engine
1311
csexp
1412
stdune
1513
lwt

src/dune_config_file/dune_config_file.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ module Dune_config = struct
2525

2626
let equal t { authors; maintainers; maintenance_intent; license } =
2727
Option.equal (List.equal String.equal) t.authors authors
28-
&& Option.equal (List.equal String.equal) t.authors maintainers
29-
&& Option.equal (List.equal String.equal) t.authors maintenance_intent
30-
&& Option.equal (List.equal String.equal) t.authors license
28+
&& Option.equal (List.equal String.equal) t.maintainers maintainers
29+
&& Option.equal (List.equal String.equal) t.maintenance_intent maintenance_intent
30+
&& Option.equal (List.equal String.equal) t.license license
3131
;;
3232

3333
let decode =

src/dune_digest/dune

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
11
(library
22
(name dune_digest)
3-
(libraries
4-
dune_metrics
5-
blake3_mini
6-
dune_stats
7-
dune_console
8-
dune_util
9-
stdune
10-
unix))
3+
(libraries dune_metrics blake3_mini dune_console dune_util stdune unix))

src/dune_engine/dune

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@
2424
dune_util
2525
build_path_prefix_map
2626
dune_output_truncation
27-
csexp_rpc
2827
dune_rpc_private
2928
dune_rpc_client
3029
dune_thread_pool
3130
spawn
32-
ocamlc_loc
3331
dune_file_watcher
3432
dune_digest
3533
dune_metrics)

src/dune_pkg/dune

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
(libraries
88
stdune
99
lmdb
10-
bigstringaf
1110
fiber
1211
fiber_util
1312
chrome_trace

src/dune_rules/dune

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
dune_findlib
2020
dune_glob
2121
dune_lang
22-
dune_meta_parser
2322
dune_patch
2423
dune_pkg
2524
re

0 commit comments

Comments
 (0)