Commit Graph

1716 Commits

Author SHA1 Message Date
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
Jérémie Dimino 0fafebe9be
Fix generation of the ppx key for jbuild directories (#860)
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-06 16:17:40 +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 84f1f9b82b Add a hint for ppx rewriters that are not compatible
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 cc5e8443c4 Improve the code for building and installing the compat ppx.exe program
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-05 19:19:10 +01:00
Jeremie Dimino adcf44942f Add a warning for with_lib_deps
I just spent an hour debugging a stupid bug caused by this...

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
Jérémie Dimino 9358bd5d64
Make Module.t private and add Module.make (#853)
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-05 18:38:27 +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 2d1ca05e67 Update the documentation of S-expressions
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-04 13:57:27 +01:00
Jeremie Dimino 0244797029 Update changelog
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-04 13:57:27 +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
Jeremie Dimino b7afc006ee Drop support block and sexp comments in Dune files
They are almost never used and they complicate the language. The
parsing of jbuild files in unchanged.

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 a0fc548eb6
Merge pull request #846 from rgrinberg/sym-path-sane
Implement --build-dir and change Path.t to use symbolic paths
2018-06-02 18:51:34 +07:00
Rudi Grinberg ffd5785e20
Merge branch 'master' into sym-path-sane 2018-06-02 18:51:14 +07:00
Rudi Grinberg e1cc944a93 Add an entry for custom build directories to the manual
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-02 18:30:06 +07:00
Rudi Grinberg 802363e4ec Add CHANGES entry
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-02 18:24:48 +07: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
Bobby Priambodo b012327f9e Temporarily fix pinning jbuilder to master (#841)
Signed-off-by: Bobby Priambodo <bobby.priambodo@gmail.com>
2018-06-02 10:01:14 +01:00
Rudi Grinberg 93070c9a4d
Merge pull request #833 from rgrinberg/return-expand
Change return type of string expansions
2018-06-02 12:22:31 +07:00
Rudi Grinberg 52d0f3f552 Change return values of SW expansions
The nested either types obscure the meaning of the return values

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-02 12:11:08 +07:00
Jérémie Dimino f70b137640
Fix 'make install' (#839)
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-01 16:56:49 +01:00
Etienne Millon e45e431588 Fix error message when no package is defined (#836)
Closes #830

Signed-off-by: Etienne Millon <etienne@cryptosense.com>
2018-06-01 14:25:35 +01:00
Etienne Millon 4ab291d0b8 Fix sphinx warnings (#835)
* Fix markup
* Fix links
* Fix references
* Fix leading space
* Add missing code markup

Signed-off-by: Etienne Millon <etienne@cryptosense.com>
2018-06-01 14:24:35 +01:00
Rudi Grinberg 576ff5293e Re-indent string_with_vars with ocp-indent
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-01 19:48:19 +07:00
Rudi Grinberg d708cc714d
Merge pull request #834 from rgrinberg/quoting-test-quoted-case
Add quoted case to quoting test
2018-06-01 17:13:17 +07:00
Rudi Grinberg 5ea3b1f533
Merge branch 'master' into quoting-test-quoted-case 2018-06-01 17:12:14 +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
Jeremie Dimino f0e448dc36 Strengthen the parsing of the (lang ...) line
It now has to be the first line of the dune-project file and the
lexical conventions are stricter than the rest of the syntax.

This will allow making changes to the lexical conventions of the
language in the future.

Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-01 08:42:45 +01:00
Jeremie Dimino 39e74826f4 Simplify the parser
Replace the current generated parser by an ocamllex lexer + a simple
parser.

The new code is:
- much simpler and smaller
- shouldn't cause ocamlopt to stack overflow anymore on BSD systems
- slightly slower but not that much

Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-01 08:42:45 +01:00
Rudi Grinberg 115ee93dd6
Merge pull request #829 from rgrinberg/little-cleanups
Little cleanups
2018-06-01 02:39:20 +07:00
Rudi Grinberg 2e86529ece
Merge branch 'master' into little-cleanups 2018-06-01 02:37:09 +07:00
Rudi Grinberg 5d0119b744
Merge pull request #827 from rgrinberg/sexpable
Move sexpable signature to Stdune.Sexp
2018-06-01 02:36:43 +07:00
Rudi Grinberg f07dff5696
Merge branch 'master' into sexpable 2018-06-01 02:33:54 +07:00
Rudi Grinberg f9a215921b Wait for deps and sdeps at once
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-01 01:28:14 +07:00
Etienne Millon e97d0c5ad6 Rename Path.readdir to Path.readdir_unsorted (#828)
As `Sys.readdir`, it returns entries in an nondeterministic order.
This can cause problems if caller relies on the list being sorted.

See #820.

Signed-off-by: Etienne Millon <etienne@cryptosense.com>
2018-05-31 14:52:10 +01:00
Rudi Grinberg 5bfacf766a Move sexpable signature to Stdune.Sexp
Also tweak Syntax.Version to match this signature

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-31 13:17:52 +07:00
Rudi Grinberg 8fea39b09b
Merge pull request #825 from rgrinberg/add-classical-ppx-test
Add test for classical ppx
2018-05-31 10:46:35 +07:00
Rudi Grinberg b057c40668
Merge branch 'master' into add-classical-ppx-test 2018-05-31 10:43:22 +07:00
Rudi Grinberg 3974ac3fa8
Merge pull request #824 from rgrinberg/merlin-fix
Merlin fix
2018-05-30 21:52:23 +07:00
Rudi Grinberg 03c5ffb805
Merge branch 'master' into merlin-fix 2018-05-30 21:51:58 +07:00
Etienne Millon 29f711985d Make "path already scanned" message deterministic (#820)
When a symlink loop is detected, the following message is printed:

> Path X has already been scanned. Cannot scan it again through symlink Y

However, the actual symlink that is displayed depends on the order in
with `readdir` outputs the contents (which depends on FS internals).

This sorts the directory list so that the message is deterministic.

It can be tested by adding for example a `List.rev` call after
`Path.readdir`: the affected version will return a different version in
the `github764` test.

Signed-off-by: Etienne Millon <etienne@cryptosense.com>
2018-05-30 12:57:23 +01:00
Jérémie Dimino 171c22614d
Use Marshal for the incremental and digest databases (#817)
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-05-30 11:54:04 +01: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 0d3bdf34fc Small cleanup of merlin generation
Use the the known src/obj dirs as the initial value for accumulation

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-30 14:41:56 +07:00