Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wasm_of_ocaml support #11093

Merged
merged 26 commits into from
Nov 5, 2024
Merged

Conversation

vouillon
Copy link
Member

@vouillon vouillon commented Nov 4, 2024

@hhugo @rgrinberg This is an alternative design. What do you think about it?

This adds a wasm mode. All the js_of_ocaml options are duplicated as wasm_of_ocaml options. There is a (js_of_ocaml (enabled_if <blang expression>)) and (wasm_of_ocaml (enabled_if <blang expression>)) option in env and executable stanzas to control whether the js and wasm modes are enabled.

I have not updated the documentation yet.

@vouillon vouillon force-pushed the wasm_of_ocaml-alternative branch from 3c35724 to 8122af8 Compare November 4, 2024 11:53
doc/wasmoo.rst Outdated
.. code:: console

$ dune build ./foo.bc.wasm.js
$ node _build/default/foo.bc.wasm.js
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do I need to specify the submodes here? Dune could find out what to build for this wasm.js target on its own, isn't it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation has not been updated. That should be the following above:

(executable (name foo) (modes wasm))

But yes, you can just use dune build.

Not that this was just copied from the Js_of_ocaml part of the doc:

dune/doc/jsoo.rst

Lines 38 to 44 in b409963

And then request the ``.js`` target:
.. code:: console
$ dune build ./foo.bc.js
$ node _build/default/foo.bc.js
hello from js

@vouillon vouillon force-pushed the wasm_of_ocaml-alternative branch 2 times, most recently from 83731d5 to ec321a5 Compare November 4, 2024 13:20
Copy link
Collaborator

@hhugo hhugo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a quick look, I think I prefer this approach better.

It seems you have not implemented the generation of a bc.js when js_of_ocaml is disabled, do you still want it ?

Js_of_ocaml.Mode.Set.inter jsoo_enabled_modes jsoo_is_whole_program
in
let bytecode_exe_needed =
L.Map.foldi
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

L.Map.exists

| Wasm -> Exe.Linkage.wasm
in
if Js_of_ocaml.Mode.Pair.select ~mode:jsoo_mode jsoo_is_whole_program
then [ Exe.Linkage.byte_for_jsoo; linkage ]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we have an issue if byte_for_jsoo appears twice (once for js and once for wasm)

| JS
| Wasm

let equal = Poly.equal
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let equal = Poly.equal
let equal (a : t) b = Poly.equal a b

let union = Pair.map2 ~f:( || )
let is_empty (x : t) = not (x.js || x.wasm)

let to_list (x : t) =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let to_list (x : t) =
let to_list ({ wasm; js}: t) =

Comment on lines 162 to 163
match mode with
| Mode.JS -> "js"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
match mode with
| Mode.JS -> "js"
match (mode : Mode.t) with
| JS -> "js"

@@ -242,6 +358,7 @@ module Env = struct
; sourcemap = None
; runtest_alias = None
; flags = Flags.default ~profile
; enabled_if = Some Blang.true_
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why Some and not None ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is so that we don't need a case for None there:

(match parent.enabled_if with
| Some (Const default) -> default
| _ -> assert false)

(match js_of_ocaml.enabled_if with
| Some (Const default) -> Memo.return default
| _ -> assert false)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be either to read if there were less hidden invariants. What do you think of the following ?

diff --git a/src/dune_rules/jsoo/js_of_ocaml.ml b/src/dune_rules/jsoo/js_of_ocaml.ml
index dc2fad30a..2c8c8e185 100644
--- a/src/dune_rules/jsoo/js_of_ocaml.ml
+++ b/src/dune_rules/jsoo/js_of_ocaml.ml
@@ -358,7 +358,7 @@ module Env = struct
     ; sourcemap = None
     ; runtest_alias = None
     ; flags = Flags.default ~profile
-    ; enabled_if = Some Blang.true_
+    ; enabled_if = None
     }
   ;;
 end
diff --git a/src/dune_rules/jsoo/jsoo_rules.ml b/src/dune_rules/jsoo/jsoo_rules.ml
index b10ac8f27..98b29afeb 100644
--- a/src/dune_rules/jsoo/jsoo_rules.ml
+++ b/src/dune_rules/jsoo/jsoo_rules.ml
@@ -12,18 +12,16 @@ let compute_env ~mode =
         let local = Js_of_ocaml.Mode.select ~mode local.js_of_ocaml local.wasm_of_ocaml in
         let* parent = parent in
         let+ enabled_if =
-          match local.enabled_if with
-          | None ->
-            Memo.return
-              (match parent.enabled_if with
-               | Some (Const default) -> default
-               | _ -> assert false)
-          | Some enabled_if -> Expander.eval_blang expander enabled_if
+          match Option.first_some local.enabled_if parent.enabled_if with
+          | Some enabled_if ->
+            let+ v = Expander.eval_blang expander enabled_if in
+            Some (Blang.Const v)
+          | None -> Memo.return None
         in
         { Js_of_ocaml.Env.compilation_mode =
             Option.first_some local.compilation_mode parent.compilation_mode
         ; sourcemap = Option.first_some local.sourcemap parent.sourcemap
-        ; enabled_if = Some (Const enabled_if)
+        ; enabled_if
         ; runtest_alias = Option.first_some local.runtest_alias parent.runtest_alias
         ; flags =
             Js_of_ocaml.Flags.make
@@ -601,8 +599,8 @@ let jsoo_enabled
   | None ->
     let* js_of_ocaml = jsoo_env ~dir ~mode in
     (match js_of_ocaml.enabled_if with
-     | Some (Const default) -> Memo.return default
-     | _ -> assert false)
+     | Some enabled_if -> eval enabled_if
+     | None -> Memo.return true)
 ;;
 
 let jsoo_enabled_modes ~expander ~dir ~in_context =

| Some x -> Memo.return x
in
let runtime_files = javascript_files @ wasm_files in
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks weird. Is it the case that wasm_files is always empty when mode is js ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's the case:

and+ wasm_files =
match mode with
| Mode.JS -> return []
| Wasm ->
field
"wasm_files"
(Dune_lang.Syntax.since Stanza.syntax (3, 17) >>> repeat string)
~default:[]

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could add an assertion.

@hhugo
Copy link
Collaborator

hhugo commented Nov 4, 2024

@vouillon could you submit a version of ocsigen/js_of_ocaml#1724 using this PR ?

@vouillon
Copy link
Member Author

vouillon commented Nov 4, 2024

It seems you have not implemented the generation of a bc.js when js_of_ocaml is disabled, do you still want it ?

It does not fit well. For the wasm_of_ocaml test suite, I have switched to using dune test stanzas and only had to add a few rules to copy a bc.wasm.js file to bc.js.

@vouillon
Copy link
Member Author

vouillon commented Nov 4, 2024

See ocsigen/js_of_ocaml#1726

@vouillon vouillon force-pushed the wasm_of_ocaml-alternative branch from 9f3eb50 to 4a389d5 Compare November 4, 2024 20:27
@maiste maiste added the jsoo label Nov 5, 2024
@hhugo
Copy link
Collaborator

hhugo commented Nov 5, 2024

This looks good, I left one last suggestion. The documentation still needs to be updated

vouillon and others added 15 commits November 5, 2024 12:46
Signed-off-by: Jérôme Vouillon <jerome.vouillon@gmail.com>
Signed-off-by: Jérôme Vouillon <jerome.vouillon@gmail.com>
Signed-off-by: Jérôme Vouillon <jerome.vouillon@gmail.com>
Signed-off-by: Jérôme Vouillon <jerome.vouillon@gmail.com>
Signed-off-by: Jérôme Vouillon <jerome.vouillon@gmail.com>
Signed-off-by: Jérôme Vouillon <jerome.vouillon@gmail.com>
Signed-off-by: Jérôme Vouillon <jerome.vouillon@gmail.com>
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
Signed-off-by: Jérôme Vouillon <jerome.vouillon@gmail.com>
Signed-off-by: Jérôme Vouillon <jerome.vouillon@gmail.com>
@@ -110,11 +110,17 @@ end = struct
(List.rev_concat_map
~f:(List.rev_map ~f:(fun f -> Section.Lib, f))
(let { Mode.Dict.byte; native } = Lib_info.archives lib in
let jsoo_files =
(* A same runtime file can be used both for jsoo and wasmoo *)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that comment still make sense now that jsoo and wasm options are different ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it still makes sense. In particular, one may want to pass a JavaScript file to wasm_of_ocaml to get some primitive purity information. Or one need to include some JavaScript code both when generating JavaScript and Wasm code. For instance, I have this for the virtual_dom package:

 (js_of_ocaml
  (javascript_files ../lib/virtualdom.compiled.js ./thunk.js ./hooks.js))
 (wasm_of_ocaml
  (javascript_files ../lib/virtualdom.compiled.js ./thunk.js ./hooks.js))

let name = Path.basename fn in
let dir = in_build_dir build_context ~config [ lib_name ] in
let in_context =
{ Js_of_ocaml.In_context.flags = Js_of_ocaml.Flags.standard
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be Js_of_ocaml.In_context.default ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is your code...
But yes, that should work.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is your code...

I know

(Js_of_ocaml.In_buildable.decode ~executable ~mode:JS)
~default:Js_of_ocaml.In_buildable.default
and+ wasm_of_ocaml =
let executable =
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could be lifted up and shared with the one inside js_of_ocaml above

@hhugo
Copy link
Collaborator

hhugo commented Nov 5, 2024

@hhugo I'm not completely sure what to do about the ```(wasm_of_ocaml (sourcemap ))option. The distinction betweenfile` and `inline` does not really make sense: there is no inline source maps in Wasm and the source maps are going to be in the `.bc.wasm.asset` directory. I can keep the three options `no`, file or ``inline`` to stay in line with Js_of_ocaml. Or I can have just two options ``yes`` / ``no``.

I don't know either. We could also let dune complain if one tries to use inline with wasm.

Signed-off-by: Jérôme Vouillon <jerome.vouillon@gmail.com>
@vouillon vouillon force-pushed the wasm_of_ocaml-alternative branch from daa107e to be2bd4a Compare November 5, 2024 15:38
@vouillon
Copy link
Member Author

vouillon commented Nov 5, 2024

I don't know either. We could also let dune complain if one tries to use inline with wasm.

Or rather it should complain for file since one does not generate a separate .map target file?

"compilation_mode"
(Dune_lang.Syntax.since Stanza.syntax (3, 17) >>> Compilation_mode.decode)
else return None
only_in_library
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be only_in_executable

Signed-off-by: Jérôme Vouillon <jerome.vouillon@gmail.com>
Signed-off-by: Jérôme Vouillon <jerome.vouillon@gmail.com>
@vouillon vouillon force-pushed the wasm_of_ocaml-alternative branch from 734967d to aea189c Compare November 5, 2024 15:51
=================

Dune has full support for building wasm_of_ocaml libraries and executables transparently.
There's no need to customise or enable anything to compile OCaml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the documentation mention the external dependencies that are required for the build ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I now explicitly point to the github repository above.

Copy link
Collaborator

@hhugo hhugo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. One will need to squash commits before merging

Signed-off-by: Jérôme Vouillon <jerome.vouillon@gmail.com>
Signed-off-by: Jérôme Vouillon <jerome.vouillon@gmail.com>
Signed-off-by: Jérôme Vouillon <jerome.vouillon@gmail.com>
@vouillon vouillon force-pushed the wasm_of_ocaml-alternative branch from 9c5c761 to f76b05e Compare November 5, 2024 17:04
@vouillon
Copy link
Member Author

vouillon commented Nov 5, 2024

I have made another clean-up pass.
I have also disallowed the enable_if option in libraries, like other build-related options.

@vouillon vouillon changed the title Wasm of ocaml support: alternative design Wasm of ocaml support Nov 5, 2024
@vouillon vouillon changed the title Wasm of ocaml support Wasm_of_ocaml support Nov 5, 2024
with:
ocaml-compiler: 4.14.x
opam-pin: false
opam-depext: false
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opam depext is unused in setup-ocaml v3

Signed-off-by: Jérôme Vouillon <jerome.vouillon@gmail.com>
@rgrinberg rgrinberg merged commit 3995bb5 into ocaml:main Nov 5, 2024
28 checks passed
@rgrinberg
Copy link
Member

LGTM. Feel free to send the docs in another PR

@vouillon vouillon deleted the wasm_of_ocaml-alternative branch November 6, 2024 10:19
maiste added a commit to maiste/opam-repository that referenced this pull request Nov 25, 2024
CHANGES:

### Fixed

- Show the context name for errors happening in non-default contexts.
  (ocaml/dune#10414, fixes ocaml/dune#10378, @jchavarri)

- Correctly declare dependencies of indexes so that they are rebuilt when
  needed. (ocaml/dune#10623, @voodoos)

- Don't depend on coq-stdlib being installed when expanding variables
  of the `coq.version` family (ocaml/dune#10631, fixes ocaml/dune#10629, @gares)

- Error out if no files are found when using `copy_files`. (ocaml/dune#10649, @jchavarri)

- Re_export dune-section private library in the dune-site library stanza,
  in order to avoid failure when generating and building sites modules
  with implicit_transitive_deps = false. (ocaml/dune#10650, fixes ocaml/dune#9661, @MA0100)

- Expect test fixes: support multiple modes and fix dependencies when there is
  a custom runner (ocaml/dune#10671, @vouillon)

- In a `(library)` stanza with `(extra_objects)` and `(foreign_stubs)`, avoid
  double linking the extra object files in the final executable.
  (ocaml/dune#10783, fixes ocaml/dune#10785, @nojb)

- Map `(re_export)` library dependencies to the `exports` field in `META` files,
  and vice-versa. This field was proposed in to
  https://discuss.ocaml.org/t/proposal-a-new-exports-field-in-findlib-meta-files/13947.
  The field is included in Dune-generated `META` files only when the Dune lang
  version is >= 3.17.
  (ocaml/dune#10831, fixes ocaml/dune#10830, @nojb)

- Fix staged pps preprocessors on Windows (which were not working at all
  previously) (ocaml/dune#10869, fixes ocaml/dune#10867, @nojb)

- Fix `dune describe` when an executable is disabled with `enabled_if`.
  (ocaml/dune#10881, fixes ocaml/dune#10779, @moyodiallo)

- Fix an issue where C stubs would be rebuilt whenever the stderr of Dune was
  redirected. (ocaml/dune#10883, fixes ocaml/dune#10882, @nojb)

- Format long lists in s-expressions to fill the line instead of formatting
  them in a vertical way (ocaml/dune#10892, fixes ocaml/dune#10860, @nojb)

- Fix the URL opened by the command `dune ocaml doc`. (ocaml/dune#10897, @gridbugs)

- Fix the file referred to in the error/warning message displayed due to the
  dune configuration version not supporting a particular configuration
  stanza in use. (ocaml/dune#10923, @H-ANSEN)

- Fix `enabled_if` when it uses `env` variable. (ocaml/dune#10936, fixes ocaml/dune#10905, @moyodiallo)

- Fix exec -w for relative paths with --root argument (ocaml/dune#10982, @gridbugs)

- Do not ignore the `(locks ..)` field in the `test` and `tests` stanza
  (ocaml/dune#11081, @rgrinberg)

- Tolerate files without extension when generating merlin rules.
  (ocaml/dune#11128, @anmonteiro)

### Added

- Make Merlin/OCaml-LSP aware of "hidden" dependencies used by
  `(implicit_transitive_deps false)` via the `-H` compiler flag. (ocaml/dune#10535, @voodoos)

- Add support for the -H flag (introduced in OCaml compiler 5.2) in dune
  (requires lang versions 3.17). This adaptation gives
  the correct semantics for `(implicit_transitive_deps false)`.
  (ocaml/dune#10644, fixes ocaml/dune#9333, ocsigen/tyxml#274, ocaml/dune#2733, ocaml/dune#4963, @MA0100)

- Add support for specifying Gitlab organization repositories in `source`
  stanzas (ocaml/dune#10766, fixes ocaml/dune#6723, @H-ANSEN)

- New option to control jsoo sourcemap generation in env and executable stanza
  (ocaml/dune#10777, fixes ocaml/dune#10673, @hhugo)

- One can now control jsoo compilation_mode inside an executable stanza
  (ocaml/dune#10777, fixes ocaml/dune#10673, @hhugo)

- Add support for specifying default values of the `authors`, `maintainers`, and
  `license` stanzas of the `dune-project` file via the dune config file. Default
  values are set using the `(project_defaults)` stanza (ocaml/dune#10835, @H-ANSEN)

- Add names to source tree events in performance traces (ocaml/dune#10884, @jchavarri)

- Add `codeberg` as an option for defining project sources in dune-project
  files. For example, `(source (codeberg user/repo))`. (ocaml/dune#10904, @nlordell)

- `dune runtest` can now run individual tests with `dune runtest mytest.t`
  (ocaml/dune#11041, @Alizter).

- Wasm_of_ocaml support (ocaml/dune#11093, @vouillon)

- Add a `coqdep_flags` field to the `coq` field of the `env` stanza, and to the `coq.theory` stanza, allowing to configure `coqdep` flags.
  (ocaml/dune#11094, @rlepigre)

### Changed

- Remove all remnants of the experimental `patch-back-source-tree`. (ocaml/dune#10771,
  @rgrinberg)

- Change the preset value for author and maintainer fields in the
  `dune-project` file to encourage including emails. (ocaml/dune#10848, @punchagan)

- Tweak the preset value for tags in the `dune-project` file to hint at topics
  not having a special meaning. (ocaml/dune#10849, @punchagan)

- Change some colors to improve readability in light-mode terminals
  (ocaml/dune#10890, @gridbugs)

- Forward the linkall flag to jsoo in whole program compilation as well (ocaml/dune#10935, @hhugo)

- Configurator uses `pkgconf` as pkg-config implementation when available
  and forwards it the `target` of `ocamlc -config`. (ocaml/dune#10937, @pirbo)

- Enable Dune cache by default. Add a new Dune cache setting
  `enabled-except-user-rules`, which enables the Dune cache, but excludes
  user-written rules from it. This is a conservative choice that can avoid
  breaking rules whose dependencies are not correctly specified. This is the
  current default. (ocaml/dune#10944, ocaml/dune#10710, @nojb, @ElectreAAS)

- Do not add `dune` dependency in `dune-project` when creating projects with
  `dune init proj`. The Dune dependency is implicitely added when generating
  opam files (ocaml/dune#11129, @Leonidas-from-XIV)
maiste added a commit to maiste/opam-repository that referenced this pull request Nov 27, 2024
CHANGES:

### Fixed

- Show the context name for errors happening in non-default contexts.
  (ocaml/dune#10414, fixes ocaml/dune#10378, @jchavarri)

- Correctly declare dependencies of indexes so that they are rebuilt when
  needed. (ocaml/dune#10623, @voodoos)

- Don't depend on coq-stdlib being installed when expanding variables
  of the `coq.version` family (ocaml/dune#10631, fixes ocaml/dune#10629, @gares)

- Error out if no files are found when using `copy_files`. (ocaml/dune#10649, @jchavarri)

- Re_export dune-section private library in the dune-site library stanza,
  in order to avoid failure when generating and building sites modules
  with implicit_transitive_deps = false. (ocaml/dune#10650, fixes ocaml/dune#9661, @MA0100)

- Expect test fixes: support multiple modes and fix dependencies when there is
  a custom runner (ocaml/dune#10671, @vouillon)

- In a `(library)` stanza with `(extra_objects)` and `(foreign_stubs)`, avoid
  double linking the extra object files in the final executable.
  (ocaml/dune#10783, fixes ocaml/dune#10785, @nojb)

- Map `(re_export)` library dependencies to the `exports` field in `META` files,
  and vice-versa. This field was proposed in to
  https://discuss.ocaml.org/t/proposal-a-new-exports-field-in-findlib-meta-files/13947.
  The field is included in Dune-generated `META` files only when the Dune lang
  version is >= 3.17.
  (ocaml/dune#10831, fixes ocaml/dune#10830, @nojb)

- Fix staged pps preprocessors on Windows (which were not working at all
  previously) (ocaml/dune#10869, fixes ocaml/dune#10867, @nojb)

- Fix `dune describe` when an executable is disabled with `enabled_if`.
  (ocaml/dune#10881, fixes ocaml/dune#10779, @moyodiallo)

- Fix an issue where C stubs would be rebuilt whenever the stderr of Dune was
  redirected. (ocaml/dune#10883, fixes ocaml/dune#10882, @nojb)

- Fix the URL opened by the command `dune ocaml doc`. (ocaml/dune#10897, @gridbugs)

- Fix the file referred to in the error/warning message displayed due to the
  dune configuration version not supporting a particular configuration
  stanza in use. (ocaml/dune#10923, @H-ANSEN)

- Fix `enabled_if` when it uses `env` variable. (ocaml/dune#10936, fixes ocaml/dune#10905, @moyodiallo)

- Fix exec -w for relative paths with --root argument (ocaml/dune#10982, @gridbugs)

- Do not ignore the `(locks ..)` field in the `test` and `tests` stanza
  (ocaml/dune#11081, @rgrinberg)

- Tolerate files without extension when generating merlin rules.
  (ocaml/dune#11128, @anmonteiro)

### Added

- Make Merlin/OCaml-LSP aware of "hidden" dependencies used by
  `(implicit_transitive_deps false)` via the `-H` compiler flag. (ocaml/dune#10535, @voodoos)

- Add support for the -H flag (introduced in OCaml compiler 5.2) in dune
  (requires lang versions 3.17). This adaptation gives
  the correct semantics for `(implicit_transitive_deps false)`.
  (ocaml/dune#10644, fixes ocaml/dune#9333, ocsigen/tyxml#274, ocaml/dune#2733, ocaml/dune#4963, @MA0100)

- Add support for specifying Gitlab organization repositories in `source`
  stanzas (ocaml/dune#10766, fixes ocaml/dune#6723, @H-ANSEN)

- New option to control jsoo sourcemap generation in env and executable stanza
  (ocaml/dune#10777, fixes ocaml/dune#10673, @hhugo)

- One can now control jsoo compilation_mode inside an executable stanza
  (ocaml/dune#10777, fixes ocaml/dune#10673, @hhugo)

- Add support for specifying default values of the `authors`, `maintainers`, and
  `license` stanzas of the `dune-project` file via the dune config file. Default
  values are set using the `(project_defaults)` stanza (ocaml/dune#10835, @H-ANSEN)

- Add names to source tree events in performance traces (ocaml/dune#10884, @jchavarri)

- Add `codeberg` as an option for defining project sources in dune-project
  files. For example, `(source (codeberg user/repo))`. (ocaml/dune#10904, @nlordell)

- `dune runtest` can now run individual tests with `dune runtest mytest.t`
  (ocaml/dune#11041, @Alizter).

- Wasm_of_ocaml support (ocaml/dune#11093, @vouillon)

- Add a `coqdep_flags` field to the `coq` field of the `env` stanza, and to the `coq.theory` stanza, allowing to configure `coqdep` flags.
  (ocaml/dune#11094, @rlepigre)

### Changed

- Remove all remnants of the experimental `patch-back-source-tree`. (ocaml/dune#10771,
  @rgrinberg)

- Change the preset value for author and maintainer fields in the
  `dune-project` file to encourage including emails. (ocaml/dune#10848, @punchagan)

- Tweak the preset value for tags in the `dune-project` file to hint at topics
  not having a special meaning. (ocaml/dune#10849, @punchagan)

- Change some colors to improve readability in light-mode terminals
  (ocaml/dune#10890, @gridbugs)

- Forward the linkall flag to jsoo in whole program compilation as well (ocaml/dune#10935, @hhugo)

- Configurator uses `pkgconf` as pkg-config implementation when available
  and forwards it the `target` of `ocamlc -config`. (ocaml/dune#10937, @pirbo)

- Enable Dune cache by default. Add a new Dune cache setting
  `enabled-except-user-rules`, which enables the Dune cache, but excludes
  user-written rules from it. This is a conservative choice that can avoid
  breaking rules whose dependencies are not correctly specified. This is the
  current default. (ocaml/dune#10944, ocaml/dune#10710, @nojb, @ElectreAAS)

- Do not add `dune` dependency in `dune-project` when creating projects with
  `dune init proj`. The Dune dependency is implicitely added when generating
  opam files (ocaml/dune#11129, @Leonidas-from-XIV)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants