Commit Graph

265 Commits

Author SHA1 Message Date
Nathan Rebours 23717d1fd6 Drop findlib:x syntax in dune and display an error (#887)
Signed-off-by: Nathan Rebours <nathan@cryptosense.com>
2018-06-29 21:35:41 +01:00
Jérémie Dimino 7e79e2870d
Make the set language more future proof (#930)
- forbid list starting by an atom not starting with - or :
- allow to avoid the toplevel parentheses in dune files

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-29 21:11:47 +01:00
Jérémie Dimino e886e948b7
Add a test where an action modify one of its dependency (#923)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-29 12:44:51 +01:00
Jeremie Dimino 2982567639 Make the default build profile be dev
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-28 11:23:10 +01:00
Jeremie Dimino 16d34f4a07 Add Which_program to know whether we are dune or jbuilder
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-28 11:23:10 +01:00
Jérémie Dimino 9585c8f79d
Move ocamldep output files to the object directory (#918)
- this avoid the need for the "already_used" business
- this will make it easier to support multi-dir libraries without copy_files

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-28 09:46:20 +01:00
Rudi Grinberg ec14661a01 Update tests for new variables syntax
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-28 09:48:35 +06:30
Rudi Grinberg 2257a2057b Add templates to Usexp.t directly
Templates are now directly in dune's sexp language. The syntax is change to %{}
from ${} and $(). Old templates are still supported in jbuild files.

Other changes in this PR:

* Removal of ! patterns in variables
* Strict expansion for templates in dune files. Missing vars are now an error
* Using the correct syntax to parse included files in dune
* Improvements to the tests
* Syntax aware pretty printing of sexps. Now you must pass Dune vs. Jbuild to
  print sexps

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-28 09:46:10 +06:30
Jérémie Dimino 0f68e56f64
Remove most useless parentheses from the syntax (#915) 2018-06-27 16:38:05 +01:00
Jeremie Dimino f46a6aae53 Make (diff ...) work on Windows
- make (diff ...) trailing cr on Win32
- add a (cmp ...) action for comparing binary files
- add a test and run it in AppVeyor

Fix #844

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-25 08:14:27 +01:00
Jérémie Dimino 0eb302252e
Improve the syntax of ppx rewriters and flags (#910)
- old syntax: (pps (ppx1 -arg1 ppx2 (-foo x)))
- new syntax: (pps ppx1 -arg ppx2 -- -foo x)

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-25 07:56:35 +01:00
Jeremie Dimino 58997d9df7 Present menhir as an extension
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-20 16:06:38 +01:00
Jérémie Dimino 94c921f9c4
Rename files_recursively_in to source_tree (#899)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-20 10:45:54 +01:00
Jeremie Dimino 41f4b89f85 Added tests for syntax versioning
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-19 16:26:27 +01:00
Etienne Millon 96b01c569c Add link_deps field
In some cases, the linking step requires some dependencies. For example,
passing a version script to the linker. The new `(link_deps)` field
uses the dependency DSL already used in other places.

Closes #852

Signed-off-by: Etienne Millon <etienne@cryptosense.com>
2018-06-13 14:38:47 +02:00
Jeremie Dimino 5d6e919f04 Turn warning about modules being used multiple times into errors
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-13 11:51:41 +01:00
Jeremie Dimino de26077d28 Get rid of compatibility symlinks for Dune directories
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-13 11:51:41 +01:00
Jeremie Dimino ef77f83cec Add dune-project file to js_of_ocaml test
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-12 12:09:11 +01:00
Jeremie Dimino 250b940c32 Start of support for languages and extensions
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-12 12:09:11 +01:00
Jérémie Dimino 3cf2a0dab1
Add dune-project files to dune tests and remove old jbuild_version stanzas (#875)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-12 09:49:39 +01:00
Jérémie Dimino 58a47e4ff8
Set dune language version to 1.0 (#873)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-11 16:17:22 +01:00
Rudi Grinberg d864e8ca6a Add test for behavior of templates and arguments with spaces
(echo "${read:foo bar}") vs. (echo ${read:foo bar}) handles the argument
differently

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-10 21:40:44 +07:00
Etienne Millon 673397a1b9 Display the installable modes
Signed-off-by: Etienne Millon <etienne@cryptosense.com>
2018-06-07 15:40:45 +02:00
Etienne Millon 9c2e4f14e0 Display an error when no installable mode is found
If an executable is only available as a shared object for example,
Dune cannot install it. In that case, it displays an error message.
However, it is still possible to build a private one explicitly.

Signed-off-by: Etienne Millon <etienne@cryptosense.com>
2018-06-07 15:17:34 +02:00
Rudi Grinberg 724acc8c7c Allow libraries in a package to reference each other in odocs
This allows for circular dependencies for libraries in the same package

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-07 17:59:43 +07:00
Rudi Grinberg 51ec4a0dc6 Update tests
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-07 17:59:43 +07:00
Rudi Grinberg da43480dfc Fix html generation for private libs
private-doc should collect html rather than odoc aliases

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-07 17:59:43 +07:00
Rudi Grinberg abfa90b5a7 Update tests
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:44:14 +07:00
Rudi Grinberg bdeef73c29 Add test for proper concatenation
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:34 +07:00
Jeremie Dimino 124d942310 s/jbuild/dune/ in misc test
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg 9221b1ed6c Change echo to be variadic
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg eab7c46bdb Add flag to allow/disallow multivalue expansions
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg 69c0ab48ce Add test for concat_or_split
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:41:57 +07:00
Jérémie Dimino bb7827a7b2
Make the output of Dune deterministic in tests (#855)
When the root is not the cwd, print a relative path for the "Entering
..." line rather than an absolute one.

Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-06 16:25:04 +01:00
Jeremie Dimino ec6ca4be67 Refactor handling of backend selection errors + add tests
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-05 19:19:10 +01:00
Jeremie Dimino 898a2ffa02 Update gen-opam-install-file test
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-05 19:19:10 +01:00
Jeremie Dimino b5dfb826ef Restore old ppx behavior for directories with jbuild files
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-05 19:19:10 +01:00
Jeremie Dimino ed583b7651 Add List.assoc
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-05 19:19:10 +01:00
Jeremie Dimino b35fbbd7b2 Abstract the ppx driver system
- remove hard-coded knowledge of ocaml-migrate-parsetree and ppx_driver
- get the exact driver parameters directly from the driver itself

Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-05 19:19:10 +01:00
Jeremie Dimino 23a9c65ade make promote
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-04 16:26:13 +01:00
Jeremie Dimino 5b01ed8246 Add support for block strings
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-04 13:57:27 +01:00
Rudi Grinberg 077df76f6d Add a ppx rewriter example for the generated install file (#850)
Add an example using jbuild and dune files.

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-04 12:08:20 +01:00
Rudi Grinberg be7e3d6dfc Implement --build-dir and change Path.t to use symbolic paths
The motivation for this change is implement the --build-dir feature. This
feature lets us control the build directory which previously always defaulted to
_build. To accomplish this, Path.t had to be modified to be:

External of External.t | In_source_tree of Local.t | In_build_dir of Local.t

To represent the 3 kinds of paths dune is dealing with. The In_build_dir
constructor in particular, is relative to Path.root or some external path.

A few other refactorings had to be done to support this transition:

* The workspace is now "settable". This means that we no longer have to pass it
  explicitly when converting local to absolute paths.

* Path.is_local no longer makes sense and is renamed to Path.is_managed.
  Roughly, is_managed identifies paths in the build and source directories.

* Path.absoulte has been renamed of_filename_relative_to_initial_cwd

* Path.Local.root is now "." (as opposed to "")

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-02 18:14:44 +07:00
Rudi Grinberg d17292f6cd Add quoted case to quoting test
When ${@}, the current behavior should be preserved

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-01 16:49:12 +07:00
Rudi Grinberg b057c40668
Merge branch 'master' into add-classical-ppx-test 2018-05-31 10:43:22 +07:00
Rudi Grinberg 0677c2d79c Add test for using a dune library with ocamlfind
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-30 15:39:58 +07:00
Rudi Grinberg 939341af16 Add test for classical ppx
Test that generated META can be used by ocamlfind

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-30 14:59:37 +07:00
Rudi Grinberg 8f16afe293 Fix merlin generation
The optional build contexts were being dropped from the obj dirs instead of the
source dirs.

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-30 14:39:47 +07:00
Rudi Grinberg 88e71c3432
Speed up merlin generation (#805)
Improve merlin generation by minimizing intermediate strings and reusing a buffer.
2018-05-26 11:04:21 +07:00
Anil Madhavapeddy b2dd904847 odoc: make indexes work with the development version of odoc
We now generate library titles at level 2 instead of level 1,
and remove trailing fullstop after the `modules` entry.

The development branch of odoc has a more precise parser that
enforces that there is only a single title level field in the
generated odoc.

Closes #791

Signed-off-by: Anil Madhavapeddy <anil@recoil.org>
2018-05-23 10:59:19 +01:00