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 pacakge 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)-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 customise 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 incorectly interpreted (#264)${..} syntax in the include stanza. (#231)FLG lines in generated .merlin files (#200, Marcello Seri)-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, Francois Bobot)(:include ...) forms in all *flags fields (#153, David Allsopp)utop subsommand. Running jbuilder utop in a directory builds and executes a custom utop toplevel with all libraries defined in the current directory (#183, Rudi Grinberg)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 pacakge${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 (Richard Davison, #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 (David Allsopp, #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 (Rudi Grinberg, #64)Fix a couple of bugs on Windows:
Severel 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 (Stephen Dolan, #40)@install the default target when no targets are specified (Stephen Dolan, #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, Rudi Grinberg)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, Richard Davison)-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