Skip to content
Commits on Source (9)
1.6.2 (05/12/2018)
------------------
- Fix regression introduced by #1554 reported in:
https://github.com/ocaml/dune/issues/734#issuecomment-444177134 (#1612,
@rgrinberg)
- Fix `dune external-lib-deps` when preprocessors are not installed
(#1607, @diml)
1.6.1 (04/12/2018)
------------------
- Fix hash collision for on-demand ppx rewriters once and for all
(#1602, fixes #1524, @diml)
- Add `dune external-lib-deps --sexp --unstable-by-dir` so that the output can
be easily processed by a machine (#1599, @diml)
1.6.0 (29/11/2018)
------------------
- Expand variables in `install` stanzas (#1354, @mseri)
- Add predicate language support for specifying sub directories. This allows the
use globs, set operations, and special values in specifying the sub
directories used for the build. For example: `(dirs :standard \ lib*)` will
use all directories except those that start with `lib`. (#1517, #1568,
@rgrinberg)
- Add `binaries` field to the `(env ..)` stanza. This field sets and overrides
binaries for rules defined in a directory. (#1521, @rgrinberg)
- Fix a crash caused by using an extension in a project without
dune-project file (#1535, fix #1529, @diml)
- Allow `%{bin:..}`, `%{exe:..}`, and other static expansions in the `deps`
field. (#1155, fix #1531, @rgrinberg)
- Fix bad interaction between on-demand ppx rewriters and using multiple build
contexts (#1545, @diml)
- Fix handling of installed .dune files when the backend is declared via a
`dune` file (#1551, fixes #1549, @diml)
- Add a `--stats` command line option to record resource usage (#1543, @diml)
- Fix `dune build @doc` deleting `highlight.pack.js` on rebuilds, after the
first build (#1557, @aantron).
- Allow targets to be directories, which Dune will treat opaquely
(#1547, @jordwalke)
- Support for OCaml 4.08: `List.t` is now provided by OCaml (#1561, @ejgallego)
- Exclude the local esy directory (`_esy`) from the list of watched directories
(#1578, @andreypopp)
- Fix the output of `dune external-lib-deps` (#1594, @diml)
- Introduce `data_only_dirs` to replace `ignored_subdirs`. `ignored_subdirs` is
deprecated since 1.6. (#1590, @rgrinberg)
1.5.1 (7/11/2018)
-----------------
- Fix `dune utop <dir>` when invoked from a sub-directory of the
project (#1520, fix #1518, @diml)
- Fix bad interaction between on-demand ppx rewriters and polling mode
(#1525, fix #1524, @diml)
1.5.0 (1/11/2018)
-----------------
- Filter out empty paths from `OCAMLPATH` and `PATH` (#1436, @rgrinberg)
- Do not add the `lib.cma.js` target in lib's directory. Put this target in a
sub directory instead. (#1435, fix #1302, @rgrinberg)
- Install generated OCaml files with a `.ml` rather than a `.ml-gen` extension
(#1425, fix #1414, @rgrinberg)
- Allow to use the `bigarray` library in >= 4.07 without ocamlfind and without
installing the corresponding `otherlib`. (#1455, @nojb)
- Add `@all` alias to build all targets defined in a directory (#1409, fix
#1220, @rgrinberg)
- Add `@check` alias to build all targets required for type checking and tooling
support. (#1447, fix #1220, @rgrinberg)
- Produce the odoc index page with the content wrapper to make it consistent
with odoc's theming (#1469, @rizo)
- Unblock signals in processes started by dune (#1461, fixes #1451,
@diml)
- Respect `OCAMLFIND_TOOLCHAIN` and add a `toolchain` option to contexts in the
workspace file. (#1449, fix #1413, @rgrinberg)
- Fix error message when using `copy_files` stanza to copy files from
a non sub directory with lang set to dune < 1.3 (#1486, fixes #1485,
@NathanReb)
- Install man pages in the correct subdirectory (#1483, fixes #1441, @emillon)
- Fix version syntax check for `test` stanza's `action` field. Only
emits a warning for retro-compatibility (#1474, fixes #1471,
@NathanReb)
- Interpret the `DESTDIR` environment variable (#1475, @emillon)
- Fix interpretation of paths in `env` stanzas (#1509, fixes #1508, @diml)
- Add `context_name` expansion variable (#1507, @rgrinberg)
- Use shorter paths for generated on-demand ppx drivers. This is to
help Windows builds where paths are limited in length (#1511, fixes
#1497, @diml)
- Fix interpretation of environment variables under `setenv`. Also forbid
dynamic environment names or values (#1503, @rgrinberg).
1.4.0 (10/10/2018)
------------------
- Do not fail if the output of `ocamlc -config` doesn't include
`standard_runtime` (#1326, @diml)
- Let `Configurator.V1.C_define.import` handle negative integers
(#1334, @Chris00)
- Re-execute actions when a target is modified by the user inside
`_build` (#1343, fix #1342, @diml)
- Pass `--set-switch` to opam (#1341, fix #1337, @diml)
- Fix bad interaction between multi-directory libraries the `menhir`
stanza (#1373, fix #1372, @diml)
- Integration with automatic formatters (#1252, fix #1201, @emillon)
- Better error message when using `(self_build_stubs_archive ...)` and
`(c_names ...)` or `(cxx_names ...)` simultaneously.
(#1375, fix #1306, @nojb)
- Improve name detection for packages when the prefix isn't an actual package
(#1361, fix #1360, @rgrinberg)
- Support for new menhir rules (#863, fix #305, @fpottier, @rgrinberg)
- Do not remove flags when compiling compatibility modules for wrapped mode
(#1382, fix #1364, @rgrinberg)
- Fix reason support when using `staged_pps` (#1384, @charlesetc)
- Add support for `enabled_if` in `rule`, `menhir`, `ocamllex`,
`ocamlyacc` (#1387, @diml)
- Exit gracefully when a signal is received (#1366, @diml)
- Load all defined libraries recursively into utop (#1384, fix #1344,
@rgrinberg)
- Allow to use libraries `bytes`, `result` and `uchar` without `findlib`
installed (#1391, @nojb)
- Take argument to self_build_stubs_archive into account. (#1395, @nojb)
- Fix bad interaction between `env` customization and vendored
projects: when a vendored project didn't have its own `env` stanza,
the `env` stanza from the enclosing project was in effect (#1408,
@diml)
- Fix stop early bug when scanning for watermarks (#1423, @struktured)
1.3.0 (23/09/2018)
------------------
- Support colors on Windows (#1290, @diml)
- Allow `dune.configurator` and `base` to be used together (#1291, fix
#1167, @diml)
- Support interrupting and restarting builds on file changes (#1246,
@kodek16)
- Fix findlib-dynload support with byte mode only (#1295, @bobot)
- Make `dune rules -m` output a valid makefile (#1293, @diml)
- Expand variables in `(targets ..)` field (#1301, #1320, fix #1189, @nojb,
@rgrinberg, @diml)
- Fix a race condition on Windows that was introduced in 1.2.0
(#1304, fix #1303, @diml)
- Fix the generation of .merlin files to account for private modules
(@rgrinberg, fix #1314)
- Exclude the local opam switch directory (`_opam`) from the list of watched
directories (#1315, @dysinger)
- Fix compilation of the module generated for `findlib.dynload`
(#1317, fix #1310, @diml)
- Lift restriction on `copy_files` and `copy_files#` stanzas that files to be
copied should be in a subdirectory of the current directory.
(#1323, fix #911, @nojb)
1.2.1 (17/09/2018)
------------------
- Enrich the `dune` Emacs mode with syntax highlighting and indentation. New
file `dune-flymake` to provide a hook `dune-flymake-dune-mode-hook` to enable
linting of dune files. (#1265, @Chris00)
- Pass `link_flags` to `cc` when compiling with `Configurator.V1.c_test` (#1274,
@rgrinberg)
- Fix digest calculation of aliases. It should take into account extra bindings
passed to the alias (#1277, fix #1276, @rgrinberg)
- Fix a bug causing `dune` to fail eagerly when an optional library
isn't available (#1281, @diml)
- ocamlmklib should use response files only if ocaml >= 4.08 (#1268, @bryphe)
1.2.0 (14/09/2018)
------------------
- Ignore stderr output when trying to find out the number of jobs
available (#1118, fix #1116, @diml)
- Fix error message when the source directory of `copy_files` does not exist.
(#1120, fix #1099, @emillon)
- Highlight error locations in error messages (#1121, @emillon)
- Display actual stanza when package is ambiguous (#1126, fix #1123, @emillon)
- Add `dune unstable-fmt` to format `dune` files. The interface and syntax are
still subject to change, so use with caution. (#1130, fix #940, @emillon)
- Improve error message for `dune utop` without a library name (#1154, fix
#1149, @emillon)
- Fix parsing `ocamllex` stanza in jbuild files (#1150, @rgrinberg)
- Highlight multi-line errors (#1131, @anuragsoni)
- Do no try to generate shared libraries when this is not supported by
the OS (#1165, fix #1051, @diml)
- Fix `Flags.write_{sexp,lines}` in configurator by avoiding the use of
`Stdune.Path` (#1175, fix #1161, @rgrinberg)
- Add support for `findlib.dynload`: when linking an executable using
`findlib.dynload`, automatically record linked in libraries and
findlib predicates (#1172, @bobot)
- Add support for promoting a selected list of files (#1192, @diml)
- Add an emacs mode providing helpers to promote correction files
(#1192, @diml)
- Improve message suggesting to remove parentheses (#1196, fix #1173, @emillon)
- Add `(wrapped (transition "..message.."))` as an option that will generate
wrapped modules but keep unwrapped modules with a deprecation message to
preserve compatibility. (#1188, fix #985, @rgrinberg)
- Fix the flags passed to the ppx rewriter when using `staged_pps` (#1218, @diml)
- Add `(env var)` to add a dependency to an environment variable.
(#1186, @emillon)
- Add a simple version of a polling mode: `dune build -w` keeps
running and restarts the build when something change on the
filesystem (#1140, @kodek16)
- Cleanup the way we detect the library search path. We no longer call
`opam config var lib` in the default build context (#1226, @diml)
- Make test stanzas honor the -p flag. (#1236, fix #1231, @emillon)
- Test stanzas take an optional (action) field to customize how they run (#1248,
#1195, @emillon)
- Add support for private modules via the `private_modules` field (#1241, fix
#427, @rgrinberg)
- Add support for passing arguments to the OCaml compiler via a
response file when the list of arguments is too long (#1256, @diml)
- Do not print diffs by default when running inside dune (#1260, @diml)
- Interpret `$ dune build dir` as building the default alias in `dir`. (#1259,
@rgrinberg)
- Make the `dynlink` library available without findlib installed (#1270, fix
#1264, @rgrinberg)
1.1.1 (08/08/2018)
------------------
- Fix `$ jbuilder --dev` (#1104, fixes #1103, @rgrinberg)
- Fix dune exec when `--build-dir` is set to an absolute path (#1105, fixes
#1101, @rgrinberg)
- Fix duplicate profile argument in suggested command when an external library
is missing (#1109, #1106, @emillon)
- `-opaque` wasn't correctly being added to modules without an interface.
(#1108, fix #1107, @rgrinberg)
- Fix validation of library `name` fields and make sure this validation also
applies when the `name` is derived from the `public_name`. (#1110, fix #1102,
@rgrinberg)
- Fix a bug causing the toplevel `env` stanza in the workspace file to
be ignored when at least one context had `(merlin)` (#1114, @diml)
1.1.0 (06/08/2018)
------------------
- Fix lookup of command line specified files when `--root` is given. Previously,
passing in `--root` in conjunction with `--workspace` or `--config` would not
work correctly (#997, @rgrinberg)
- Add support for customizing env nodes in workspace files. The `env` stanza is
now allowed in toplevel position in the workspace file, or for individual
contexts. This feature requires `(dune lang 1.1)` (#1038, @rgrinberg)
- Add `enabled_if` field for aliases and tests. This field controls whether the
test will be ran using a boolean expression language. (#819, @rgrinberg)
- Make `name`, `names` fields optional when a `public_name`, `public_names`
field is provided. (#1041, fix #1000, @rgrinberg)
- Interpret `X` in `--libdir X` as relative to `PREFIX` when `X` is relative
(#1072, fix #1070, @diml)
- Add support for multi directory libraries by writing
`(include_subdirs unqualified)` (#1034, @diml)
- Add `(staged_pps ...)` to support staged ppx rewriters such as ones
using the OCaml typer like `ppx_import` (#1080, fix #193, @diml)
- Use `-opaque` in the `dev` profile. This option trades off binary quality for
compilation speed when compiling .cmx files. (#1079, fix #1058, @rgrinberg)
- Fix placeholders in `dune subst` documentation (#1090, @emillon, thanks
@trefis for the bug report)
- Add locations to errors when a missing binary in PATH comes from a dune file
(#1096, fixes #1095, @rgrinberg)
1.0.1 (19/07/2018)
------------------
- Fix parsing of `%{lib:name:file}` forms (#1022, fixes #1019, @diml)
1.0.0 (10/07/2018)
------------------
- Do not load the user configuration file when running inside dune
(#700 @diml)
- Do not infer ${null} to be a target (#693 fixes #694 @rgrinberg)
- Introduce jbuilder.configurator library. This is a revived version of
janestreet's configurator library with better cross compilation support, a
versioned API, and no external dependencies. (#673, #678 #692, #695
@rgrinberg)
- Register the transitive dependencies of compilation units as the
compiler might read `.cm*` files recursively (#666, fixes #660,
@emillon)
- Fix a bug causing `jbuilder external-lib-deps` to crash (#723,
@diml)
- `-j` now defaults to the number of processing units available rather
4 (#726, @diml)
- Fix attaching index.mld to documentation (#731, fixes #717 @rgrinberg)
- Scan the file system lazily (#732, fixes #718 and #228, @diml)
- Add support for setting the default ocaml flags and for build
profiles (#419, @diml)
- Display a better error messages when writing `(inline_tests)` in an
executable stanza (#748, @diml)
- Restore promoted files when they are deleted or changed in the
source tree (#760, fix #759, @diml)
- Fix a crash when using an invalid alias name (#762, fixes #761,
@diml)
- Fix a crash when using c files from another directory (#758, fixes
#734, @diml)
- Add an `ignored_subdirs` stanza to replace `jbuild-ignore` files
(#767, @diml)
- Fix a bug where Dune ignored previous occurrences of duplicated
fields (#779, @diml)
- Allow setting custom build directories using the `--build-dir` flag or
`DUNE_BUILD_DIR` environment variable (#846, fix #291, @diml @rgrinberg)
- In dune files, remove support for block (`#| ... |#)`) and sexp
(`#;`) comments. These were very rarely used and complicate the
language (#837, @diml)
- In dune files, add support for block strings, allowing to nicely
format blocks of texts (#837, @diml)
- Remove hard-coded knowledge of ppx_driver and
ocaml-migrate-parsetree when using a `dune` file (#576, @diml)
- Make the output of Dune slightly more deterministic when run from
inside Dune (#855, @diml)
- Simplify quoting behavior of variables. All values are now multi-valued and
whether a multi valued variable is allowed is determined by the quoting and
substitution context it appears in. (#849, fix #701, @rgrinberg)
- Fix documentation generation for private libraries. (#864, fix #856,
@rgrinberg)
- Use `Marshal` to store digest and incremental databases. This improves the
speed of 0 rebuilds. (#817, @diml)
* Allow setting environment variables in `findlib.conf` for cross compilation
contexts. (#733, @rgrinberg)
- Add a `link_deps` field to executables, to specify link-time dependencies
like version scripts. (#879, fix #852, @emillon)
- Rename `files_recursively_in` to `source_tree` to make it clearer it
doesn't include generated files (#899, fix #843, @diml)
- Present the `menhir` stanza as an extension with its own version
(#901, @diml)
- Improve the syntax of flags in `(pps ...)`. Now instead of `(pps
(ppx1 -arg1 ppx2 (-foo x)))` one should write `(pps ppx1 -arg ppx2
-- -foo x)` which looks nicer (#910, @diml)
- Make `(diff a b)` ignore trailing cr on Windows and add `(cmp a b)` for
comparing binary files (#904, fix #844, @diml)
- Make `dev` the default build profile (#920, @diml)
- Version `dune-workspace` and `~/.config/dune/config` files (#932, @diml)
- Add the ability to build an alias non-recursively from the command
line by writing `@@alias` (#926, @diml)
- Add a special `default` alias that defaults to `(alias_rec install)`
when not defined by the user and make `@@default` be the default
target (#926, @diml)
- Forbid `#require` in `dune` files in OCaml syntax (#938, @diml)
- Add `%{profile}` variable. (#938, @rgrinberg)
- Do not require opam-installer anymore (#941, @diml)
- Add the `lib_root` and `libexec_root` install sections (#947, @diml)
- Rename `path:file` to `dep:file` (#944, @emillon)
- Remove `path-no-dep:file` (#948, @emillon)
- Adapt the behavior of `dune subst` for dune projects (#960, @diml)
- Add the `lib_root` and `libexec_root` sections to install stanzas
(#947, @diml)
- Add a `Configurator.V1.Flags` module that improves the flag reading/writing
API (#840, @avsm)
- Add a `tests` stanza that simlpified defining regular and expect tests
(#822, @rgrinberg)
- Change the `subst` subcommand to lookup the project name from the
`dune-project` whenever it's available. (#960, @diml)
- The `subst` subcommand no longer looks up the root workspace. Previously this
detection would break the command whenever `-p` wasn't passed. (#960, @diml)
- Add a `# DUNE_GEN` in META template files. This is done for consistency with
`# JBUILDER_GEN`. (#958, @rgrinberg)
- Rename the following variables in dune files:
+ `SCOPE_ROOT` to `project_root`
+ `@` to `targets`
+ `^` to `deps`
`<` was renamed in this PR and latter deleted in favor or named dependencies.
(#957, @rgrinberg)
- Rename `ROOT` to `workspace_root` in dune files (#993, @diml)
- Lowercase all built-in %{variables} in dune files (#956, @rgrinberg)
- New syntax for naming dependencies: `(deps (:x a b) (:y (glob_files *.c*)))`.
This replaces the use for `${<}` in dune files. (#950, @diml, @rgrinberg)
- Fix detection of dynamic cycles, which in particular may appear when
using `(package ..)` dependencies (#988, @diml)
1.0+beta20 (10/04/2018)
-----------------------
......@@ -11,12 +529,12 @@
everything in the universe. Jbuilder cannot cache the result of an action that
depend on the universe (#603, fixes #255 @diml)
- Add a `(package <package>)` dependency specification to indicate
dependency on a whole package. Rules depending on whole pacakge will
be executed in an environment similar to the one we get once the
package is installed (#624, @rgrinberg and @diml)
- Add a `(package <package>)` dependency specification to indicate dependency on
a whole package. Rules depending on whole package will be executed in an
environment similar to the one we get once the package is installed (#624,
@rgrinberg and @diml)
- Don't pass `-runtime-variant _pic` on Windows (#635)
- Don't pass `-runtime-variant _pic` on Windows (#635, fixes #573 @diml)
- Display documentation in alphabetical order. This is relevant to packages,
libraries, and modules. (#647, fixes #606 @rgrinberg)
......@@ -36,7 +554,7 @@
files didn't include the right `-ppx` flags in some cases (#658
fixes #657 @diml)
- Fix error messaage when a public library is defined twice. Before
- Fix error message when a public library is defined twice. Before
jbuilder would raise an uncaught exception (Fixes #661, @diml)
- Fix several cases where `external-lib-deps` was returning too little
......@@ -46,6 +564,8 @@
- Cosmetic improvements to generated entry point mld (#653 @trefis)
- Remove most useless parentheses from the syntax (#915, @diml)
1.0+beta19.1 (21/03/2018)
-------------------------
......@@ -118,7 +638,6 @@
- Add a hack to be able to build ppxlib, until beta20 which will have
generic support for ppx drivers
1.0+beta18 (25/02/2018)
-----------------------
......@@ -142,14 +661,13 @@
execution after an error was encountered. Now it continues until
all branches have been explored (#477)
- Add supprot for a user configuration file (#490)
- Add support for a user configuration file (#490)
- Add more display modes and change the default display of
Jbuilder. The mode can be set from the command line or from the
configuration file (#490)
- Allow to set the concurency level (`-j N`) from the configuration
file (#491)
- Allow to set the concurrency level (`-j N`) from the configuration file (#491)
- Store artifacts for libraries and executables in separate
directories. This ensure that Two libraries defined in the same
......@@ -170,7 +688,7 @@
- Refactor internal library management. It should now be possible to
run `jbuilder build @lint` in Base for instance (#516)
- Fix invalid warning about non-existent direcotry (#536, fixes #534)
- Fix invalid warning about non-existent directory (#536, fixes #534)
1.0+beta17 (01/02/2018)
-----------------------
......@@ -235,7 +753,7 @@
workspaces (#370)
- Now longer generate a `META.pkg.from-jbuilder` file. Now the only
way to customise the generated `META` file is through
way to customize the generated `META` file is through
`META.pkg.template`. This feature was unused and was making the code
complicated (#370)
......@@ -296,7 +814,7 @@
- Add (copy_files <glob>) and (copy_files# <glob>) stanzas. These
stanzas setup rules for copying files from a sub-directory to the
current directory. This provides a reasonable way to support
multi-directory library/executables in jbuilder (#35, Francois Bobot)
multi-directory library/executables in jbuilder (#35, @bobot)
- An empty `jbuild-workspace` file is now interpreted the same as one
containing just `(context default)`
......@@ -310,7 +828,7 @@
- Fix a bug related to `menhir` stanzas: `menhir` stanzas with a
`merge_into` field that were in `jbuild` files in sub-directories
where incorectly interpreted (#264)
where incorrectly interpreted (#264)
- Add support for locks in actions, for tests that can't be run
concurrently (#263)
......@@ -320,17 +838,17 @@
1.0+beta13 (05/09/2017)
-----------------------
- Generate toplevel html index for documentation (#224, Thomas Gazagnaire)
- Generate toplevel html index for documentation (#224, @samoht)
- Fix recompilation of native artifacts. Regression introduced in the last
version (1.0+beta12) when digests replaces timestamps for checking staleness
(#238, David Allsopp)
(#238, @dra27)
1.0+beta12 (18/08/2017)
-----------------------
- Fix the quoting of `FLG` lines in generated `.merlin` files (#200,
Marcello Seri)
@mseri)
- Use the full path of archive files when linking. Before jbuilder
would do: `-I <path> file.cmxa`, now it does `-I <path>
......@@ -344,14 +862,13 @@
`ocamlfind` is present in the `PATH` and the user didn't pass
`--prefix` or `--libdir` explicitly, use the output of `ocamlfind
printconf destdir` as destination directory for library files (#179,
Francois Bobot)
@bobot)
- Allow `(:include ...)` forms in all `*flags` fields (#153, David
Allsopp)
- Allow `(:include ...)` forms in all `*flags` fields (#153, @dra27)
- Add a `utop` subsommand. Running `jbuilder utop` in a directory
- Add a `utop` subcommand. Running `jbuilder utop` in a directory
builds and executes a custom `utop` toplevel with all libraries
defined in the current directory (#183, Rudi Grinberg)
defined in the current directory (#183, @rgrinberg)
- Do not accept `per_file` anymore in `preprocess` field. `per_file`
was renamed `per_module` and it is planned to reuse `per_file` for
......@@ -375,7 +892,7 @@
-----------------------
- Fix the error message when there are more than one `<package>.opam`
file for a given pacakge
file for a given package
- Report an error when in a wrapped library, a module that is not the
toplevel module depends on the toplevel module. This doesn't make as
......@@ -395,7 +912,7 @@
1.0+beta10 (08/06/2017)
-----------------------
- Add a `clean` subcommand (Richard Davison, #89)
- Add a `clean` subcommand (@rdavison, #89)
- Add support for generating API documentation with odoc (#74)
......@@ -438,8 +955,7 @@
- When exiting prematurely because of a failure, if there are other
background processes running and they fail, print these failures
- With msvc, `-lfoo` is transparently replaced by `foo.lib` (David
Allsopp, #127)
- With msvc, `-lfoo` is transparently replaced by `foo.lib` (@dra27, #127)
- Automatically add the `.exe` when installing executables on Windows
(#123)
......@@ -463,23 +979,22 @@
1.0+beta9 (19/05/2017)
----------------------
- Add support for building Reason projects (Rudi Grinberg, #58)
- Add support for building Reason projects (@rgrinberg, #58)
- Add support for building javascript with js-of-ocaml (Hugo Heuzard,
#60)
- Add support for building javascript with js-of-ocaml (@hhugo, #60)
- Better support for topkg release workflow. See
[topkg-jbuilder](https://github.com/diml/topkg-jbuilder) for more
details
- Port the manual to rst and setup a jbuilder project on
readthedocs.org (Rudi Grinberg, #78)
readthedocs.org (@rgrinberg, #78)
- Hint for mistyped targets. Only suggest correction on the basename
for now, otherwise it's slow when the workspace is big
- Add a `(package ...)` field for aliases, so that one can restrict
tests to a specific package (Rudi Grinberg, #64)
tests to a specific package (@rgrinberg, #64)
- Fix a couple of bugs on Windows:
+ fix parsing of end of lines in some cases
......@@ -493,7 +1008,7 @@
- Better error messages for invalid dependency list in jbuild files
- Severel improvements/fixes regarding the handling of findlib packages:
- Several improvements/fixes regarding the handling of findlib packages:
+ Better error messages when a findlib package is unavailable
+ Don't crash when an installed findlib package has missing
dependencies
......@@ -538,15 +1053,15 @@
----------------------
- Make the output quieter by default and add a `--verbose` argument
(Stephen Dolan, #40)
(@stedolan, #40)
- Various documentation fixes (Adrien Guatto, #41)
- Various documentation fixes (@adrieng, #41)
- Make `@install` the default target when no targets are specified
(Stephen Dolan, #47)
(@stedolan, #47)
- Add predefined support for menhir, similar to ocamlyacc support
(Rudi Grinberg, #42)
(@rgrinberg, #42)
- Add internal support for sandboxing actions and sandbox the build of
the alias module with 4.02 to workaround the compiler trying to read
......@@ -666,8 +1181,7 @@
- Support incremental compilation
- Switched the CLI to cmdliner and added a `build` command (#5, Rudi
Grinberg)
- Switched the CLI to cmdliner and added a `build` command (#5, @rgrinberg)
- Added a few commands:
+ `runtest`
......@@ -679,7 +1193,7 @@
- Removed the `build-package` command in favor of a `--only-packages`
option that is common to all commands
- Automatically generate `.merlin` files (#2, Richard Davison)
- Automatically generate `.merlin` files (#2, @rdavison)
- Improve the output of jbuilder, in particular don't mangle the
output of commands when using `-j N` with `N > 1`
......@@ -694,7 +1208,7 @@
order to use ppx rewriters with Jbuilder, they need to use
`ocaml-migrate-parsetree.driver`
- Added support for aliases (#7, Rudi Grinberg)
- Added support for aliases (#7, @rgrinberg)
- Added support for compiling against multiple opam switch
simultaneously by writing a `jbuild-worspace` file
......@@ -713,7 +1227,7 @@
+ ...
- Removed all implicit uses of bash or the system shell. Now one has
to write explicitely `(bash "...")` or `(system "...")`
to write explicitly `(bash "...")` or `(system "...")`
- Generate meaningful versions in `META` files
......
Dune is an community orientated open source project. It was originally
developed at [Jane Street][js] and is now maintained by Jane Street,
[OCamlLabs][ocl] as well as several developers from the OCaml
community.
Contributions to Dune are welcome and should be submitted via github
pull requests. Dune is distributed under the MIT license and
contributors are required to sign their work in order to certify that
they have the right to submit it under this license. See the following
section for more details.
Signing contributions
---------------------
We require that you sign your contributions. Your signature certifies
that you wrote the patch or otherwise have the right to pass it on as
an open-source patch. The rules are pretty simple: if you can certify
the below (from [developercertificate.org][dco]):
```
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
```
Then you just add a line to every git commit message:
```
Signed-off-by: Joe Smith <joe.smith@email.com>
```
Use your real name (sorry, no pseudonyms or anonymous contributions.)
If you set your `user.name` and `user.email` git configs, you can sign
your commit automatically with `git commit -s`.
[dco]: http://developercertificate.org/
[ocl]: http://ocamllabs.io/
# Hacking on Dune
This section is for people who want to work on Jbuilder itself.
This section is for people who want to work on Dune itself.
## Bootstrap
In order to build itself, Jbuilder uses an OCaml script
([bootstrap.ml](bootstrap.ml)) that dumps most of the sources of Jbuilder into a
In order to build itself, Dune uses an OCaml script
([bootstrap.ml](bootstrap.ml)) that dumps most of the sources of Dune into a
single `boot.ml` file. This file is built using `ocamlopt` or `ocamlc`
and used to build everything else.
To get the development version bootstrapped and installed, run the following
while in the project's root directory:
```sh
$ make # create the dune.exe file and bootstrap the dune build
$ make install # install the newly built dune
```
Note that we don't include all of the sources in boot.ml. We skip a
few parts to speed up the build. In particular:
- vendored libraries are replaced by simpler implementations taken
......@@ -19,7 +27,7 @@ few parts to speed up the build. In particular:
## OCaml compatibility test
Install opam switches for all the entries in the
[jbuild-workspace.dev](jbuild-workspace.dev) file and run:
[dune-workspace.dev](dune-workspace.dev) file and run:
```sh
$ make all-supported-ocaml-versions
......@@ -27,19 +35,18 @@ $ make all-supported-ocaml-versions
## Repository organization
- `vendor/` contains dependencies of Jbuilder, that have been vendored
- `plugin/` contains the API given to `jbuild` files that are OCaml
- `vendor/` contains dependencies of Dune, that have been vendored
- `plugin/` contains the API given to `dune` files that are OCaml
scripts
- `src/` contains the core of `Jbuilder`, as a library so that it can
be used to implement the Jenga bridge later
- `src/` contains the core of `Dune`
- `bin/` contains the command line interface
- `doc/` contains the manual and rules to generate the manual pages
## Design
Jbuilder was initially designed to sort out the public release of Jane
Street packages which became incredibly complicated over time. It is
still successfully used for this purpose.
Dune (nee "JBuilder") was initially designed to sort out the public release of
Jane Street packages which became incredibly complicated over time. It is still
successfully used for this purpose.
One necessary feature to achieve this is the ability to precisely
report the external dependencies necessary to build a given set of
......@@ -49,21 +56,59 @@ files for all Jane Street packages.
To implement this, the build rules are described using a build arrow,
which is defined in [src/build.mli](src/build.mli). In the end it makes the
development of the internal rules of Jbuilder very composable and
development of the internal rules of Dune very composable and
quite pleasant.
To deal with process multiplexing, Jbuilder uses a simplified
Lwt/Async-like monad, implemented in [src/future.mli](src/future.mli).
To deal with process multiplexing, Dune uses a simplified
Lwt/Async-like monad, implemented in [src/fiber/fiber.mli](src/fiber/fiber.mli).
## Tests
Dune uses [cram style](https://blog.janestreet.com/testing-with-expectations/)
tests for its test suite. The test suite is contained in
[test/blackbox-tests](test/blackbox-tests). A single test consists of a test
directory in the test-cases/ sub directory which contains a run.t file defining
the test.
An example `run.t` file:
```
A description of the test. The command running the tests is preceeded by
two spaces and a $. The expected output of the command is also indented by
two spaces and is right below the command (note the absence of a $)
$ echo "the expected output is below"
the expected output is below
```
Running the entire test suite is done with `$ make test`. A particular test can
be executed with `$ dune build @<test-name>`.
Running the test will execute the command after the `$` and its output will be
compared against the expected output right below the command. Any differences
will result in a test failure.
### Adding a Test
Simply add a new directory in test/blackbox-tests/test-cases and then `$ make`
generate the rules for the test , followed by `$ make promote` to accept the new
rules.
### Accepting Corrections
A failing expect test will generate a diff between the expected and actual
output. If the new output generate by the command is satisfactory, it can be
*promoted* with the `$ make promote` command.
## Code flow
- [src/jbuild.mli](src/jbuild.mli) contains the internal representation
of `jbuild` files and the parsing code
- [src/dune_file.mli](src/dune_file.mli) contains the internal representation
of `dune` files and the parsing code
- [src/jbuild_load.mli](src/jbuild_load.mli) contains the code to scan
a source tree and build the internal database by reading
the `jbuild` files
the `dune` files
- [src/gen_rules.mli](src/gen_rules.mli) contains all the build rules
of Jbuilder
of Dune
- [src/build_system.mli](src/build_system.mli) contains a trivial
implementation of a Build system. This is what Jenga will provide
when implementing the bridge
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
The MIT License
Copyright (c) 2016 Jane Street Group, LLC <opensource@janestreet.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
jbuilder has been renamed to dune. Refer to the manual for details of the
migration:
[manual](http://dune.readthedocs.io/en/latest/migration.html).
PREFIX_ARG := $(if $(PREFIX),--prefix $(PREFIX),)
LIBDIR_ARG := $(if $(LIBDIR),--libdir $(LIBDIR),)
INSTALL_ARGS := $(PREFIX_ARG) $(LIBDIR_ARG)
BIN := ./_build/default/bin/main_dune.exe
-include Makefile.dev
default: boot.exe
./boot.exe
release: boot.exe
./boot.exe --release
boot.exe: bootstrap.ml
ocaml bootstrap.ml
install:
$(BIN) install $(INSTALL_ARGS) dune
uninstall:
$(BIN) uninstall $(INSTALL_ARGS) dune
reinstall: uninstall reinstall
test:
$(BIN) runtest
test-js:
$(BIN) build @runtest-js
test-all:
$(BIN) build @runtest @runtest-js
check:
$(BIN) build @check
promote:
$(BIN) promote
accept-corrections: promote
all-supported-ocaml-versions:
$(BIN) build @install @runtest --workspace dune-workspace.dev --root .
clean:
rm -f ./boot.exe $(wildcard ./bootstrap.cmi ./bootstrap.cmo ./bootstrap.exe)
$(BIN) clean
distclean: clean
rm -f src/setup.ml
doc:
cd doc && sphinx-build . _build
livedoc:
cd doc && sphinx-autobuild . _build \
-p 8888 -q --host $(shell hostname) -r '\.#.*'
update-jbuilds: $(BIN)
$(BIN) build @doc/runtest --auto-promote
# If the first argument is "run"...
ifeq (dune,$(firstword $(MAKECMDGOALS)))
# use the rest as arguments for "run"
RUN_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS))
# ...and turn them into do-nothing targets
$(eval $(RUN_ARGS):;@:)
endif
dune: $(BIN)
$(BIN) $(RUN_ARGS)
.PHONY: default install uninstall reinstall clean test doc
.PHONY: promote accept-corrections opam-release dune check
opam-release:
dune-release distrib --skip-build --skip-lint --skip-tests
dune-release publish distrib --verbose
dune-release opam pkg
dune-release opam submit
Dune (Jbuilder) - A composable build system
===========================================
Dune - A composable build system
================================
__Jbuilder has been renamed to Dune__. A full renaming of the documentation and
the tool will be done as part of the 1.0 release.
Jbuilder is a build system designed for OCaml/Reason projects only. It
Dune is a build system designed for OCaml/Reason projects only. It
focuses on providing the user with a consistent experience and takes
care of most of the low-level details of OCaml compilation. All you
have to do is provide a description of your project and Jbuilder will
have to do is provide a description of your project and dune will
do the rest.
The scheme it implements is inspired from the one used inside Jane
......@@ -15,17 +12,17 @@ Street and adapted to the open source world. It has matured over a
long time and is used daily by hundreds of developers, which means
that it is highly tested and productive.
Jbuilder comes with a [manual][manual]. If you want to get started
Dune comes with a [manual][manual]. If you want to get started
without reading too much, you can look at the [quick start
guide][quick-start] or watch [this introduction video][video].
The [example][example] directory contains examples of projects using
jbuilder.
dune.
[![Travis status][travis-img]][travis] [![AppVeyor status][appveyor-img]][appveyor]
[manual]: https://jbuilder.readthedocs.io/en/latest/
[quick-start]: https://jbuilder.readthedocs.io/en/latest/quick-start.html
[manual]: https://dune.readthedocs.io/en/latest/
[quick-start]: https://dune.readthedocs.io/en/latest/quick-start.html
[example]: https://github.com/ocaml/dune/tree/master/example
[travis]: https://travis-ci.org/ocaml/dune
[travis-img]: https://travis-ci.org/ocaml/dune.svg?branch=master
......@@ -33,7 +30,6 @@ jbuilder.
[appveyor-img]: https://ci.appveyor.com/api/projects/status/rsxayce22e8f2jkp?svg=true
[merlin]: https://github.com/ocaml/merlin
[opam]: https://opam.ocaml.org
[jenga]: https://github.com/janestreet/jenga
[issues]: https://github.com/ocaml/dune/issues
[topkg-jbuilder]: https://github.com/diml/topkg-jbuilder
[video]: https://youtu.be/BNZhmMAJarw
......@@ -41,36 +37,36 @@ jbuilder.
Overview
--------
Jbuilder reads project metadata from `jbuild` files, which are either
Dune reads project metadata from `dune` files, which are either
static files in a simple S-expression syntax or OCaml scripts. It uses
this information to setup build rules, generate configuration files
for development tools such as [merlin][merlin], handle installation,
etc...
Jbuilder itself is fast, has very low overhead and supports parallel
Dune itself is fast, has very low overhead and supports parallel
builds on all platforms. It has no system dependencies: all you need
to build jbuilder and packages using jbuilder is OCaml. You don't need
to build dune and packages using dune is OCaml. You don't need
`make` or `bash` as long as the packages themselves don't use `bash`
explicitly.
Especially, one can install OCaml on Windows with a binary installer
and then use only the Windows Console to build Jbuilder and packages
using Jbuilder.
and then use only the Windows Console to build dune and packages
using dune.
Strengths
---------
### Composable
Take n repositories that use Jbuilder, arrange them in any way on the
file system and the result is still a single repository that Jbuilder
Take n repositories that use dune, arrange them in any way on the
file system and the result is still a single repository that dune
knows how to build at once.
This make simultaneous development on multiple packages trivial.
### Gracefully handles multi-package repositories
Jbuilder knows how to handle repositories containing several
Dune knows how to handle repositories containing several
packages. When building via [opam][opam], it is able to correctly use
libraries that were previously installed even if they are already
present in the source tree.
......@@ -78,43 +74,32 @@ present in the source tree.
The magic invocation is:
```sh
$ jbuilder build --only-packages <package-name> @install
$ dune build --only-packages <package-name> @install
```
### Building against several configurations at once
Jbuilder is able to build a given source code repository against
Dune is able to build a given source code repository against
several configurations simultaneously. This helps maintaining packages
across several versions of OCaml as you can tests them all at once
across several versions of OCaml as you can test them all at once
without hassle.
This feature should make cross-compilation easy, see details in the
[roadmap](ROADMAP.md).
In particular, this makes it easy to handle [cross-compilation](https://dune.readthedocs.io/en/latest/advanced-topics.html#cross-compilation).
This feature requires [opam][opam].
### Jenga bridge
[Jenga][jenga] is another build system for OCaml that has more
advanced features such as polling or much better editor
integration. Jenga is more powerful and more complex and as a result
has many more dependencies. It is planned to implement a small bridge
between the two so that a Jbuilder project can build with Jenga using
this bridge.
Requirements
------------
Jbuilder requires OCaml version 4.02.3 or greater.
Dune requires OCaml version 4.02.3 or greater.
installation
Installation
------------
The recommended way to install jbuilder is via the
[opam package manager][opam]:
The recommended way to install dune is via the [opam package manager][opam]:
```sh
$ opam install jbuilder
$ opam install dune
```
You can also build it manually with:
......@@ -124,8 +109,7 @@ $ make release
$ make install
```
Note however that `make install` requires the `opam-installer`
tool. Running simply `make` will build jbuilder using the development
Running simply `make` will build dune using the development
settings.
If you do not have `make`, you can do the following:
......@@ -133,22 +117,28 @@ If you do not have `make`, you can do the following:
```sh
$ ocaml bootstrap.ml
$ ./boot.exe
$ ./_build/default/bin/main.exe install
$ ./_build/default/bin/main_dune.exe install dune
```
Support
-------
If you have questions about jbuilder, you can send an email to
If you have questions about dune, you can send an email to
ocaml-core@googlegroups.com or [open a ticket on github][issues].
Migration from jbuilder
-----------------------
Dune was formerly known as jbuilder. Migration from jbuilder to dune is
described in the [manual](http://dune.readthedocs.io/en/latest/migration.html).
Status
------
Dune is now fairly stable and is used by the majority of packages on
opam. The package is still in beta version as we are waiting for the
renaming from Jbuilder to Dune before releasing version 1.0.0. Note
that Dune will have backward compatiblity with Jbuilder, in particular
renaming from Jbuilder to dune before releasing version 1.0.0. Note
that dune will have backward compatibility with Jbuilder, in particular
existing Jbuilder projects will continue to be buildable with
Dune. Additionally, Dune will be able to automatically convert a
Jbuilder project into a Dune project.
dune.
......@@ -7,7 +7,9 @@ install:
build_script:
- cd "%APPVEYOR_BUILD_FOLDER%"
- ocaml bootstrap.ml
- boot.exe --dev
- boot.exe
- copy _build\install\default\bin\dune.exe dune.exe
- dune.exe build @test\blackbox-tests\windows-diff
artifacts:
- path: _build/log
......
(library
(name dune_bench)
(libraries stdune fiber dune)
(modules :standard \ main)
(library_flags -linkall)
(preprocess (pps ppx_bench)))
(executable
(name main)
(modules main)
(libraries which_program_dune dune_bench core_bench.inline_benchmarks))
Inline_benchmarks_public.Runner.main ~libname:"dune_bench"
#!/usr/bin/env sh
export BENCHMARKS_RUNNER=TRUE
export BENCH_LIB=dune_bench
exec dune exec -- ./main.exe -fork -run-without-cross-library-inlining "$@"
(* Benchmark the scheduler *)
open Stdune
open Dune
let () =
Path.set_root (Path.External.cwd ());
Path.set_build_dir (Path.Kind.of_string "_build")
let prog =
Option.value_exn (Bin.which ~path:(Env.path Env.initial) "true")
let run () = Process.run ~env:Env.initial Strict prog []
let go ~jobs fiber =
Scheduler.go fiber ~config:{ Config.default with concurrency = Fixed jobs }
let%bench "single" = go (run ()) ~jobs:1
let l = List.init ~len:100 ~f:ignore
let%bench "many" [@indexed jobs = [1; 2; 4; 8]] =
go ~jobs (Fiber.parallel_iter l ~f:run)
open Stdune
let die = Dune.Import.die
type t =
{ name : string
; recursive : bool
; dir : Path.t
; contexts : Dune.Context.t list
}
let to_log_string { name ; recursive; dir ; contexts = _ } =
sprintf "- %s alias %s%s/%s"
(if recursive then "recursive " else "")
(if recursive then "@@" else "@")
(Path.to_string_maybe_quoted dir)
name
let in_dir ~name ~recursive ~contexts dir =
Util.check_path contexts dir;
match Path.extract_build_context dir with
| None ->
{ dir
; recursive
; name
; contexts
}
| Some ("install", _) ->
die "Invalid alias: %s.\n\
There are no aliases in %s."
(Path.to_string_maybe_quoted Path.(relative build_dir "install"))
(Path.to_string_maybe_quoted dir)
| Some (ctx, dir) ->
{ dir
; recursive
; name
; contexts =
[List.find_exn contexts ~f:(fun c -> Dune.Context.name c = ctx)]
}
let of_string common s ~contexts =
if not (String.is_prefix s ~prefix:"@") then
None
else
let pos, recursive =
if String.length s >= 2 && s.[1] = '@' then
(2, false)
else
(1, true)
in
let s = String.drop s pos in
let path = Path.relative Path.root (Common.prefix_target common s) in
if Path.is_root path then
die "@@ on the command line must be followed by a valid alias name"
else if not (Path.is_managed path) then
die "@@ on the command line must be followed by a relative path"
else
let dir = Path.parent_exn path in
let name = Path.basename path in
Some (in_dir ~name ~recursive ~contexts dir)
open Stdune
type t = private
{ name : string
; recursive : bool
; dir : Path.t
; contexts : Dune.Context.t list
}
val in_dir
: name:string
-> recursive:bool
-> contexts:Dune.Context.t list
-> Path.t
-> t
val of_string : Common.t -> string -> contexts:Dune.Context.t list -> t option
val to_log_string : t -> string
open Stdune
open Dune
include Cmdliner.Arg
let package_name =
conv ((fun p -> Ok (Package.Name.of_string p)), Package.Name.pp)
module Path : sig
type t
val path : t -> Path.t
val arg : t -> string
val conv : t conv
end = struct
type t = string
let path p = Path.of_filename_relative_to_initial_cwd p
let arg s = s
let conv = conv ((fun p -> Ok p), Format.pp_print_string)
end
let path = Path.conv
[@@@ocaml.warning "-32"]
let file = path
open Stdune
open Dune
type t =
{ debug_dep_path : bool
; debug_findlib : bool
; debug_backtraces : bool
; profile : string option
; workspace_file : Arg.Path.t option
; root : string
; target_prefix : string
; only_packages : Package.Name.Set.t option
; capture_outputs : bool
; x : string option
; diff_command : string option
; auto_promote : bool
; force : bool
; ignore_promoted_rules : bool
; build_dir : string
; (* Original arguments for the external-lib-deps hint *)
orig_args : string list
; config : Config.t
; default_target : string
(* For build & runtest only *)
; watch : bool
; stats : bool
}
let prefix_target common s = common.target_prefix ^ s
let set_dirs c =
if c.root <> Filename.current_dir_name then
Sys.chdir c.root;
Path.set_root (Path.External.cwd ());
Path.set_build_dir (Path.Kind.of_string c.build_dir)
let set_common_other c ~targets =
Clflags.debug_dep_path := c.debug_dep_path;
Clflags.debug_findlib := c.debug_findlib;
Clflags.debug_backtraces := c.debug_backtraces;
Clflags.capture_outputs := c.capture_outputs;
Clflags.diff_command := c.diff_command;
Clflags.auto_promote := c.auto_promote;
Clflags.force := c.force;
Clflags.watch := c.watch;
Clflags.external_lib_deps_hint :=
List.concat
[ ["dune"; "external-lib-deps"; "--missing"]
; c.orig_args
; targets
];
if c.stats then Stats.enable ()
let set_common c ~targets =
set_dirs c;
set_common_other c ~targets
let footer =
`Blocks
[ `S "BUGS"
; `P "Check bug reports at https://github.com/ocaml/dune/issues"
]
let copts_sect = "COMMON OPTIONS"
let help_secs =
[ `S copts_sect
; `P "These options are common to all commands."
; `S "MORE HELP"
; `P "Use `$(mname) $(i,COMMAND) --help' for help on a single command."
; footer
]
type config_file =
| No_config
| Default
| This of Path.t
let term =
let incompatible a b =
`Error (true,
sprintf
"Cannot use %s and %s simultaneously"
a b)
in
let module Let_syntax = Cmdliner.Term in
let module Term = Cmdliner.Term in
let module Manpage = Cmdliner.Manpage in
let dump_opt name value =
match value with
| None -> []
| Some s -> [name; s]
in
let docs = copts_sect in
let%map concurrency =
let arg =
Arg.conv
((fun s ->
Result.map_error (Config.Concurrency.of_string s)
~f:(fun s -> `Msg s)),
fun pp x ->
Format.pp_print_string pp (Config.Concurrency.to_string x))
in
Arg.(value
& opt (some arg) None
& info ["j"] ~docs ~docv:"JOBS"
~doc:{|Run no more than $(i,JOBS) commands simultaneously.|}
)
and debug_dep_path =
Arg.(value
& flag
& info ["debug-dependency-path"] ~docs
~doc:{|In case of error, print the dependency path from
the targets on the command line to the rule that failed.
|})
and debug_findlib =
Arg.(value
& flag
& info ["debug-findlib"] ~docs
~doc:{|Debug the findlib sub-system.|})
and debug_backtraces =
Arg.(value
& flag
& info ["debug-backtraces"] ~docs
~doc:{|Always print exception backtraces.|})
and display =
Term.ret @@
let%map verbose =
Arg.(value
& flag
& info ["verbose"] ~docs
~doc:"Same as $(b,--display verbose)")
and display =
Arg.(value
& opt (some (enum Config.Display.all)) None
& info ["display"] ~docs ~docv:"MODE"
~doc:{|Control the display mode of Dune.
See $(b,dune-config\(5\)) for more details.|})
in
match verbose, display with
| false , None -> `Ok None
| false , Some x -> `Ok (Some x)
| true , None -> `Ok (Some Config.Display.Verbose)
| true , Some _ -> incompatible "--display" "--verbose"
and no_buffer =
Arg.(value
& flag
& info ["no-buffer"] ~docs ~docv:"DIR"
~doc:{|Do not buffer the output of commands executed by dune.
By default dune buffers the output of subcommands, in order
to prevent interleaving when multiple commands are executed
in parallel. However, this can be an issue when debugging
long running tests. With $(b,--no-buffer), commands have direct
access to the terminal. Note that as a result their output won't
be captured in the log file.
You should use this option in conjunction with $(b,-j 1),
to avoid interleaving. Additionally you should use
$(b,--verbose) as well, to make sure that commands are printed
before they are being executed.|})
and workspace_file =
Arg.(value
& opt (some path) None
& info ["workspace"] ~docs ~docv:"FILE"
~doc:"Use this specific workspace file instead of looking it up.")
and auto_promote =
Arg.(value
& flag
& info ["auto-promote"] ~docs
~doc:"Automatically promote files. This is similar to running
$(b,dune promote) after the build.")
and force =
Arg.(value
& flag
& info ["force"; "f"]
~doc:"Force actions associated to aliases to be re-executed even
if their dependencies haven't changed.")
and watch =
Arg.(value
& flag
& info ["watch"; "w"]
~doc:"Instead of terminating build after completion, wait continuously
for file changes.")
and root,
only_packages,
ignore_promoted_rules,
config_file,
profile,
default_target,
orig =
let default_target_default =
match Which_program.t with
| Dune -> "@@default"
| Jbuilder -> "@install"
in
let for_release = "for-release-of-packages" in
Term.ret @@
let%map root =
Arg.(value
& opt (some dir) None
& info ["root"] ~docs ~docv:"DIR"
~doc:{|Use this directory as workspace root instead of
guessing it. Note that this option doesn't change
the interpretation of targets given on the command
line. It is only intended for scripts.|})
and only_packages =
Arg.(value
& opt (some string) None
& info ["only-packages"] ~docs ~docv:"PACKAGES"
~doc:{|Ignore stanzas referring to a package that is not in
$(b,PACKAGES). $(b,PACKAGES) is a comma-separated list
of package names. Note that this has the same effect
as deleting the relevant stanzas from jbuild files.
It is mostly meant for releases. During development,
it is likely that what you want instead is to
build a particular $(b,<package>.install) target.|}
)
and ignore_promoted_rules =
Arg.(value
& flag
& info ["ignore-promoted-rules"] ~docs
~doc:"Ignore rules with (mode promote)")
and (config_file_opt, config_file) =
Term.ret @@
let%map config_file =
Arg.(value
& opt (some path) None
& info ["config-file"] ~docs ~docv:"FILE"
~doc:"Load this configuration file instead of \
the default one.")
and no_config =
Arg.(value
& flag
& info ["no-config"] ~docs
~doc:"Do not load the configuration file")
in
match config_file, no_config with
| None , false -> `Ok (None, Default)
| Some fn, false -> `Ok (Some "--config-file",
This (Arg.Path.path fn))
| None , true -> `Ok (Some "--no-config" , No_config)
| Some _ , true -> incompatible "--no-config" "--config-file"
and profile =
Term.ret @@
let%map dev =
Term.ret @@
let%map dev =
Arg.(value
& flag
& info ["dev"] ~docs
~doc:{|Same as $(b,--profile dev)|})
in
match dev, Which_program.t with
| false, (Dune | Jbuilder) -> `Ok false
| true, Jbuilder -> `Ok true
| true, Dune ->
`Error
(true, "--dev is no longer accepted as it is now the default.")
and profile =
Arg.(value
& opt (some string) None
& info ["profile"] ~docs
~doc:
(sprintf
{|Select the build profile, for instance $(b,dev) or
$(b,release). The default is $(b,%s).|}
Config.default_build_profile))
in
match dev, profile with
| false, x -> `Ok x
| true , None -> `Ok (Some "dev")
| true , Some _ ->
`Error (true,
"Cannot use --dev and --profile simultaneously")
and default_target =
Arg.(value
& opt (some string) None
& info ["default-target"] ~docs ~docv:"TARGET"
~doc:(sprintf
{|Set the default target that when none is specified to
$(b,dune build). It defaults to %s.|}
default_target_default))
and frop =
Arg.(value
& opt (some string) None
& info ["p"; for_release] ~docs ~docv:"PACKAGES"
~doc:{|Shorthand for $(b,--root . --only-packages PACKAGE
--ignore-promoted-rules --no-config --profile release).
You must use this option in your $(i,<package>.opam)
files, in order to build only what's necessary when
your project contains multiple packages as well as
getting reproducible builds.|})
in
let fail opt = incompatible ("-p/--" ^ for_release) opt in
match frop, root, only_packages, ignore_promoted_rules,
profile, default_target, config_file_opt with
| Some _, Some _, _, _, _, _, _ -> fail "--root"
| Some _, _, Some _, _, _, _, _ -> fail "--only-packages"
| Some _, _, _, true , _, _, _ -> fail "--ignore-promoted-rules"
| Some _, _, _, _, Some _, _, _ -> fail "--profile"
| Some _, _, _, _, _, Some s, _ -> fail s
| Some _, _, _, _, _, _, Some _ -> fail "--default-target"
| Some pkgs, None, None, false, None, None, None ->
`Ok (Some ".",
Some pkgs,
true,
No_config,
Some "release",
"@install",
["-p"; pkgs]
)
| None, _, _, _, _, _, _ ->
`Ok (root,
only_packages,
ignore_promoted_rules,
config_file,
profile,
Option.value default_target ~default:default_target_default,
List.concat
[ dump_opt "--root" root
; dump_opt "--only-packages" only_packages
; dump_opt "--profile" profile
; dump_opt "--default-target" default_target
; if ignore_promoted_rules then
["--ignore-promoted-rules"]
else
[]
; (match config_file with
| This fn -> ["--config-file"; Path.to_string fn]
| No_config -> ["--no-config"]
| Default -> [])
]
)
and x =
Arg.(value
& opt (some string) None
& info ["x"] ~docs
~doc:{|Cross-compile using this toolchain.|})
and build_dir =
let doc = "Specified build directory. _build if unspecified" in
Arg.(value
& opt (some string) None
& info ["build-dir"] ~docs ~docv:"FILE"
~env:(Arg.env_var ~doc "DUNE_BUILD_DIR")
~doc)
and diff_command =
Arg.(value
& opt (some string) None
& info ["diff-command"] ~docs
~doc:"Shell command to use to diff files.
Use - to disable printing the diff.")
and stats =
Arg.(value
& flag
& info ["stats"] ~docs
~doc:{|Record and print statistics about Dune resource usage.
|})
in
let build_dir = Option.value ~default:"_build" build_dir in
let root, to_cwd =
match root with
| Some dn -> (dn, [])
| None ->
if Config.inside_dune then
(".", [])
else
Util.find_root ()
in
let orig_args =
List.concat
[ dump_opt "--workspace" (Option.map ~f:Arg.Path.arg workspace_file)
; orig
]
in
let config =
match config_file with
| No_config -> Config.default
| This fname -> Config.load_config_file fname
| Default ->
if Config.inside_dune then
Config.default
else
Config.load_user_config_file ()
in
let config =
Config.merge config
{ display
; concurrency
}
in
let config =
Config.adapt_display config
~output_is_a_tty:(Lazy.force Colors.stderr_supports_colors)
in
{ debug_dep_path
; debug_findlib
; debug_backtraces
; profile
; capture_outputs = not no_buffer
; workspace_file
; root
; orig_args
; target_prefix = String.concat ~sep:"" (List.map to_cwd ~f:(sprintf "%s/"))
; diff_command
; auto_promote
; force
; ignore_promoted_rules
; only_packages =
Option.map only_packages
~f:(fun s -> Package.Name.Set.of_list (
List.map ~f:Package.Name.of_string (String.split s ~on:',')))
; x
; config
; build_dir
; default_target
; watch
; stats
}
open Dune
type t =
{ debug_dep_path : bool
; debug_findlib : bool
; debug_backtraces : bool
; profile : string option
; workspace_file : Arg.Path.t option
; root : string
; target_prefix : string
; only_packages : Package.Name.Set.t option
; capture_outputs : bool
; x : string option
; diff_command : string option
; auto_promote : bool
; force : bool
; ignore_promoted_rules : bool
; build_dir : string
; (* Original arguments for the external-lib-deps hint *)
orig_args : string list
; config : Config.t
; default_target : string
(* For build & runtest only *)
; watch : bool
; stats : bool
}
val prefix_target : t -> string -> string
val set_common : t -> targets:string list -> unit
val set_common_other : t -> targets:string list -> unit
val set_dirs : t -> unit
val help_secs
: [> `Blocks of [> `P of string | `S of string ] list
| `P of string
| `S of string ] list
val footer : [> `Blocks of [> `P of string | `S of string ] list ]
val term : t Cmdliner.Term.t
(library
(name main)
(modules (:standard \ main_dune main_jbuilder))
(libraries unix dune cmdliner)
(preprocess (action (run src/let-syntax/pp.exe %{input-file}))))
(executable
(name main_dune)
(public_name dune)
(package dune)
(modules main_dune)
(libraries which_program_dune main)
(preprocess no_preprocessing))
(executable
(name main_jbuilder)
(public_name jbuilder)
(package dune)
(modules main_jbuilder)
(libraries which_program_jbuilder main)
(preprocess no_preprocessing))
(executable
((name main)
(public_name jbuilder)
(libraries (unix jbuilder jbuilder_cmdliner))
(preprocess no_preprocessing)))
This diff is collapsed.