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

Rules for ctypes #135

Closed
ghost opened this issue Jun 9, 2017 · 31 comments
Closed

Rules for ctypes #135

ghost opened this issue Jun 9, 2017 · 31 comments
Milestone

Comments

@ghost
Copy link

ghost commented Jun 9, 2017

Ctypes is the recommended way to write C stubs for OCaml, Jbuilder have builtin support for it. (related to #131).

@g2p
Copy link

g2p commented Jun 18, 2017

I'd be interested in support for ctypes.foreign.
Listing non-stub C sources in c_names doesn't appear to do the trick.
Is there some linker magic I'm missing?

(Edit: yes I was. I needed -rdynamic in c_library_flags, and an external declaration to make sure the C function doesn't get eliminated as dead code)

@XVilka
Copy link

XVilka commented Dec 4, 2017

I tried to use the rules like:

(jbuild_version 1)
(library
  ((name mylib)
  (public_name mylib)
  (libaries (core ctypes ctypes.foreign))
  (c_library_flags (:standard -lz -lm -llzma -pthread))
  (library_flags (-cclib -Wl,-E))
  (self_build_stubs_archive (libmylib))
))
(rule
((targets (libmylib_stubs.a dllmylib_stubs.so))
  (deps ((files_recursively_in mylib)))
  (action (bash "
  ${MAKE} -s -C mylib clean
  $(MAKE} -s -C mylib libmylib.a
  $(MAKE} -s -C mylib libmylib.so
  cp mylib/libmylib.a libmylib_stubs.a
  cp mylib/libmylib.so dllmylib_stubs.so
  ${MAKE} -s -C mylib clean
"))))

But then when I use this library in any kind of application, it links but doesn't link the symbols from this "libmylib.{a,so}", raising the error when running:

Uncaught exception:
   Dl.DL_error("_build/default/myapp.exe: undefined symbol: "myfunction1")

To be honest, I have no idea why this is happens and why jbuilder can't handle this case.

@ghost
Copy link
Author

ghost commented Dec 4, 2017

Try (self_... (mylib)). This is what https://github.com/janestreet/re2/blob/master/src/re2_c/jbuild does and it works

@aantron
Copy link
Collaborator

aantron commented Jan 4, 2018

I have the same problem as @XVilka.

The re2 workaround didn't work for me, and I didn't expect it to. re2 has a separate build script for library archive files. In my case, Jbuilder was already correctly building the C library. Adding (self...) just made Jbuilder report that it failed to find rules for building a file that it otherwise successfully built (libfoo_stubs.a). I also confirmed with nm and dlopen/dlsym that the stubs archive being built by Jbuilder does indeed export the symbol that could not be found.

Everything seems to work if I add a dummy external that depends from OCaml on a symbol from the stubs library, however.

It looks like Jbuilder+Ctypes is broken.

Also, to try to find more examples, I tried listing opam packages that depend on both ctypes-foreign and jbuilder, but found none.

@XVilka
Copy link

XVilka commented Jan 4, 2018

Just for the record, following jbuild file worked for me:

(jbuild_version 1)
(library
  ((name newlib)
   (public_name newlib)
   (wrapped false)
   (libraries (core ctypes ctypes.foreign))
   (c_library_flags (:standard -Wl,--no-as-needed -lz -lm -llzma -pthread))
   (library_flags ((-cclib -Wl,-E) (-cclib -Wl,--no-as-needed) (lib/libmylib_stubs.a)))
   (self_build_stubs_archive (libmylib))
   ))
(rule
((targets (libmylib_stubs.a dllmylib_stubs.so))
	(deps ((files_recursively_in mylib)))
	(action (bash "
	${MAKE} -s -C mylib clean
	${MAKE} -s -C mylib libmylib.a
	${MAKE} -s -C mylib libmylib.so
	cp mylib/liblibmylib.a libmylib_stubs.a
	cp mylib/libmylib.so dllmylib_stubs.so
	${MAKE} -s -C mylib clean
	"))))

@ghost
Copy link
Author

ghost commented Jan 9, 2018

It's possible that there is an issue with ctypes-foreign. It works fine with static stub generation though, async_ssl does this for instance.

@rgrinberg
Copy link
Member

@diml given your recent change of approach to supporting external tools (implement a satisfying approach inside dune, generalize to plugins later). Do you think we can have good support for ctypes out of the box as well?

@ghost
Copy link
Author

ghost commented Jan 29, 2018

Absolutely

@paracetamolo
Copy link

Any news on the support in dune for ctypes?

@ghost
Copy link
Author

ghost commented Mar 8, 2018

Nothing has been done so far, but we are planning to look at this with @yallop

@vinczedani
Copy link

Any news on the support in dune for ctypes?

@yallop
Copy link
Member

yallop commented Apr 20, 2018

I think progress on ctypes support may be blocked by my lack of time at the moment. I can't really look at this directly at the moment, but I'm happy to answer questions, or provide feedback, if someone else wants to make a start.

Perhaps the dune/ctypes rules used in @avsm's yaml bindings would be a useful starting ponit.

@rgrinberg
Copy link
Member

I'll also recommend the async_ssl bindings.

@vinczedani do you have any particular pain points when using ctypes/dune? We rely on user input to make improvements. AFAIK, ctypes + jbuilder work fine if you're using the stub generation, it's just a little boilerplate heavy.

@aantron would you happen to have a reproducible test case for us?

@aantron
Copy link
Collaborator

aantron commented Apr 20, 2018

@rgrinberg Not at this point, it's out of my cache and I won't have time to recreate it soon.

@XVilka
Copy link

XVilka commented Mar 25, 2020

Just met the problem with manual workarounds - there is no easy way to compile ctypes-generated bindings code statically - C stubs still dynamically load libc, and binary needs libffi.

See also:

@aantron
Copy link
Collaborator

aantron commented Mar 25, 2020

I'm currently using this, which is based on @avsm's code in the YAML bindings linked by @yallop. It probably doesn't qualify as easy, but it does allow static-only linking, and the resulting binary does not need libffi.

@mbacarella
Copy link
Collaborator

@craigfe has a good minimal dune example of binding a library where you have to include a header here
https://github.com/CraigFe/ocaml-fiu/blob/main/src/fiu/ffi/dune

@ghost
Copy link
Author

ghost commented Oct 27, 2020

FTR, ctypes support in dune is scheduled (though not started yet). @voodoos will be working on it.

@mbacarella
Copy link
Collaborator

Let me know if I can help. For reference, it takes ~60 lines of boilerplate-ish dune to generate c-stubs for a library with a header, constants and functions:
https://github.com/mbacarella/mpg123/blob/main/c/dune

@rgrinberg
Copy link
Member

@mbacarella some help would definitely be appreciated. If you'd like to contribute, we can guide you through the process.

As a first step, what kind of ctypes stanza do you propose to wrap all that boilerplate?

@mbacarella
Copy link
Collaborator

mbacarella commented Oct 27, 2020

Suppose we wanted to write a stanza for binding for the mpg123 library (linked above).

I suggest that because it's a fairly complete example, since it involves

  • An easily installed but not necessarily present third party library that will end up in a standard enough place
  • Generates stubs for constants and C-wrapped types, as well as function stubs, which requires extra inclusion of C headers
  • Uses pkg-config to get cflags and lib invocation flags (new as of today!)

The minimum possible stanza I can think of would be this:

(ctype_library
  (name mpg123)
  (pkg_name libmpg123)
  (c_headers "#include <mpg123.h>")
  (type_descriptions Mpg123_c_type_descriptions)
  (function_descriptions Mpg123_c_function_descriptions))

The user should then provide these two files.

mpg123_c_type_descriptions.ml

module Types (F : Ctypes.TYPE) = struct
  open Ctypes
  open F
  let mpg123_api_version = constant "MPG123_API_VERSION" int
  let mpg123_ok = constant "MPG123_OK" int
  let mpg123_done = constant "MPG123_DONE" int
end

mpg123_c_function_descriptions.ml

open Ctypes

module Types = Mpg123_c_types

module Functions (F : Ctypes.FOREIGN) = struct
  open F
  let mpg123_init = foreign "mpg123_init" (void @-> returning int)
  let mpg123_exit = foreign "mpg123_exit" (void @-> returning void)
end

Example usage

The user is then free to use this ctype library in the rest of their ocaml project by listing mpg123 in their libraries and accessing via:

module Types = Mpg123.Mpg123_c_types
module Functions =
  Mpg123_c_function_descriptions.Functions (Mpg123.Mpg123_c_generated_functions)

I have to say, this seems pretty cumbersome and confusing to the end user. Adding a ctype_library stanza may be a win because it makes a really cumbersome confusing hard thing possible, though I could see the user being utterly mystified by being asked to include names of modules/libraries that don't otherwise appear in their tree and if the generated boilerplate is wrong the user might be even more lost in the weeds trying to make sense of it.

What do y'all think?

@rgrinberg
Copy link
Member

That's a good start. Perhaps a field inside the library stanza is possible as well?

(library
 (c_types ..))

With similar fields inside such as yours.

though I could see the user being utterly mystified by being asked to include names of modules/libraries that don't otherwise appear in their tree and if the generated boilerplate is wrong the user might be even more lost in the weeds trying to make sense of it.

I agree that this is problematic. We should always strive to avoid magic names and ask the user to provide all binders.
Perhaps like this:

;; inside a library stanza or on its own
(c_types
 (generated_modules
  (mpg123_c_types -> (types mpg123_c_type_descriptions))
  (mpg123_c_generated_functions -> (functions Mpg123_c_function_descriptions.Functions))))

@mbacarella
Copy link
Collaborator

Saying c_types as a sub-stanza in a library sounds fine as well.

;; inside a library stanza or on its own
(c_types
 (generated_modules
  (mpg123_c_types -> (types mpg123_c_type_descriptions))
  (mpg123_c_generated_functions -> (functions Mpg123_c_function_descriptions.Functions))))

I like the general idea here, but not sure what the -> would mean. That is, why not merely (mpg123_c_types (types mpg123_c_type_descriptions))?

@rgrinberg
Copy link
Member

In select dependencies, we use the -> syntax. Personally, I just like this syntax when creating associative data. It's definitely optional though.

@mbacarella
Copy link
Collaborator

I'm happy to keep it, it reminds me of matching, which is comforting.

@rgrinberg
Copy link
Member

rgrinberg commented Oct 28, 2020

Anyway, the syntax doesn't matter. This seems like a good starting point to me and you can implement the stanza parsing by looking at dune_file.ml. In particular, see how we handle menhir/coq stanzas. Ctypes will need something similar in the dune-project file:

(using ctypes 0.1)

To enable the feature. We aren't going to commit to stability in the beginning.

Once you make a WIP PR, I can guide you what else needs to be modified and explain the basics of dune's source.

@mbacarella
Copy link
Collaborator

Sounds good, let me take a crack at this.

@avsm
Copy link
Member

avsm commented Oct 30, 2020 via email

@mbacarella
Copy link
Collaborator

mbacarella commented Apr 16, 2021

Great to see you working on this. I’d be happy to print ocaml-yaml over to this when there’s a PR to try out.

Sorry to steal your thunder but thought I'd try porting ocaml-yaml over to it to help debug the feature and get it ready.
avsm/ocaml-yaml#41

@mbacarella
Copy link
Collaborator

Also ported luv over to this as well:
aantron/luv#114

This feature is being reviewed now, targeting landing in dune 3.0.

@rgrinberg rgrinberg modified the milestones: 2.9.2, 3.0 Oct 18, 2021
@rgrinberg
Copy link
Member

Fixed by #3905

rgrinberg added a commit to rgrinberg/opam-repository that referenced this issue Feb 11, 2022
…e-rpc, dune-rpc-lwt, dune-private-libs, dune-glob, dune-configurator, dune-build-info and dune-action-plugin (3.0.0)

CHANGES:

- Remove `uchar` and `seq` dummy ocamlfind libraries from dune's builtin
  library database (ocaml/dune#5260, @kit-ty-kate)

- Add a `DUNE_DIFF_COMMAND` environment variable to match `--diff-command`
  command-line parameter (@raphael-proust, fix ocaml/dune#5369, ocaml/dune#5375)

- Add support for odoc-link rules (ocaml/dune#5045, @lubegasimon)

- Dune will no longer generate documentation for hidden modules (ocaml/dune#5045,
  @lubegasimon)

- Parse the `native_pack_linker` field of `ocamlc -config` (ocaml/dune#5281, @TheLortex)

- Fix plugins with dot in the name (ocaml/dune#5182, @bobot, review @rgrinberg)

- Don't generate the dune-site build part when not needed (ocaml/dune#4861, @bobot,
  review @kit-ty-kate)

- Fix installation of implementations of virtual libraries (ocaml/dune#5150, fix ocaml/dune#3636,
  @rgrinberg)

- Run tests in all modes defined. Previously, jsoo was excluded. (@hhugo,
  ocaml/dune#5049, fix ocaml/dune#4951)

- Allow to configure the alias to run the jsoo tests (@hhugo, ocaml/dune#5049, ocaml/dune#4999)

- Set jsoo compilation flags in the `env` stanza (@hhugo, ocaml/dune#5049, ocaml/dune#1613)

- Allow to configure jsoo separate compilation in the `env` stanza. Previously,
  it was hard coded to always be enabled in the `dev` profile. (@hhugo, ocaml/dune#5049,
  fix ocaml/dune#970)

- Fix build-info version in jsoo executables (@hhugo, ocaml/dune#5049, fix ocaml/dune#4444)

- Pass `-no-check-prims` when building bytecode for jsoo (@hhugo, ocaml/dune#5049, ocaml/dune#4027)

- Fix jsoo builds when dynamically linked foreign archives are disabled
  (@hhugo, ocaml/dune#5049)

- Disallow empty packages starting from 3.0.  Empty packages may be
  re-enabled by adding the `(allow_empty)` to the package stanza in
  the dune-project file. (ocaml/dune#4867, fix ocaml/dune#2882, @kit-ty-kate, @rgrinberg)

- Add `link_flags` field to the `executable` field of `inline_tests` (ocaml/dune#5088,
  fix ocaml/dune#1530, @jvillard)

- In watch mode, use fsevents instead of fswatch on OSX (ocaml/dune#4937, ocaml/dune#4990, fixes
  ocaml/dune#4896 @rgrinberg)

- Remove `inotifywait` watch mode backend on Linux. We now use the inotify API
  exclusively (ocaml/dune#4941, @rgrinberg)

- Report cycles between virtual libraries and their implementation (ocaml/dune#5050,
  fixes ocaml/dune#2896, @rgrinberg)

- Warn when lang versions have an ignored suffix. `(lang dune 2.3.4)` or `(lang
  dune 2.3suffix)` were silently parsed as `2.3` and we know suggest to remove
  the prefix. (ocaml/dune#5040, @emillon)

- Allow users to specify dynamic dependencies in rules. For example `(deps
  %{read:foo.gen})` (ocaml/dune#4662, fixes ocaml/dune#4089, @jeremiedimino)

- Sandbox infer rules for menhir. Fixes possible "inconsistent assumptions"
  errors (ocaml/dune#5015, @rgrinberg)

- Experimental support for ctypes stubs (ocaml/dune#3905, fixes ocaml/dune#135, @mbacarella)

- Fix interpretation of `binaries` defined in the `env stanza`. Binaries
  defined in `x/dune` wouldn't be visible in `x/*/**/dune. (ocaml/dune#4975, fixes ocaml/dune#4976,
  @Leonidas-from-XIV, @rgrinberg)

- Do not list private libraries in package listings (ocaml/dune#4945, fixes ocaml/dune#4799,
  @rgrinberg)

- Allow spaces in cram test paths (ocaml/dune#4980, fixes ocaml/dune#4162, @rgrinberg)

- Improve error handling of misbehaving cram scripts. (ocaml/dune#4981, fix ocaml/dune#4230,
  @rgrinberg)

- Fix `foreign_stubs` inside a `tests` stanza. Previously, dune would crash
  when this field was present (ocaml/dune#4942, fix ocaml/dune#4946, @rgrinberg)

- Add the `enabled_if` field to `inline_tests` within the `library` stanza.
  This allows us to disable executing the inline tests while still allowing for
  compilation (ocaml/dune#4939, @rgrinberg)

- Generate a `dune-project` when initializing projects with `dune init proj ...`
  (ocaml/dune#4881, closes ocaml/dune#4367, @shonfeder)

- Allow spaces in the directory argument of the `subdir` stanza (ocaml/dune#4943, fixes
  ocaml/dune#4907, @rgrinberg)

- Add a `%{toolchain}` expansion variable (ocaml/dune#4899, fixes ocaml/dune#3949, @rgrinberg)

- Include dependencies of executables when creating toplevels (either `dune
  top` or `dune utop`) (ocaml/dune#4882, fixes ocaml/dune#4872, @Gopiancode)

- Fixes `opam` META file requires entry for private libs (ocaml/dune#4841, fixes ocaml/dune#4839, @toots)

- Fixes `dune exec` not adding .exe on Windows (ocaml/dune#4371, fixes ocaml/dune#3322, @MisterDA)

- Allow multiple cinaps stanzas in the same directory (ocaml/dune#4460, @rgrinberg)

- Fix `$ dune subst` in empty git repositories (ocaml/dune#4441, fixes ocaml/dune#3619, @rgrinberg)

- Improve interpretation of ansi escape sequence when spawning processes (ocaml/dune#4408,
  fixes ocaml/dune#2665, @rgrinberg)

- Allow `(package pkg)` in dependencies even if `pkg` is an installed package
  (ocaml/dune#4170, @bobot)

- Allow `%{version:pkg}` to work for external packages (ocaml/dune#4104, @kit-ty-kate)

- Add `(glob_files_rec <dir>/<glob>)` for globbing files recursively (ocaml/dune#4176,
  @jeremiedimino)

- Automatically generate empty `.mli` files for executables and tests (ocaml/dune#3768,
  fixes ocaml/dune#3745, @craigfe)

- Add `ocaml` command subgroup for OCaml related commands such as `utop`, `top`,
  and `merlin` (ocaml/dune#3936, @rgrinberg).

- Detect unknown variables more eagerly (ocaml/dune#4184, @jeremiedimino)

- Improve location of variables and macros in error messages (ocaml/dune#4205,
  @jeremiedimino)

- Auto-detect `dune-project` files as `dune` files in Emacs (ocaml/dune#4222, @shonfeder)

- Dune no longer automatically create or edit `dune-project` files
  (ocaml/dune#4239, fixes ocaml/dune#4108, @jeremiedimino)

- Warn if `dune-project` is not found (fatal in release mode) (ocaml/dune#5343, @emillon)

- Cleanup temporary files after running `$ dune exec`. (ocaml/dune#4260, fixes ocaml/dune#4243,
  @rgrinberg)

- Add a new subcommand `dune ocaml dump-dot-merlin` that prints a mix of all the
  merlin configuration of a directory (defaulting to the current directory) in
  the Merlin configuration syntax. (ocaml/dune#4250, @voodoos)

- Enable cram tests by default (ocaml/dune#4262, @rgrinberg)

- Drop support for opam 1.x (ocaml/dune#4280, @jeremiedimino)

- Stop calling `ocamlfind` to determine the library search path or
  library installation directory. This makes the behavior of Dune
  simpler and more reproducible (ocaml/dune#4281, @jeremiedimino)

- Remove the `external-lib-deps` command. This command was only
  approximative and the cost of maintainance was getting too high. We
  removed it to make room for new more important features (ocaml/dune#4298,
  @jeremiedimino)

- It is now possible to define action dependencies through a chain
  of aliases. (ocaml/dune#4303, @aalekseyev)

- If an .ml file is not used by an executable, Dune no longer report
  parsing error in this file (ocaml/dune#4330, @jeremiedimino)

- Add support for sandboxing using hard links (ocaml/dune#4360, Andrey Mokhov)

- Fix dune crash when `subdir` is an absolute path (ocaml/dune#4366, @anmonteiro)

- Changed the implementation of actions attached to aliases, as in
  `(rule (alias runtest) (action (run ./test)))`. A visible result for
  users is that such actions are now memoized for longer. For
  instance:
  ```
  $ echo '(rule (alias runtest) (action (echo "X=%{env:X=0}\n")))` > dune
  $ X=1 dune runtest
  X=1
  $ X=2 dune runtest
  X=2
  $ X=1 dune runtest
  ```
  Previously, Dune would have re-executed the action again at the last
  line. Now it remembers the result of the first execution.

- Fix a bug where dune would always re-run all actions that produce symlinks,
  even if their dependencies did not change. (ocaml/dune#4405, @aalekseyev)

- Fix a bug that was causing Dune to re-hash generated files more
  often than necessary (ocaml/dune#4419, @jeremiedimino)

- Fields allowed in the config file are now also allowed in the
  workspace file (ocaml/dune#4426, @jeremiedimino)

- Add options to control how Dune should handle stdout and stderr of
  actions when then succeed. It is now possible to ask Dune to ignore
  the stdout of actions when they succeed or to request that the
  stderr of actions must be empty. This allows to reduce the noise of
  large builds (ocaml/dune#4422, ocaml/dune#4515, @jeremiedimino)

- The `@all` alias no longer depends directly on copies of files from the source
  directory (ocaml/dune#4461, @nojb)

- Allow dune-file as an alternative file name for dune files (needs to be
  enabled in the dune-project file) (ocaml/dune#4428, @nojb)

- Drop support for upgrading jbuilder projects (ocaml/dune#4473, @jeremiedimino)

- Extend the environment variable `BUILD_PATH_PREFIX_MAP` to rewrite
  the root of the build dir (or sandbox) to `/workspace_root` (ocaml/dune#4466,
  @jeremiedimino)

- Simplify the implementation of build cache. We stop using the cache daemon to
  access the cache and instead write to and read from it directly. The new cache
  implementation is based on Jenga's cache library, which was thoroughly tested
  on large-scale builds. Using Jenga's cache library will also make it easier
  for us to port Jenga's cloud cache to Dune. (ocaml/dune#4443, ocaml/dune#4465, Andrey Mokhov)

- More informative error message when Dune can't read a target that's supposed
  to be produced by the action. Old message is still produced on ENOENT, but other
  errors deserve a more detailed report. (ocaml/dune#4501, @aalekseyev)

- Fixed a bug where a sandboxed action would fail if it declares no dependencies in
  its initial working directory or any directory it `chdir`s into. (ocaml/dune#4509, @aalekseyev)

- Fix a crash when clearing temporary directories (ocaml/dune#4489, ocaml/dune#4529, Andrey Mokhov)

- Dune now memoizes all errors when running in the file-watching mode. This
  speeds up incremental rebuilds but may be inconvenient in rare cases, e.g. if
  a build action fails due to a spurious error, such as running out of memory.
  Right now, the only way to force such actions to be rebuilt is to restart
  Dune, which clears all memoized errors. In future, we would like to provide a
  way to rerun all actions failed due to errors without restarting the build,
  e.g. via a Dune RPC call. (ocaml/dune#4522, Andrey Mokhov)

- Remove `dune compute`. It was broken and unused (ocaml/dune#4540,
  @jeremiedimino)

- No longer generate an approximate merlin files when computing the
  ocaml flags fails, for instance because they include the contents of
  a file that failed to build. This was a niche feature and it was
  getting in the way of making Dune's core better. (ocaml/dune#4607, @jeremiedimino)

- Make Dune display the progress indicator in all output modes except quiet
  (ocaml/dune#4618, @aalekseyev)

- Report accurate process timing information in trace mode (enabled with
  `--trace-file`) (ocaml/dune#4517, @rgrinberg)

- Do not log `live_words` and `free_words` in trace file. This allows using
  `Gc.quick_stat` which does not scan the heap. (ocaml/dune#4643, @emillon)

- Don't let command run by Dune observe the environment variable
  `INSIDE_EMACS` in order to improve reproducibility (ocaml/dune#4680,
  @jeremiedimino)

- Fix `root_module` when used in public libraries (ocaml/dune#4685, fixes ocaml/dune#4684,
  @rgrinberg, @craigfe)

- Fix `root_module` when used with preprocessing (ocaml/dune#4683, fixes ocaml/dune#4682,
  @rgrinberg, @craigfe)

- Display Coq profile flags in `dune printenv` (ocaml/dune#4767, @ejgallego)

- Introduce mdx stanza 0.2, requiring mdx >= 1.9.0, with a new generic `deps`
  field and the possibility to statically link `libraries` in the test
  executable. (ocaml/dune#3956, ocaml/dune#5391, fixes ocaml/dune#3955)

- Improve lookup of optional or disabled binaries. Previously, we'd treat every
  executable with missing libraries as optional. Now, we treat make sure to
  look at the library's optional or enabled_if status (ocaml/dune#4786).

- Always use 7 char hash prefix in build info version (ocaml/dune#4857, @jberdine, fixes
  ocaml/dune#4855)

- Allow to explicitly disable/enable the use of `dune subst` by adding a
  new `(subst <disable|enable>)` stanza to the `dune-project` file.
  (ocaml/dune#4864, @kit-ty-kate)

- Simplify the way `dune` discovers the root of the workspace. It now
  stops at the first `dune-workspace` file it encounters, and fails if
  it finds neither a `dune-workspace` nor a `dune-project` file
  (ocaml/dune#4921, fixes ocaml/dune#4459, @jeremiedimino)

- Dune no longer reads installed META files for libraries distributed with the
  compiler, instead using its own internal database. (ocaml/dune#4946, @nojb)

- Add support for `(empty_module_interface_if_absent)` in executable and library
  stanzas. (ocaml/dune#4955, @nojb)

- Add support for `%{bin-available:...}` (ocaml/dune#4995, @jeremiedimino)

- Make sure running `git` or `hg` in a sandboxed action, such as a
  cram test cannot escape the sandbox and pick up some random git or
  mercurial repository on the file system (ocaml/dune#4996, @jeremiedimino)

- Allow `%{read:...}` in more places such as `(enabled_if ...)`
  (ocaml/dune#4994, @jeremiedimino)

- Run each action in its own process group so that we don't leave
  stray processes behind when killing actions (ocaml/dune#4998, @jeremiedimino)

- Add an option `expand_aliases_in_sandbox` (ocaml/dune#5003, @jeremiedimino)

- Allow to cancel the initial scan via Control+C (ocaml/dune#4460, fixes ocaml/dune#4364
  @jeremiedimino)

- Add experimental support for directory targets (ocaml/dune#3316, ocaml/dune#5025, Andrey Mokhov),
  enabled via `(using directory-targets 0.1)` in `dune-project`.

- Delete old `promote-into`, `promote-until-clean` and `promote-until-clean-into`
  syntax (ocaml/dune#5091, Andrey Mokhov).

- Add link_flags in the env stanza (ocaml/dune#5215)

- Bootstrap: ignore errors when trying to remove generated files. (ocaml/dune#5407,
  @damiendoligez)
smorimoto pushed a commit to rgrinberg/opam-repository that referenced this issue Feb 13, 2022
…e-rpc, dune-rpc-lwt, dune-private-libs, dune-glob, dune-configurator, dune-build-info and dune-action-plugin (3.0.0)

CHANGES:

- Remove `uchar` and `seq` dummy ocamlfind libraries from dune's builtin
  library database (ocaml/dune#5260, @kit-ty-kate)

- Add a `DUNE_DIFF_COMMAND` environment variable to match `--diff-command`
  command-line parameter (@raphael-proust, fix ocaml/dune#5369, ocaml/dune#5375)

- Add support for odoc-link rules (ocaml/dune#5045, @lubegasimon)

- Dune will no longer generate documentation for hidden modules (ocaml/dune#5045,
  @lubegasimon)

- Parse the `native_pack_linker` field of `ocamlc -config` (ocaml/dune#5281, @TheLortex)

- Fix plugins with dot in the name (ocaml/dune#5182, @bobot, review @rgrinberg)

- Don't generate the dune-site build part when not needed (ocaml/dune#4861, @bobot,
  review @kit-ty-kate)

- Fix installation of implementations of virtual libraries (ocaml/dune#5150, fix ocaml/dune#3636,
  @rgrinberg)

- Run tests in all modes defined. Previously, jsoo was excluded. (@hhugo,
  ocaml/dune#5049, fix ocaml/dune#4951)

- Allow to configure the alias to run the jsoo tests (@hhugo, ocaml/dune#5049, ocaml/dune#4999)

- Set jsoo compilation flags in the `env` stanza (@hhugo, ocaml/dune#5049, ocaml/dune#1613)

- Allow to configure jsoo separate compilation in the `env` stanza. Previously,
  it was hard coded to always be enabled in the `dev` profile. (@hhugo, ocaml/dune#5049,
  fix ocaml/dune#970)

- Fix build-info version in jsoo executables (@hhugo, ocaml/dune#5049, fix ocaml/dune#4444)

- Pass `-no-check-prims` when building bytecode for jsoo (@hhugo, ocaml/dune#5049, ocaml/dune#4027)

- Fix jsoo builds when dynamically linked foreign archives are disabled
  (@hhugo, ocaml/dune#5049)

- Disallow empty packages starting from 3.0.  Empty packages may be
  re-enabled by adding the `(allow_empty)` to the package stanza in
  the dune-project file. (ocaml/dune#4867, fix ocaml/dune#2882, @kit-ty-kate, @rgrinberg)

- Add `link_flags` field to the `executable` field of `inline_tests` (ocaml/dune#5088,
  fix ocaml/dune#1530, @jvillard)

- In watch mode, use fsevents instead of fswatch on OSX (ocaml/dune#4937, ocaml/dune#4990, fixes
  ocaml/dune#4896 @rgrinberg)

- Remove `inotifywait` watch mode backend on Linux. We now use the inotify API
  exclusively (ocaml/dune#4941, @rgrinberg)

- Report cycles between virtual libraries and their implementation (ocaml/dune#5050,
  fixes ocaml/dune#2896, @rgrinberg)

- Warn when lang versions have an ignored suffix. `(lang dune 2.3.4)` or `(lang
  dune 2.3suffix)` were silently parsed as `2.3` and we know suggest to remove
  the prefix. (ocaml/dune#5040, @emillon)

- Allow users to specify dynamic dependencies in rules. For example `(deps
  %{read:foo.gen})` (ocaml/dune#4662, fixes ocaml/dune#4089, @jeremiedimino)

- Sandbox infer rules for menhir. Fixes possible "inconsistent assumptions"
  errors (ocaml/dune#5015, @rgrinberg)

- Experimental support for ctypes stubs (ocaml/dune#3905, fixes ocaml/dune#135, @mbacarella)

- Fix interpretation of `binaries` defined in the `env stanza`. Binaries
  defined in `x/dune` wouldn't be visible in `x/*/**/dune. (ocaml/dune#4975, fixes ocaml/dune#4976,
  @Leonidas-from-XIV, @rgrinberg)

- Do not list private libraries in package listings (ocaml/dune#4945, fixes ocaml/dune#4799,
  @rgrinberg)

- Allow spaces in cram test paths (ocaml/dune#4980, fixes ocaml/dune#4162, @rgrinberg)

- Improve error handling of misbehaving cram scripts. (ocaml/dune#4981, fix ocaml/dune#4230,
  @rgrinberg)

- Fix `foreign_stubs` inside a `tests` stanza. Previously, dune would crash
  when this field was present (ocaml/dune#4942, fix ocaml/dune#4946, @rgrinberg)

- Add the `enabled_if` field to `inline_tests` within the `library` stanza.
  This allows us to disable executing the inline tests while still allowing for
  compilation (ocaml/dune#4939, @rgrinberg)

- Generate a `dune-project` when initializing projects with `dune init proj ...`
  (ocaml/dune#4881, closes ocaml/dune#4367, @shonfeder)

- Allow spaces in the directory argument of the `subdir` stanza (ocaml/dune#4943, fixes
  ocaml/dune#4907, @rgrinberg)

- Add a `%{toolchain}` expansion variable (ocaml/dune#4899, fixes ocaml/dune#3949, @rgrinberg)

- Include dependencies of executables when creating toplevels (either `dune
  top` or `dune utop`) (ocaml/dune#4882, fixes ocaml/dune#4872, @Gopiancode)

- Fixes `opam` META file requires entry for private libs (ocaml/dune#4841, fixes ocaml/dune#4839, @toots)

- Fixes `dune exec` not adding .exe on Windows (ocaml/dune#4371, fixes ocaml/dune#3322, @MisterDA)

- Allow multiple cinaps stanzas in the same directory (ocaml/dune#4460, @rgrinberg)

- Fix `$ dune subst` in empty git repositories (ocaml/dune#4441, fixes ocaml/dune#3619, @rgrinberg)

- Improve interpretation of ansi escape sequence when spawning processes (ocaml/dune#4408,
  fixes ocaml/dune#2665, @rgrinberg)

- Allow `(package pkg)` in dependencies even if `pkg` is an installed package
  (ocaml/dune#4170, @bobot)

- Allow `%{version:pkg}` to work for external packages (ocaml/dune#4104, @kit-ty-kate)

- Add `(glob_files_rec <dir>/<glob>)` for globbing files recursively (ocaml/dune#4176,
  @jeremiedimino)

- Automatically generate empty `.mli` files for executables and tests (ocaml/dune#3768,
  fixes ocaml/dune#3745, @craigfe)

- Add `ocaml` command subgroup for OCaml related commands such as `utop`, `top`,
  and `merlin` (ocaml/dune#3936, @rgrinberg).

- Detect unknown variables more eagerly (ocaml/dune#4184, @jeremiedimino)

- Improve location of variables and macros in error messages (ocaml/dune#4205,
  @jeremiedimino)

- Auto-detect `dune-project` files as `dune` files in Emacs (ocaml/dune#4222, @shonfeder)

- Dune no longer automatically create or edit `dune-project` files
  (ocaml/dune#4239, fixes ocaml/dune#4108, @jeremiedimino)

- Warn if `dune-project` is not found (fatal in release mode) (ocaml/dune#5343, @emillon)

- Cleanup temporary files after running `$ dune exec`. (ocaml/dune#4260, fixes ocaml/dune#4243,
  @rgrinberg)

- Add a new subcommand `dune ocaml dump-dot-merlin` that prints a mix of all the
  merlin configuration of a directory (defaulting to the current directory) in
  the Merlin configuration syntax. (ocaml/dune#4250, @voodoos)

- Enable cram tests by default (ocaml/dune#4262, @rgrinberg)

- Drop support for opam 1.x (ocaml/dune#4280, @jeremiedimino)

- Stop calling `ocamlfind` to determine the library search path or
  library installation directory. This makes the behavior of Dune
  simpler and more reproducible (ocaml/dune#4281, @jeremiedimino)

- Remove the `external-lib-deps` command. This command was only
  approximative and the cost of maintainance was getting too high. We
  removed it to make room for new more important features (ocaml/dune#4298,
  @jeremiedimino)

- It is now possible to define action dependencies through a chain
  of aliases. (ocaml/dune#4303, @aalekseyev)

- If an .ml file is not used by an executable, Dune no longer report
  parsing error in this file (ocaml/dune#4330, @jeremiedimino)

- Add support for sandboxing using hard links (ocaml/dune#4360, Andrey Mokhov)

- Fix dune crash when `subdir` is an absolute path (ocaml/dune#4366, @anmonteiro)

- Changed the implementation of actions attached to aliases, as in
  `(rule (alias runtest) (action (run ./test)))`. A visible result for
  users is that such actions are now memoized for longer. For
  instance:
  ```
  $ echo '(rule (alias runtest) (action (echo "X=%{env:X=0}\n")))` > dune
  $ X=1 dune runtest
  X=1
  $ X=2 dune runtest
  X=2
  $ X=1 dune runtest
  ```
  Previously, Dune would have re-executed the action again at the last
  line. Now it remembers the result of the first execution.

- Fix a bug where dune would always re-run all actions that produce symlinks,
  even if their dependencies did not change. (ocaml/dune#4405, @aalekseyev)

- Fix a bug that was causing Dune to re-hash generated files more
  often than necessary (ocaml/dune#4419, @jeremiedimino)

- Fields allowed in the config file are now also allowed in the
  workspace file (ocaml/dune#4426, @jeremiedimino)

- Add options to control how Dune should handle stdout and stderr of
  actions when then succeed. It is now possible to ask Dune to ignore
  the stdout of actions when they succeed or to request that the
  stderr of actions must be empty. This allows to reduce the noise of
  large builds (ocaml/dune#4422, ocaml/dune#4515, @jeremiedimino)

- The `@all` alias no longer depends directly on copies of files from the source
  directory (ocaml/dune#4461, @nojb)

- Allow dune-file as an alternative file name for dune files (needs to be
  enabled in the dune-project file) (ocaml/dune#4428, @nojb)

- Drop support for upgrading jbuilder projects (ocaml/dune#4473, @jeremiedimino)

- Extend the environment variable `BUILD_PATH_PREFIX_MAP` to rewrite
  the root of the build dir (or sandbox) to `/workspace_root` (ocaml/dune#4466,
  @jeremiedimino)

- Simplify the implementation of build cache. We stop using the cache daemon to
  access the cache and instead write to and read from it directly. The new cache
  implementation is based on Jenga's cache library, which was thoroughly tested
  on large-scale builds. Using Jenga's cache library will also make it easier
  for us to port Jenga's cloud cache to Dune. (ocaml/dune#4443, ocaml/dune#4465, Andrey Mokhov)

- More informative error message when Dune can't read a target that's supposed
  to be produced by the action. Old message is still produced on ENOENT, but other
  errors deserve a more detailed report. (ocaml/dune#4501, @aalekseyev)

- Fixed a bug where a sandboxed action would fail if it declares no dependencies in
  its initial working directory or any directory it `chdir`s into. (ocaml/dune#4509, @aalekseyev)

- Fix a crash when clearing temporary directories (ocaml/dune#4489, ocaml/dune#4529, Andrey Mokhov)

- Dune now memoizes all errors when running in the file-watching mode. This
  speeds up incremental rebuilds but may be inconvenient in rare cases, e.g. if
  a build action fails due to a spurious error, such as running out of memory.
  Right now, the only way to force such actions to be rebuilt is to restart
  Dune, which clears all memoized errors. In future, we would like to provide a
  way to rerun all actions failed due to errors without restarting the build,
  e.g. via a Dune RPC call. (ocaml/dune#4522, Andrey Mokhov)

- Remove `dune compute`. It was broken and unused (ocaml/dune#4540,
  @jeremiedimino)

- No longer generate an approximate merlin files when computing the
  ocaml flags fails, for instance because they include the contents of
  a file that failed to build. This was a niche feature and it was
  getting in the way of making Dune's core better. (ocaml/dune#4607, @jeremiedimino)

- Make Dune display the progress indicator in all output modes except quiet
  (ocaml/dune#4618, @aalekseyev)

- Report accurate process timing information in trace mode (enabled with
  `--trace-file`) (ocaml/dune#4517, @rgrinberg)

- Do not log `live_words` and `free_words` in trace file. This allows using
  `Gc.quick_stat` which does not scan the heap. (ocaml/dune#4643, @emillon)

- Don't let command run by Dune observe the environment variable
  `INSIDE_EMACS` in order to improve reproducibility (ocaml/dune#4680,
  @jeremiedimino)

- Fix `root_module` when used in public libraries (ocaml/dune#4685, fixes ocaml/dune#4684,
  @rgrinberg, @craigfe)

- Fix `root_module` when used with preprocessing (ocaml/dune#4683, fixes ocaml/dune#4682,
  @rgrinberg, @craigfe)

- Display Coq profile flags in `dune printenv` (ocaml/dune#4767, @ejgallego)

- Introduce mdx stanza 0.2, requiring mdx >= 1.9.0, with a new generic `deps`
  field and the possibility to statically link `libraries` in the test
  executable. (ocaml/dune#3956, ocaml/dune#5391, fixes ocaml/dune#3955)

- Improve lookup of optional or disabled binaries. Previously, we'd treat every
  executable with missing libraries as optional. Now, we treat make sure to
  look at the library's optional or enabled_if status (ocaml/dune#4786).

- Always use 7 char hash prefix in build info version (ocaml/dune#4857, @jberdine, fixes
  ocaml/dune#4855)

- Allow to explicitly disable/enable the use of `dune subst` by adding a
  new `(subst <disable|enable>)` stanza to the `dune-project` file.
  (ocaml/dune#4864, @kit-ty-kate)

- Simplify the way `dune` discovers the root of the workspace. It now
  stops at the first `dune-workspace` file it encounters, and fails if
  it finds neither a `dune-workspace` nor a `dune-project` file
  (ocaml/dune#4921, fixes ocaml/dune#4459, @jeremiedimino)

- Dune no longer reads installed META files for libraries distributed with the
  compiler, instead using its own internal database. (ocaml/dune#4946, @nojb)

- Add support for `(empty_module_interface_if_absent)` in executable and library
  stanzas. (ocaml/dune#4955, @nojb)

- Add support for `%{bin-available:...}` (ocaml/dune#4995, @jeremiedimino)

- Make sure running `git` or `hg` in a sandboxed action, such as a
  cram test cannot escape the sandbox and pick up some random git or
  mercurial repository on the file system (ocaml/dune#4996, @jeremiedimino)

- Allow `%{read:...}` in more places such as `(enabled_if ...)`
  (ocaml/dune#4994, @jeremiedimino)

- Run each action in its own process group so that we don't leave
  stray processes behind when killing actions (ocaml/dune#4998, @jeremiedimino)

- Add an option `expand_aliases_in_sandbox` (ocaml/dune#5003, @jeremiedimino)

- Allow to cancel the initial scan via Control+C (ocaml/dune#4460, fixes ocaml/dune#4364
  @jeremiedimino)

- Add experimental support for directory targets (ocaml/dune#3316, ocaml/dune#5025, Andrey Mokhov),
  enabled via `(using directory-targets 0.1)` in `dune-project`.

- Delete old `promote-into`, `promote-until-clean` and `promote-until-clean-into`
  syntax (ocaml/dune#5091, Andrey Mokhov).

- Add link_flags in the env stanza (ocaml/dune#5215)

- Bootstrap: ignore errors when trying to remove generated files. (ocaml/dune#5407,
  @damiendoligez)
kit-ty-kate pushed a commit to rgrinberg/opam-repository that referenced this issue Feb 15, 2022
…e-rpc, dune-rpc-lwt, dune-private-libs, dune-glob, dune-configurator, dune-build-info and dune-action-plugin (3.0.0)

CHANGES:

- Remove `uchar` and `seq` dummy ocamlfind libraries from dune's builtin
  library database (ocaml/dune#5260, @kit-ty-kate)

- Add a `DUNE_DIFF_COMMAND` environment variable to match `--diff-command`
  command-line parameter (@raphael-proust, fix ocaml/dune#5369, ocaml/dune#5375)

- Add support for odoc-link rules (ocaml/dune#5045, @lubegasimon)

- Dune will no longer generate documentation for hidden modules (ocaml/dune#5045,
  @lubegasimon)

- Parse the `native_pack_linker` field of `ocamlc -config` (ocaml/dune#5281, @TheLortex)

- Fix plugins with dot in the name (ocaml/dune#5182, @bobot, review @rgrinberg)

- Don't generate the dune-site build part when not needed (ocaml/dune#4861, @bobot,
  review @kit-ty-kate)

- Fix installation of implementations of virtual libraries (ocaml/dune#5150, fix ocaml/dune#3636,
  @rgrinberg)

- Run tests in all modes defined. Previously, jsoo was excluded. (@hhugo,
  ocaml/dune#5049, fix ocaml/dune#4951)

- Allow to configure the alias to run the jsoo tests (@hhugo, ocaml/dune#5049, ocaml/dune#4999)

- Set jsoo compilation flags in the `env` stanza (@hhugo, ocaml/dune#5049, ocaml/dune#1613)

- Allow to configure jsoo separate compilation in the `env` stanza. Previously,
  it was hard coded to always be enabled in the `dev` profile. (@hhugo, ocaml/dune#5049,
  fix ocaml/dune#970)

- Fix build-info version in jsoo executables (@hhugo, ocaml/dune#5049, fix ocaml/dune#4444)

- Pass `-no-check-prims` when building bytecode for jsoo (@hhugo, ocaml/dune#5049, ocaml/dune#4027)

- Fix jsoo builds when dynamically linked foreign archives are disabled
  (@hhugo, ocaml/dune#5049)

- Disallow empty packages starting from 3.0.  Empty packages may be
  re-enabled by adding the `(allow_empty)` to the package stanza in
  the dune-project file. (ocaml/dune#4867, fix ocaml/dune#2882, @kit-ty-kate, @rgrinberg)

- Add `link_flags` field to the `executable` field of `inline_tests` (ocaml/dune#5088,
  fix ocaml/dune#1530, @jvillard)

- In watch mode, use fsevents instead of fswatch on OSX (ocaml/dune#4937, ocaml/dune#4990, fixes
  ocaml/dune#4896 @rgrinberg)

- Remove `inotifywait` watch mode backend on Linux. We now use the inotify API
  exclusively (ocaml/dune#4941, @rgrinberg)

- Report cycles between virtual libraries and their implementation (ocaml/dune#5050,
  fixes ocaml/dune#2896, @rgrinberg)

- Warn when lang versions have an ignored suffix. `(lang dune 2.3.4)` or `(lang
  dune 2.3suffix)` were silently parsed as `2.3` and we know suggest to remove
  the prefix. (ocaml/dune#5040, @emillon)

- Allow users to specify dynamic dependencies in rules. For example `(deps
  %{read:foo.gen})` (ocaml/dune#4662, fixes ocaml/dune#4089, @jeremiedimino)

- Sandbox infer rules for menhir. Fixes possible "inconsistent assumptions"
  errors (ocaml/dune#5015, @rgrinberg)

- Experimental support for ctypes stubs (ocaml/dune#3905, fixes ocaml/dune#135, @mbacarella)

- Fix interpretation of `binaries` defined in the `env stanza`. Binaries
  defined in `x/dune` wouldn't be visible in `x/*/**/dune. (ocaml/dune#4975, fixes ocaml/dune#4976,
  @Leonidas-from-XIV, @rgrinberg)

- Do not list private libraries in package listings (ocaml/dune#4945, fixes ocaml/dune#4799,
  @rgrinberg)

- Allow spaces in cram test paths (ocaml/dune#4980, fixes ocaml/dune#4162, @rgrinberg)

- Improve error handling of misbehaving cram scripts. (ocaml/dune#4981, fix ocaml/dune#4230,
  @rgrinberg)

- Fix `foreign_stubs` inside a `tests` stanza. Previously, dune would crash
  when this field was present (ocaml/dune#4942, fix ocaml/dune#4946, @rgrinberg)

- Add the `enabled_if` field to `inline_tests` within the `library` stanza.
  This allows us to disable executing the inline tests while still allowing for
  compilation (ocaml/dune#4939, @rgrinberg)

- Generate a `dune-project` when initializing projects with `dune init proj ...`
  (ocaml/dune#4881, closes ocaml/dune#4367, @shonfeder)

- Allow spaces in the directory argument of the `subdir` stanza (ocaml/dune#4943, fixes
  ocaml/dune#4907, @rgrinberg)

- Add a `%{toolchain}` expansion variable (ocaml/dune#4899, fixes ocaml/dune#3949, @rgrinberg)

- Include dependencies of executables when creating toplevels (either `dune
  top` or `dune utop`) (ocaml/dune#4882, fixes ocaml/dune#4872, @Gopiancode)

- Fixes `opam` META file requires entry for private libs (ocaml/dune#4841, fixes ocaml/dune#4839, @toots)

- Fixes `dune exec` not adding .exe on Windows (ocaml/dune#4371, fixes ocaml/dune#3322, @MisterDA)

- Allow multiple cinaps stanzas in the same directory (ocaml/dune#4460, @rgrinberg)

- Fix `$ dune subst` in empty git repositories (ocaml/dune#4441, fixes ocaml/dune#3619, @rgrinberg)

- Improve interpretation of ansi escape sequence when spawning processes (ocaml/dune#4408,
  fixes ocaml/dune#2665, @rgrinberg)

- Allow `(package pkg)` in dependencies even if `pkg` is an installed package
  (ocaml/dune#4170, @bobot)

- Allow `%{version:pkg}` to work for external packages (ocaml/dune#4104, @kit-ty-kate)

- Add `(glob_files_rec <dir>/<glob>)` for globbing files recursively (ocaml/dune#4176,
  @jeremiedimino)

- Automatically generate empty `.mli` files for executables and tests (ocaml/dune#3768,
  fixes ocaml/dune#3745, @craigfe)

- Add `ocaml` command subgroup for OCaml related commands such as `utop`, `top`,
  and `merlin` (ocaml/dune#3936, @rgrinberg).

- Detect unknown variables more eagerly (ocaml/dune#4184, @jeremiedimino)

- Improve location of variables and macros in error messages (ocaml/dune#4205,
  @jeremiedimino)

- Auto-detect `dune-project` files as `dune` files in Emacs (ocaml/dune#4222, @shonfeder)

- Dune no longer automatically create or edit `dune-project` files
  (ocaml/dune#4239, fixes ocaml/dune#4108, @jeremiedimino)

- Warn if `dune-project` is not found (fatal in release mode) (ocaml/dune#5343, @emillon)

- Cleanup temporary files after running `$ dune exec`. (ocaml/dune#4260, fixes ocaml/dune#4243,
  @rgrinberg)

- Add a new subcommand `dune ocaml dump-dot-merlin` that prints a mix of all the
  merlin configuration of a directory (defaulting to the current directory) in
  the Merlin configuration syntax. (ocaml/dune#4250, @voodoos)

- Enable cram tests by default (ocaml/dune#4262, @rgrinberg)

- Drop support for opam 1.x (ocaml/dune#4280, @jeremiedimino)

- Stop calling `ocamlfind` to determine the library search path or
  library installation directory. This makes the behavior of Dune
  simpler and more reproducible (ocaml/dune#4281, @jeremiedimino)

- Remove the `external-lib-deps` command. This command was only
  approximative and the cost of maintainance was getting too high. We
  removed it to make room for new more important features (ocaml/dune#4298,
  @jeremiedimino)

- It is now possible to define action dependencies through a chain
  of aliases. (ocaml/dune#4303, @aalekseyev)

- If an .ml file is not used by an executable, Dune no longer report
  parsing error in this file (ocaml/dune#4330, @jeremiedimino)

- Add support for sandboxing using hard links (ocaml/dune#4360, Andrey Mokhov)

- Fix dune crash when `subdir` is an absolute path (ocaml/dune#4366, @anmonteiro)

- Changed the implementation of actions attached to aliases, as in
  `(rule (alias runtest) (action (run ./test)))`. A visible result for
  users is that such actions are now memoized for longer. For
  instance:
  ```
  $ echo '(rule (alias runtest) (action (echo "X=%{env:X=0}\n")))` > dune
  $ X=1 dune runtest
  X=1
  $ X=2 dune runtest
  X=2
  $ X=1 dune runtest
  ```
  Previously, Dune would have re-executed the action again at the last
  line. Now it remembers the result of the first execution.

- Fix a bug where dune would always re-run all actions that produce symlinks,
  even if their dependencies did not change. (ocaml/dune#4405, @aalekseyev)

- Fix a bug that was causing Dune to re-hash generated files more
  often than necessary (ocaml/dune#4419, @jeremiedimino)

- Fields allowed in the config file are now also allowed in the
  workspace file (ocaml/dune#4426, @jeremiedimino)

- Add options to control how Dune should handle stdout and stderr of
  actions when then succeed. It is now possible to ask Dune to ignore
  the stdout of actions when they succeed or to request that the
  stderr of actions must be empty. This allows to reduce the noise of
  large builds (ocaml/dune#4422, ocaml/dune#4515, @jeremiedimino)

- The `@all` alias no longer depends directly on copies of files from the source
  directory (ocaml/dune#4461, @nojb)

- Allow dune-file as an alternative file name for dune files (needs to be
  enabled in the dune-project file) (ocaml/dune#4428, @nojb)

- Drop support for upgrading jbuilder projects (ocaml/dune#4473, @jeremiedimino)

- Extend the environment variable `BUILD_PATH_PREFIX_MAP` to rewrite
  the root of the build dir (or sandbox) to `/workspace_root` (ocaml/dune#4466,
  @jeremiedimino)

- Simplify the implementation of build cache. We stop using the cache daemon to
  access the cache and instead write to and read from it directly. The new cache
  implementation is based on Jenga's cache library, which was thoroughly tested
  on large-scale builds. Using Jenga's cache library will also make it easier
  for us to port Jenga's cloud cache to Dune. (ocaml/dune#4443, ocaml/dune#4465, Andrey Mokhov)

- More informative error message when Dune can't read a target that's supposed
  to be produced by the action. Old message is still produced on ENOENT, but other
  errors deserve a more detailed report. (ocaml/dune#4501, @aalekseyev)

- Fixed a bug where a sandboxed action would fail if it declares no dependencies in
  its initial working directory or any directory it `chdir`s into. (ocaml/dune#4509, @aalekseyev)

- Fix a crash when clearing temporary directories (ocaml/dune#4489, ocaml/dune#4529, Andrey Mokhov)

- Dune now memoizes all errors when running in the file-watching mode. This
  speeds up incremental rebuilds but may be inconvenient in rare cases, e.g. if
  a build action fails due to a spurious error, such as running out of memory.
  Right now, the only way to force such actions to be rebuilt is to restart
  Dune, which clears all memoized errors. In future, we would like to provide a
  way to rerun all actions failed due to errors without restarting the build,
  e.g. via a Dune RPC call. (ocaml/dune#4522, Andrey Mokhov)

- Remove `dune compute`. It was broken and unused (ocaml/dune#4540,
  @jeremiedimino)

- No longer generate an approximate merlin files when computing the
  ocaml flags fails, for instance because they include the contents of
  a file that failed to build. This was a niche feature and it was
  getting in the way of making Dune's core better. (ocaml/dune#4607, @jeremiedimino)

- Make Dune display the progress indicator in all output modes except quiet
  (ocaml/dune#4618, @aalekseyev)

- Report accurate process timing information in trace mode (enabled with
  `--trace-file`) (ocaml/dune#4517, @rgrinberg)

- Do not log `live_words` and `free_words` in trace file. This allows using
  `Gc.quick_stat` which does not scan the heap. (ocaml/dune#4643, @emillon)

- Don't let command run by Dune observe the environment variable
  `INSIDE_EMACS` in order to improve reproducibility (ocaml/dune#4680,
  @jeremiedimino)

- Fix `root_module` when used in public libraries (ocaml/dune#4685, fixes ocaml/dune#4684,
  @rgrinberg, @craigfe)

- Fix `root_module` when used with preprocessing (ocaml/dune#4683, fixes ocaml/dune#4682,
  @rgrinberg, @craigfe)

- Display Coq profile flags in `dune printenv` (ocaml/dune#4767, @ejgallego)

- Introduce mdx stanza 0.2, requiring mdx >= 1.9.0, with a new generic `deps`
  field and the possibility to statically link `libraries` in the test
  executable. (ocaml/dune#3956, ocaml/dune#5391, fixes ocaml/dune#3955)

- Improve lookup of optional or disabled binaries. Previously, we'd treat every
  executable with missing libraries as optional. Now, we treat make sure to
  look at the library's optional or enabled_if status (ocaml/dune#4786).

- Always use 7 char hash prefix in build info version (ocaml/dune#4857, @jberdine, fixes
  ocaml/dune#4855)

- Allow to explicitly disable/enable the use of `dune subst` by adding a
  new `(subst <disable|enable>)` stanza to the `dune-project` file.
  (ocaml/dune#4864, @kit-ty-kate)

- Simplify the way `dune` discovers the root of the workspace. It now
  stops at the first `dune-workspace` file it encounters, and fails if
  it finds neither a `dune-workspace` nor a `dune-project` file
  (ocaml/dune#4921, fixes ocaml/dune#4459, @jeremiedimino)

- Dune no longer reads installed META files for libraries distributed with the
  compiler, instead using its own internal database. (ocaml/dune#4946, @nojb)

- Add support for `(empty_module_interface_if_absent)` in executable and library
  stanzas. (ocaml/dune#4955, @nojb)

- Add support for `%{bin-available:...}` (ocaml/dune#4995, @jeremiedimino)

- Make sure running `git` or `hg` in a sandboxed action, such as a
  cram test cannot escape the sandbox and pick up some random git or
  mercurial repository on the file system (ocaml/dune#4996, @jeremiedimino)

- Allow `%{read:...}` in more places such as `(enabled_if ...)`
  (ocaml/dune#4994, @jeremiedimino)

- Run each action in its own process group so that we don't leave
  stray processes behind when killing actions (ocaml/dune#4998, @jeremiedimino)

- Add an option `expand_aliases_in_sandbox` (ocaml/dune#5003, @jeremiedimino)

- Allow to cancel the initial scan via Control+C (ocaml/dune#4460, fixes ocaml/dune#4364
  @jeremiedimino)

- Add experimental support for directory targets (ocaml/dune#3316, ocaml/dune#5025, Andrey Mokhov),
  enabled via `(using directory-targets 0.1)` in `dune-project`.

- Delete old `promote-into`, `promote-until-clean` and `promote-until-clean-into`
  syntax (ocaml/dune#5091, Andrey Mokhov).

- Add link_flags in the env stanza (ocaml/dune#5215)

- Bootstrap: ignore errors when trying to remove generated files. (ocaml/dune#5407,
  @damiendoligez)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment