dune init (#3103, fixes #3046, @shonfeder)dune init exec NAME now uses the NAME argument for private modules (#3103, fixes #3088, @shonfeder)(boot) option to (coq.theories) to enable bootstrap of Coq's stdlib (#3096, @ejgallego)public_name field in favour of package (#2087, @ejgallego)* will raise an error. The previous behavior was to just do nothing (#3056, fixes #3019, @voodoos)-j1 is set. (#3112, @xclerc, @rgrinberg)enabled_if fields in executable(s) stanzas (#3137, fixes #1690 @voodoos)ocamldep, ocamlmklib, or ocaml are absent. Wait for them to be used to fail (#3138, @rgrinberg)strict_package_deps mode that verifies that dependencies between packages in the workspace are specified correctly. (@rgrinberg, #3117)@all alias is defined when no dune file is present in a directory (#2946, fix #2927, @diml)dune test is now a command alias for dune runtest. This is to make the CLI less idiosyncratic (#3006, @shonfeder)env stanza using the menhir_flags field. (#2960, fix #2924, @bschommer)dune when dune is executed inside dune. This is to make integration tests more reproducible (#3042, @diml)dune subst now works even without opam files (#2955, fixes #2910, @fangyi-zhou and @diml)./ prefix (#3041, fixes #1094, @voodoos).with-accepted-exit-codes with chdir, setenv, ignore-<outputs>, with-stdin-from and with-<outputs>-to (#3027, fixes #3014, @voodoos)(kind ppx_rewriter) (#3039, @snowleopard)..opt extensions. Previously, this detection applied to other binaries as well (@kit-ty-kate, @rgrinberg, #3051).-p mode. These packages were incorrectly filtered out before. (#3705, @diml)make now prints a message explaining the main targets available (#3085, fix #3078, @diml)byte_complete executable mode to build programs as self-contained bytecode programs (#3076, fixes #1519, @diml)Fiber.finalize function of the concurrency monad of Dune, causing a race condition at the user level (#3009, fix #2958, @diml)META format. (#2994, @rgrinberg, @anmonteiro).merlin files when depending on local libraries with more than one source directory. (#2983, @rgrinberg)@runtest and @cinaps aliases (#2831, @NathanReb)%{lib-private...} and %{libexec-private...} for finding build paths of files in public and private libraries within the same project. (#2901, @snowleopard)--mandir option to $ dune install. This option allows to override the installation directory for man pages. (#2915, fixes #2670, @rgrinberg)dune --version. The bootstrap didn't compute the version correctly. (#2929, fixes #2911, @diml)dune clean. (#2965, fixes #2964 and #2921, @diml)=, <>, ... operators in package dependencies so that we can have things such as (<> :os win32) (#2965, @diml)dune-package files. The error is now raised only if the invalid package is treated as a library and used to build something. (#2972, @rgrinberg)install before installing the new ones. (#2885, fixes #2883, @bschommer)action field in the alias stanza is not available starting lang dune 2.0. The alias field in the rule stanza is a replacement. (#2846, fixes 2681, @rgrinberg)alias and package fields to the rule stanza. This is the preferred way of attaching rules to aliases. (#2744, @rgrinberg)(optional) for executable stanzas (#2463, fixes #2433, @bobot).cm[ox] files for executables more eagerly. This speeds up builds at the cost of building unnecessary artifacts in some cases. Some of these extra artifacts can fail to built, so this is a breaking change. (#2268, @rgrinberg)<package>.install files in the source tree unless -p or --promote-install-files is passed on the command line (#2329, @diml)(explicit_js_mode) by default. (#1941, @nojb)--terminal-persistence=clear-on-rebuildjbuild files (#2440, @rgrinberg)jbuilder binary. (#2441, @diml)diff action will always normalize newlines before diffing. Perviousy, it would not do this normalization for rules defined in jbuild files. (#2457, @rgrinberg)jbuild files. (#2458, @rgrinberg)jbuild-ignore files. They have been replaced by the the dirs stanza in dune files. (#2456, @rgrinberg)sandboxing_preference, the cli argument --sandbox, and the dep spec sandbox in dune language. These let the user control the level of sandboxing done by dune per rule and globally. The rule specification takes precedence. The global configuration merely specifies the default. (#2213, @aalekseyev, @diml)(formatting) stanza in dune-project (#2347, fixes #2315, @emillon)@install to @all. (#2449, fixes #1220, @rgrinberg)@check rules. (@rgrinberg, #2530)dune-project file and no longer read VERSION or similar files (#2541, @diml)(diff? x y) action, require x to exist and register a dependency on that file. (#2486, @aalekseyev)(diff? x y) move the correction file (y) away from the build directory to promotion staging area. This makes corrections work with sandboxing and in general reduces build directory pollution. (#2486, @aalekseyev, fixes #2482)c_flags, c_names and cxx_names are now supported in executable and executables stanzas. (#2562, @nojb) Note: this feature has been subsequently extended into a separate foreign_stubs field. (#2659, RFC #2650, @snowleopard)$ dune upgrade (#2565, @rgrinberg)--disable-promotion to disable all modification to the source directory. There's also a corresponding DUNE_DISABLE_PROMOTION environment variable. (#2588, fix #2568, @rgrinberg)forbidden_libraries field to prevent some library from being linked in an executable. This help detecting who accidently pulls in unix for instance (#2570, @diml)%{lib:lib:..} when the library does not exist. (#2597, fix #1541, @rgrinberg)--sections option to $ dune install to install subsections of .install files. This is useful for installing only the binaries in a workspace for example. (#2609, fixes #2554, @rgrinberg)jbuild and jbuild-ignore files (#2607, @diml)dune-action-plugin library for describing dependencies direcly in the executable source. Programs that use this feature can be run by a new action (dynamic-run ocaml-syntax-shims binary. In order to use future_syntax, one now need to depend on the ocaml-syntax-shims package (#2654, @diml)re_export and will automatically be provided to users of a library (#2605, @rgrinberg)deprecated_library_name stanza to redirect old names after a library has been renamed (#2528, @diml)preprocessor_deps field is present but not preprocess field is. It is a warning with Dune 1.x projects (#2660, @Julow)-output-complete-exe instead of -custom when compiling self-contained bytecode executables whenever this options is available (OCaml version >= 4.10) (#2692, @nojb)(with-accepted-exit-codes <pred> <action>) to specify the set of successful exit codes of <action>. <pred> is specified using the predicate language. (#2699, @nojb)pkg-config (#2716, @AltGr)no_keep_locs is a no-op for projects that use lang dune older than 2.0. In projects where the language is at least 2.0, the field is now forbidden. (#2752, fixes #2747, @rgrinberg)(foreign_library ...) stanza as well as the (foreign_stubs ...) and (foreign_archives ...) fields. (#2659, RFC #2650, @snowleopard)license, authors, maintainers, source, bug_reports, homepage, and documentation of dune-project can now be overriden on a per-package basis. (#2774, @nojb)modes field of executables to (mode exe). If one wants to build a bytecode program, it now needs to be explicitly requested via (modes byte exe). (#2851, @diml)ccomp_type as a variable for evaluating enabled_if. (#2855, @dra27, @rgrinberg)select. The file names of conditional sources must match the prefix and the extension of the resultant filename. (#2867, @rgrinberg)disable_dynamically_linked_foreign_archives to the workspace file. If the flag is set to true then: (i) when installing libraries, we do not install dynamic foreign archives dll*.so; (ii) when building executables in the byte mode, we statically link in foreign archives into the runtime system; (iii) we do not generate any dll*.so rules. (#2864, @snowleopard).opam.template files to be generated using rules (#2866, @rgrinberg)data_only_dirs without including them as dirs (#2619, fix #2584, @rgrinberg).install files generated with an external --build-dir. (#2638, fix #2629, @rgrinberg)-nodynlink for executalbes when not necessary. It seems to be breaking things (see #2527, @diml)dune-package files. Only public names should exist in such files. (#2558, fix #2425, @rgrinberg)(source_tree ...) in the presence of directories with only sub-directories and no files (#2514, fixes #2499, @diml)dune utop. Instead, let the default implementation selection do its job. (#2327, fixes #2323, @TheLortex, review by @rgrinberg)Ppx toplevel module name for ppx rewriters (#2242, @diml)external_variant stanza. (#2169, fixes #2134, @TheLortex, review by @diml).cc and .cxx sources (#2275, @rgrinberg).cc extension was always ignored before. (#2275, @rgrinberg)$ dune init project subcommand to create project boilerplate according to a common template. (#2185, fixes #159, @shonfeder)ppx.exe as compiling host binary. (#2286, fixes #2252, @toots, review by @rgrinberg and @diml)cinaps extension and stanza for better integration with the cinaps tool tool (#2269, @diml)META and dune-package files to the one read from the vcs when no other version is available (#2224, @diml)%{target} to be used in situations where the context requires at most one word, so %{targets} can be confusing; stdout redirections and "-o" arguments of various tools are the main use case; also, introduce a separate field target that must be used instead of targets in those situations. (#2341, @aalekseyev)executable stanza (#2379, @diml)%{ignoring_promoted_rules} that is true when --ingore-promoted-rules is passed on the command line and false otherwise (#2382, @diml)future_syntax where the characters @ and & were not distinguished in the names of binding operators (let@ was the same as let&) (#2376, @aalekseyev, @diml)dune dependencies with the minimum constraint set based on the dune language version specified in the dune-project file. (2383, @avsm)66 to default set of warnings starting for dune projects with language verison >= 1.11 (@rgrinberg, @diml, fixes #2299)--context argument to dune install/uninstall (@diml, #2412)inline_tests field in the env stanza to control inline_tests framework with a variable (#2313, @mlasson, original idea by @diml, review by @rgrinberg).js for executables in order to explicitly enable Javascript targets, and a switch (explicit_js_mode) to require this mode in order to declare JS targets corresponding to executables. (#1941, @nojb)install stanza to simplify implementation and avoid dependency cycles. (#2073, @aalekseyev, @diml)coq.pp stanza to help with pre-processing of grammar files (#2054, @ejgallego, review by @rgrinberg)(promote (until-clean) (into <dir>)) (#2068, @diml)(promote (only <pred>)). For instance: (promote (only *.mli)) (#2068, @diml).opam files. In particular, a package field has been added to specify package specific information. (#2017, #2091, @avsm, @jonludlam, @rgrinberg)findlib.dynload. Before, Dune would simply match on the library name. Now, we only match on the findlib package name when the library doesn't come from Dune. Someone writing a library called findlib.dynload with Dune would have to add (special_builtin_support findlib_dynload) to trigger the special behavior. (#2115, @diml)future_syntax preprocessor as ocaml-syntax-shims.exe (#2125, @rgrinberg)CI environment variable). Commands for which the invocation might be omitted must output an error prefixed with File . Add an --always-show-command-line option to disable this behavior and always show the full command. (#2120, fixes #1733, @rgrinberg)dune-workspace files, add the ability to choose the host context and to create duplicates of the default context with different settings. (#2098, @TheLortex, review by @diml, @rgrinberg and @aalekseyev)dune subst (#2135, @diml)-pp flag in .merlin (#2142, @rgrinberg)dune subst add a (version ...) field to the dune-project file (#2148, @diml)%{os_type} variable, which is a short-hand for %{ocaml-config:os_type} (#1764, @diml)enabled_if fields in library stanzas, restricted to the %{os_type}, %{model}, %{architecture}, %{system} variables (#1764, #2164 @diml, @rgrinberg)chdir on external and source paths. Dune will also fail gracefully if the external or source path does not exist (#2165, fixes #2158, @rgrinberg).cc extension fro C++ sources (#2195, fixes #83, @rgrinberg)ocamlformat relative to the context root. This improves the locations of errors. (#2196, fixes #1370, @rgrinberg)README, LICENSE, CHANGE, and HISTORY files. These would be undetected whenever the project was nested in another workspace. (#2194, @rgrinberg).merlin whenever there's more than one stanza with the same ppx preprocessing specification (#2209 ,fixes #2206, @rgrinberg).merlin in the presence of the copy_files stanza and preprocessing specifications of other stanazs. (#2211, fixes #2206, @rgrinberg)refmt from the context's root directory. This improves error messages in case of syntax errors. (#2223, @rgrinberg)-dump-ast to the future_syntax preprocessor. Merlin doesn't seem to like it when binary AST is generated by a -pp preprocessor. (#2236, @aalekseyev)dune install will verify that all files mentioned in all .install files exist before trying to install anything. This prevents partial installation of packages (#2230, @rgrinberg).install files not being generated (#2124, fixes #2123, @rgrinberg)(using library_variants 0.1) in their dune-project file if they want to use it before the design is finalized. (#2116, @diml)dune install would install man pages to incorrect paths when compared to opam-installer. For example dune now installs (foo.1 as man1/foo.1) correctly and previously that was installed to man1/man1/foo.1. (#2105, @aalekseyev)(coqlib ...) to (coq.theory ...), support for coqlib will be dropped in the 1.0 version of the Coq language (#2055, @ejgallego)findlib.dynload. Before, Dune would simply match on the library name. Now, we only match on the findlib package name when the library doesn't come from Dune. Someone writing a library called findlib.dynload with Dune would have to add (special_builton_support findlib_dynload) to trigger the special behavior. (#2115, @diml).merlin does not reflect the preprocessing specification. This occurs when multiple stanzas in the same directory use different preprocessing specifications. This warning can now be disabled with allow_approx_merlin (#1947, fix #1946, @rgrinberg)$ dune init command. This command is used to create or update project boilerplate. (#1448, fixes #159, @shonfeder).private directory (#1983, fix #1973 @rgrinberg)dune subst attempting to substitute on directories. (#2000, fix #1997, @rgrinberg)(binaries ..) fields in the env stanza. Previously, parent binaries fields would be ignored, but instead they should be combined. (#2029, @rgrinberg)c_names and cxx_names (#2036, fix #2033, @rgrinberg)index.mld. Use correct headings for the listing. (#1925, @rgrinberg, @aantron)dune-package when version is empty string (#1919, fix #1918, @rgrinberg).cxx extension for C++ stubs (#1831, @rgrinberg)DUNE_WORKSPACE variable. This variable is equivalent to setting --workspace in the command line. (#1711, fix #1503, @rgrinberg)c_flags and cxx_flags to env profile settings (#1700 and #1800, @gretay-js)dune printenv output (#1867, fix #1862, @emillon)Add the (promote-into <dir>) and `(promote-until-clean-into
dune subst fails (#1898, fix #1897, @rgrinberg)let+ syntax of OCaml 4.08 (#1899, implements #1891, @diml).merlin files on Windows. \ characters needed to be escaped (#1869, @mlasson)$ dune format-dune-file fails. (#1915, fix #1914, @rgrinberg)query_expr and introduced query_expr_err which is the same but with a better error in case it fails. (#1886, @ejgallego)(menhir (mode promote) ...) stanzas are ignored when using --ignore-promoted-rules or -p (#1917, @diml)META files containing archives with / in the filename. For instance, this was causing llvm to be unusable with dune (#1889, fix #1885, @diml)${corrected-suffix}, ${library-name} and a few other variables to the list of variables to upgrade. This fixes the support for various framework producing corrections (#1840, #1853, @diml)$ dune subst failing because the build directory wasn't set. (#1854, fix #1846, @rgrinberg)Pkg_config.query when a full package expression is used. Add Pkg_config.query_expr for cases when the full power of pkg-config's querying is needed (#1842, fix #1833, @rgrinberg)jbuilder binary now emits a warning on every startup and both jbuilder and dune emit warnings when encountering jbuild files (#1752, @diml).cmx files of private modules (#1676, @bobot)lsof on macOS to implement --stats (#1636, fixes #1634, @xclerc)dune-package files for every package. These files are installed and read instead of META files whenever they are available (#1329, @rgrinberg)(include_subdirs ..) (#1624, fix #1626, @nojb, @rgrinberg)modes field. (#1632, fix #1617, @rgrinberg)dune compute to call internal memoized functions (#1528, @rudihorn, @diml)--trace-file option to trace dune internals (#1639, fix #1180, @emillon)--no-print-directory (borrowed from GNU make) to suppress Entering directory messages. (#1668, @dra27)--stats and track fd usage in --trace-file (#1667, @emillon)js_of_ocaml binary when the ocamlfind package is not available (#1467, @nojb)seq package available for OCaml >= 4.07 (#1714, @rgrinberg)Configurator handle sizeof (in addition to negative numbers). (#1726, fixes #1723, @Chris00)-short-paths when calling ocamlc -i (#1743, fix #1504, @diml)dune upgrade command for upgrading jbuilder projects to Dune (#1749, @diml)dune-project file, insert the detected name in it (#1749, @diml)(implicit_transitive_deps <bool>) mode to dune projects. When this mode is turned off, transitive dependencies are not accessible. Only listed dependencies are directly accessible. (#1734, #430, @rgrinberg, @hnrgrgr)toplevel stanza. This stanza is used to define toplevels with libraries already preloaded. (#1713, @rgrinberg).merlin files that account for normal preprocessors defined using a subset of the action language. (#1768, @rgrinberg)(orig_src_dir <path>) metadata in dune-package for dune packages built with --store-orig-source-dir command line flag (also controlled by DUNE_STORE_ORIG_SOURCE_DIR env variable). This is later used to generate .merlin with S-directives pointed to original source locations and thus allowing merlin to see those. (#1750, @andreypopp)dune promote when the files to be promoted have been deleted. (#1775, fixes #1772, @diml)staged_pps (#1779, fixes #1774, @diml)(mode promote) in the menhir stanza. It was previously causing intermediate mock files to be promoted (#1783, fixes #1781, @diml)which function to replace the which command line utility in a cross platform way. (#1773, fixes #1705, @Chris00)$PKG_CONFIG_PATH on macOS. Previously it was prepending paths and thus $PKG_CONFIG_PATH set by users could have been overridden by homebrew installed libraries (#1785, @andreypopp)foo.c and foo.cpp can no longer exist in the same library. (#1788, @rgrinberg)%{targets} (or ${@} in jbuild files) inside preprocessing actions (#1812, fixes #1811, @diml)DUNE_PROFILE environment variable to easily set the profile. (#1806, @rgrinberg)(no_keep_locs) field. It was only necessary until virtual libraries were supported (#1822, fix #1816, @diml)unstable-fmt to format-dune-file and remove its --inplace option. (#1821, @emillon).(using fmt 1.1) will also format dune files (#1821, @emillon)..ocamlformat-ignore files (#1824, fixes #1793, @emillon)dune external-lib-deps when preprocessors are not installed (#1607, @diml)dune external-lib-deps --sexp --unstable-by-dir so that the output can be easily processed by a machine (#1599, @diml)install stanzas (#1354, @mseri)(dirs :standard \ lib*) will use all directories except those that start with lib. (#1517, #1568, @rgrinberg)binaries field to the (env ..) stanza. This field sets and overrides binaries for rules defined in a directory. (#1521, @rgrinberg)%{bin:..}, %{exe:..}, and other static expansions in the deps field. (#1155, fix #1531, @rgrinberg)dune file (#1551, fixes #1549, @diml)--stats command line option to record resource usage (#1543, @diml)dune build @doc deleting highlight.pack.js on rebuilds, after the first build (#1557, @aantron).List.t is now provided by OCaml (#1561, @ejgallego)_esy) from the list of watched directories (#1578, @andreypopp)dune external-lib-deps (#1594, @diml)data_only_dirs to replace ignored_subdirs. ignored_subdirs is deprecated since 1.6. (#1590, @rgrinberg)dune utop <dir> when invoked from a sub-directory of the project (#1520, fix #1518, @diml)OCAMLPATH and PATH (#1436, @rgrinberg)lib.cma.js target in lib's directory. Put this target in a sub directory instead. (#1435, fix #1302, @rgrinberg).ml rather than a .ml-gen extension (#1425, fix #1414, @rgrinberg)bigarray library in >= 4.07 without ocamlfind and without installing the corresponding otherlib. (#1455, @nojb)@all alias to build all targets defined in a directory (#1409, fix #1220, @rgrinberg)@check alias to build all targets required for type checking and tooling support. (#1447, fix #1220, @rgrinberg)OCAMLFIND_TOOLCHAIN and add a toolchain option to contexts in the workspace file. (#1449, fix #1413, @rgrinberg)copy_files stanza to copy files from a non sub directory with lang set to dune < 1.3 (#1486, fixes #1485, @NathanReb)test stanza's action field. Only emits a warning for retro-compatibility (#1474, fixes #1471, @NathanReb)DESTDIR environment variable (#1475, @emillon)env stanzas (#1509, fixes #1508, @diml)context_name expansion variable (#1507, @rgrinberg)setenv. Also forbid dynamic environment names or values (#1503, @rgrinberg).ocamlc -config doesn't include standard_runtime (#1326, @diml)Configurator.V1.C_define.import handle negative integers (#1334, @Chris00)_build (#1343, fix #1342, @diml)--set-switch to opam (#1341, fix #1337, @diml)menhir stanza (#1373, fix #1372, @diml)(self_build_stubs_archive ...) and (c_names ...) or (cxx_names ...) simultaneously. (#1375, fix #1306, @nojb)staged_pps (#1384, @charlesetc)enabled_if in rule, menhir, ocamllex, ocamlyacc (#1387, @diml)bytes, result and uchar without findlib installed (#1391, @nojb)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)dune.configurator and base to be used together (#1291, fix #1167, @diml)dune rules -m output a valid makefile (#1293, @diml)(targets ..) field (#1301, #1320, fix #1189, @nojb, @rgrinberg, @diml)_opam) from the list of watched directories (#1315, @dysinger)findlib.dynload (#1317, fix #1310, @diml)copy_files and copy_files# stanzas that files to be copied should be in a subdirectory of the current directory. (#1323, fix #911, @nojb)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)link_flags to cc when compiling with Configurator.V1.c_test (#1274, @rgrinberg)dune to fail eagerly when an optional library isn't available (#1281, @diml)copy_files does not exist. (#1120, fix #1099, @emillon)dune unstable-fmt to format dune files. The interface and syntax are still subject to change, so use with caution. (#1130, fix #940, @emillon)dune utop without a library name (#1154, fix #1149, @emillon)ocamllex stanza in jbuild files (#1150, @rgrinberg)Flags.write_{sexp,lines} in configurator by avoiding the use of Stdune.Path (#1175, fix #1161, @rgrinberg)findlib.dynload: when linking an executable using findlib.dynload, automatically record linked in libraries and findlib predicates (#1172, @bobot)(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)staged_pps (#1218, @diml)(env var) to add a dependency to an environment variable. (#1186, @emillon)dune build -w keeps running and restarts the build when something change on the filesystem (#1140, @kodek16)opam config var lib in the default build context (#1226, @diml)private_modules field (#1241, fix #427, @rgrinberg)$ dune build dir as building the default alias in dir. (#1259, @rgrinberg)dynlink library available without findlib installed (#1270, fix #1264, @rgrinberg)$ jbuilder --dev (#1104, fixes #1103, @rgrinberg)--build-dir is set to an absolute path (#1105, fixes #1101, @rgrinberg)-opaque wasn't correctly being added to modules without an interface. (#1108, fix #1107, @rgrinberg)name fields and make sure this validation also applies when the name is derived from the public_name. (#1110, fix #1102, @rgrinberg)env stanza in the workspace file to be ignored when at least one context had (merlin) (#1114, @diml)--root is given. Previously, passing in --root in conjunction with --workspace or --config would not work correctly (#997, @rgrinberg)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)enabled_if field for aliases and tests. This field controls whether the test will be ran using a boolean expression language. (#819, @rgrinberg)name, names fields optional when a public_name, public_names field is provided. (#1041, fix #1000, @rgrinberg)X in --libdir X as relative to PREFIX when X is relative (#1072, fix #1070, @diml)(include_subdirs unqualified) (#1034, @diml)(staged_pps ...) to support staged ppx rewriters such as ones using the OCaml typer like ppx_import (#1080, fix #193, @diml)-opaque in the dev profile. This option trades off binary quality for compilation speed when compiling .cmx files. (#1079, fix #1058, @rgrinberg)dune subst documentation (#1090, @emillon, thanks @trefis for the bug report)%{lib:name:file} forms (#1022, fixes #1019, @diml).cm* files recursively (#666, fixes #660, @emillon)jbuilder external-lib-deps to crash (#723, @diml)-j now defaults to the number of processing units available rather 4 (#726, @diml)(inline_tests) in an executable stanza (#748, @diml)ignored_subdirs stanza to replace jbuild-ignore files (#767, @diml)--build-dir flag or DUNE_BUILD_DIR environment variable (#846, fix #291, @diml @rgrinberg)#| ... |#)) and sexp (#;) comments. These were very rarely used and complicate the language (#837, @diml)dune file (#576, @diml)Marshal to store digest and incremental databases. This improves the speed of 0 rebuilds. (#817, @diml)findlib.conf for cross compilation contexts. (#733, @rgrinberg)link_deps field to executables, to specify link-time dependencies like version scripts. (#879, fix #852, @emillon)files_recursively_in to source_tree to make it clearer it doesn't include generated files (#899, fix #843, @diml)menhir stanza as an extension with its own version (#901, @diml)(pps ...). Now instead of (pps (ppx1 -arg1 ppx2 (-foo x))) one should write (pps ppx1 -arg ppx2 -- -foo x) which looks nicer (#910, @diml)(diff a b) ignore trailing cr on Windows and add (cmp a b) for comparing binary files (#904, fix #844, @diml)dev the default build profile (#920, @diml)dune-workspace and ~/.config/dune/config files (#932, @diml)@@alias (#926, @diml)default alias that defaults to (alias_rec install) when not defined by the user and make @@default be the default target (#926, @diml)#require in dune files in OCaml syntax (#938, @diml)%{profile} variable. (#938, @rgrinberg)lib_root and libexec_root install sections (#947, @diml)path:file to dep:file (#944, @emillon)path-no-dep:file (#948, @emillon)dune subst for dune projects (#960, @diml)lib_root and libexec_root sections to install stanzas (#947, @diml)Configurator.V1.Flags module that improves the flag reading/writing API (#840, @avsm)tests stanza that simlpified defining regular and expect tests (#822, @rgrinberg)subst subcommand to lookup the project name from the dune-project whenever it's available. (#960, @diml)subst subcommand no longer looks up the root workspace. Previously this detection would break the command whenever -p wasn't passed. (#960, @diml)# 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)ROOT to workspace_root in dune files (#993, @diml)(deps (:x a b) (:y (glob_files *.c*))). This replaces the use for ${<} in dune files. (#950, @diml, @rgrinberg)(package ..) dependencies (#988, @diml)documentation stanza. This stanza allows one to attach .mld files to opam packages. (#570 @rgrinberg)(action ..)) in the context's environment. (#623 @rgrinberg)(universe) special dependency to specify that an action depend on everything in the universe. Jbuilder cannot cache the result of an action that depend on the universe (#603, fixes #255 @diml)(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)-runtime-variant _pic on Windows (#635, fixes #573 @diml)-I) flags being passed to odoc. These flags should be directories that include .odoc files, rather than the include flags of the libraries. (#652 fixes #651 @rgrinberg)-ppx flags in some cases (#658 fixes #657 @diml)external-lib-deps was returning too little dependencies (#667, fixes #644 @diml)OCAMLPATH environment variable when not relying on ocamlfind (#642 @diml)allow_overlapping_dependencies in the jbuild file (#587, fixes #562)ext_obj, ext_asm, ext_lib, ext_dll and ext_exe as well as ${ocaml-config:XXX} for most variables in the output of ocamlc -config (#590)ppx_inline_test, ppx_expect or qtest (#547)best mode which is native with fallback to byte-code when native compilation is not available (#23)ppx.driver, inline_tests and inline_tests.backend (#588)library/executables stanza. Now it is called once per file (#486)-I <stdlib-dir> to the compiler. It is useless and it causes problems in some cases (#488)-j N) from the configuration file (#491)external-lib-deps introduced in 1.0+beta17 (#512, fixes #485)@doc alias will now build only documentation for public libraries. A new @doc-private alias has been added to build documentation for private libraries.jbuilder build @lint in Base for instance (#516)num is an external package in OCaml >= 4.06.0 (#358)jbuilder exec will now rebuild the executable before running it if necessary. This can be turned off by passing --no-build (#345)jbuilder utop to work in any working directory (#339)S . to .merlin by default (#284)jbuilder exec to make it possible to execute non public executables. jbuilder exec path/bin will execute bin inside default (or specified) context relative to path. jbuilder exec /path will execute /path as absolute path but with the context's environment set appropriately. Lastly, jbuilder exec will change the root as to which paths are relative using the -root option. (#286)jbuilder rules printing rules when some binaries are missing (#292)${!...}: the split behavior is now a property of the variable. For instance ${CC}, ${^}, ${read-lines:...} all expand to lists unless used in the middle of a longer atom (#336)(include ...) stanza allowing one to include another non-generated jbuild file in the current file (#402)(diff <file1> <file2>) action allowing to diff files and promote generated files in case of mismatch (#402, #421)jbuilder promote and --auto-promote to promote files (#402, #421)(glob_files ...) with a directory that doesn't exist (#413, Fix #412)[@@deriving_inline] in .ml/.mli files. This require ppx_driver >= v0.10.2 to work properly (#415)META.pkg.from-jbuilder file. Now the only way to customize the generated META file is through META.pkg.template. This feature was unused and was making the code complicated (#370)Add a mode field to rule stanzas:
(mode standard) is the default(mode fallback) replaces (fallback)(mode promote) means that targets are copied to the source tree after the rule has completed(mode promote-until-clean) is the same as (mode promote) except that jbuilder clean deletes the files copied to the source tree. (#437)--ignore-promoted-rules to make jbuilder ignore rules with (mode promote). -p implies --ignore-promoted-rules (#437)boot.exe as a bytecode program. It makes the build of jbuilder faster and fix the build on some architectures (#463, fixes #446)install or runtest. All aliases are non-recursive. However, when requesting an alias from the command line, this request the construction of the alias in the specified directory and all its children recursively. This allows users to get the same behavior as previous recursive aliases for their own aliases, such as example. Inside jbuild files, one can use (deps (... (alias_rec xxx) ...)) to get the same behavior as on the command line. (#268). in the generated documentation index (#280).ARCH_SIXTYFOUR detection for OCaml 4.06.0 (#303)jbuild-workspace file is now interpreted the same as one containing just (context default)Entering directory '...' when the workspace root is not the current directory. This allows Emacs and Vim to know where relative filenames should be interpreted from. Fixes #138menhir stanzas: menhir stanzas with a merge_into field that were in jbuild files in sub-directories where incorrectly interpreted (#264)${..} syntax in the include stanza. (#231)FLG lines in generated .merlin files (#200, @mseri)-I <path> file.cmxa, now it does -I <path> <path>/file.cmxa. Fixes #118 and #177.merlin files. Merlin <3.0.0 used to run ppx commands from the directory where the .merlin was present but this is no longer the casejbuilder install in contexts other than opam; if 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, @bobot)(:include ...) forms in all *flags fields (#153, @dra27)utop subcommand. Running jbuilder utop in a directory builds and executes a custom utop toplevel with all libraries defined in the current directory (#183, @rgrinberg)per_file anymore in preprocess field. per_file was renamed per_module and it is planned to reuse per_file for another purpose(fallback) to custom rules to keep the current behavior (#218)deprecated-ppx-method findlib package for ppx rewriters (#222, fixes #163)<package>.opam file for a given package${SCOPE_ROOT} pointing to the root of the current scope, to fix some misuses of ${ROOT}META.pkg.template with a custom rule (#190)clean subcommand (@rdavison, #89)jbuilder exec on Windows--no-buffer option to see the output of commands in real-time. Should only be used with -j1per_file in preprocessing specifications and rename it per_modulecopy-and-add-line-directive and rename it copy#unix is supported since a few released packages are using it. The OCaml syntax might eventually be replaced by a simpler mechanism that plays better with incremental builds${^} now includes files matches by (glob_files ...) or (file_recursively_in ...)(rule (copy a b))(run ...), ${xxx} forms that expands to lists can now be split across multiple arguments by adding a !: ${!xxx}. For instance: (run foo ${!^})Add support for using the contents of a file inside an action:
${read:<file>}${read-lines:<file>}${read-strings:<file>} (same as read-lines but lines are escaped using OCaml convention)-lfoo is transparently replaced by foo.lib (@dra27, #127).exe when installing executables on Windows (#123)(run <prog> ...) now resolves <prog> locally if possible. i.e. (run ${bin:prog} ...) and (run prog ...) behave the same. This seems like the right defaultjbuild rules would crash instead of reporting a proper build error(package ...) field for aliases, so that one can restrict tests to a specific package (@rgrinberg, #64)Fix a couple of bugs on Windows:
Several improvements/fixes regarding the handling of findlib packages:
jbuilder installed-libraries --not-available explaining why some libraries are not availablejbuilder rules subcommand to dump internal compilation rules, mostly for debugging purposesIgnore all directories starting with a . or _. This seems to be a common pattern:
.git, .hg, _darcs_build_opam (opam 2 local switches)jbuilder external-lib-deps (#72)ocamllex and ocamlyacc to be at the same location as ocamlc (#75)${lib-available:<library-name>} which expands to true or false with the same semantic as literals in (select ...) stanzaslibrary-name cookie--verbose argument (@stedolan, #40)@install the default target when no targets are specified (@stedolan, #47)(no_dynlink) (#55)jbuilder exec foo. Before, even if foo was to be installed, the freshly built version wasn't selectedexists_if ... lines in META files. These are useless sine the META files are auto-generated(executable ...) stanza for single executables (#33)(package ...) and (public_name <name>)/(public_names (<names)) to executable/executables stanzas to make it easier to install executables (#33)ppx_driver.runner (#37). These problem should go away soon when we start using --cookieocamlfind is present in the PATH, do not attempt to call opam config var libocamlfind or opamJbuild_plugin.V*.sendocamlfind printconf pathjbuilder external-lib-deps --missingAdded a few forms to the DSL:
with-{stderr,outputs}-toignore-{stdout,stderr,outputs}${null} which expands to /dev/null on Unix and NUL on Windowsodoc for wrapped libraries(files_recursively_in ...)jbuilder would crash when there was no <package>.opam file.merlin files where not generated at the root of the workspace (#20)(glob_files ...) would cause other dependencies to be ignoredppx(...) line in META files(optional) when a ppx runtime dependency is not available (#24)Simplified the rules for finding the root of the workspace as the old ones were often picking up the home directory. New rules are:
jbuild-workspace file in parent directoriesjbuild-workspace* file in parent directories${ROOT} in actionsquick-start.org in the documentation directorybuild command (#5, @rgrinberg)Added a few commands:
runtestinstalluninstallinstalled-librariesexec: execute a command in an environment similar to what you would get after jbuilder installbuild-package command in favor of a --only-packages option that is common to all commands.merlin files (#2, @rdavison)-j N with N > 1_build/log(jbuilder_version 1) in a jbuild file at the root of your project to ensure forward compatibilityppx_driver to ocaml-migrate-parsetree.driver. In order to use ppx rewriters with Jbuilder, they need to use ocaml-migrate-parsetree.driverjbuild-worspace fileextended the action language to support common actions without using a shell:
(with-stdout-to <file> <DSL>)(copy <src> <dst>)(bash "...") or (system "...")META filesfoo only in the sub-tree starting from where foo.opam livesFirst release