Commit Graph

500 Commits

Author SHA1 Message Date
Rudi Grinberg b9dada554e Add independent pretty printing for sexp
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-23 11:58:10 +03:00
Rudi Grinberg 463ee3653a Invert the stdune and dsexp dependency
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-23 11:58:10 +03:00
Rudi Grinberg bc9e8dba1c Rename sexp_of_t to dgen and t to dsexp where appropriate
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-23 11:58:10 +03:00
Rudi Grinberg 328ad3411c Move a bunch of parsing to Dsexp
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-23 11:58:09 +03:00
Jérémie Dimino c87d8e95e5
Do not build and install shared libs when not supported (#1165)
Read `ocamlc -where`/Makefile.config to determine whether this is
supported.

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-08-22 14:48:02 +01:00
Anurag Soni ea0baeb4bc multi line error highlights
Reference: #1131

Signed-off-by: Anurag Soni <anuragsoni.13@gmail.com>
2018-08-21 15:39:26 +02:00
Rudi Grinberg 20f9b2cf0a Add test for (ocamllex (..)) form in jbuild
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-20 20:06:46 +03:00
Rudi Grinberg da3def9dc7 Fix parsing of ocamllex in jbuild files
The long form would be rejected

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-20 20:06:46 +03:00
Rudi Grinberg bb2bf59ff1 Add test case for ocamllex + jbuild bug report
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-20 20:06:46 +03:00
Etienne Millon 6fe9ec68c0 Improve error message for `dune utop`
Closes #1149

Signed-off-by: Etienne Millon <me@emillon.org>
2018-08-20 13:59:24 +02:00
Etienne Millon a611205ff8 Initial implementation of `dune fmt`
This is a first draft with three main limitations:

- it is language agnostic, so it does not know about field names
- it is not able to parse comments
- it does not break long lines

The formatting rules are pretty simple:

- lists composed only of atoms, quoted strings, templates, and
  singletons are displayed on a single line
- other lists are displayed with a line break after each element
- an empty line is inserted between toplevel stanzas

The CLI is pretty light: it can either read a file or standard input,
and fix a file in place. In addition, the command is named
`unstable-fmt` for now, until some guarantees are given.

Closes #940

Signed-off-by: Etienne Millon <me@emillon.org>
2018-08-20 10:21:47 +02:00
Rudi Grinberg f707168d6c Generate sorted .install files
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-15 12:30:58 +03:00
Rudi Grinberg 9abaa040b8 Add tests for installed stubs artifacts
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-15 11:22:41 +03:00
Etienne Millon 0e781e87e1 Fix pluralize function
Signed-off-by: Etienne Millon <me@emillon.org>
2018-08-13 13:15:49 +00:00
Etienne Millon 0603f4fca6 Display actual stanza when package is ambiguous
Previously we displayed `(install ...)` in all cases.

Closes #1123

Signed-off-by: Etienne Millon <me@emillon.org>
2018-08-13 13:15:49 +00:00
Etienne Millon 06bc3b1d0c Highlight error locations
This is a simple implementation of an error printer that highlights the
error location with squiggly lines, for example:

    File "dune", line 1, characters 14-21:
    (copy_files %{read:x}/*)
                  ^^^^^^

The message is not displayed in some cases, like if the file does not
exist, or if the location spans multiple lines.

Signed-off-by: Etienne Millon <me@emillon.org>
2018-08-13 12:51:55 +00:00
Etienne Millon 4f22d32c68 Fix error when copy_files source does not exist
Closes #1099

Signed-off-by: Etienne Millon <me@emillon.org>
2018-08-13 12:29:49 +00:00
Etienne Millon c192aa460d Rename Jbuild module to Dune_file
While it supports both, let's move forward and use the new name.

Signed-off-by: Etienne Millon <me@emillon.org>
2018-08-13 10:53:51 +00:00
Jérémie Dimino da5c1a0c2e
Rename private libraries and add a test to make sure we don't publicize too much (#1111)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-08-09 10:03:06 +01:00
Rudi Grinberg 2899744908
Merge pull request #1114 from diml/envs-and-contexts
Fix a bad interaction between `(env ...)` and `(merlin)` in the workspace file
2018-08-08 23:35:00 +03:00
Jeremie Dimino 8ea075dd6b Disable last added test
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-08-08 17:29:53 +01:00
Jeremie Dimino 6a9c32dcb4 Fix bug exposed by previous commit
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-08-08 15:54:58 +01:00
Jeremie Dimino 3e33d23535 Expose a bug involving environments and build contexts
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-08-08 15:23:00 +01:00
Rudi Grinberg 9a13221263 Clean up the error handling for lib names
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-08 15:07:26 +03:00
Rudi Grinberg d30361a180 Fix overly strict validation of invalid names
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-08 15:07:26 +03:00
Rudi Grinberg ca7696f2c3 Add test case for a library with an invalid name
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-08 15:07:26 +03:00
Rudi Grinberg 5706e4ee56 Make invalid public name warn when (wrapped false)
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-08 15:07:26 +03:00
Rudi Grinberg c08cec1f4b Add test case for name when it doesn't matter
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-08 15:07:26 +03:00
Rudi Grinberg 925bc84427 Fix error message
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-08 15:07:26 +03:00
Rudi Grinberg 31e4f6f18a Fix error messages for invalid lib names
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-08 15:07:26 +03:00
Rudi Grinberg 131310d144 Fix validation of library names
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-08 15:07:26 +03:00
Rudi Grinberg 317388fd95 Refactor code to to have a dedicated type for Library.name
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-08 15:07:26 +03:00
Rudi Grinberg 67c6de4864 Add test for #1102
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-08 15:07:26 +03:00
Rudi Grinberg 63b49f946b Mark more tests as having external deps
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-08 01:30:22 +03:00
Etienne Millon f5c45a72a8 Do not duplicate profile in missing deps message
Closes #1106

Signed-off-by: Etienne Millon <me@emillon.org>
2018-08-07 09:53:34 +00:00
Rudi Grinberg 6dc6ac3668 Fix #1101
Do not attempt to convert string -> path -> string as this loses information

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-07 11:42:25 +03:00
Rudi Grinberg a3c6f417d0 Add test case for 1101
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-07 11:42:25 +03:00
Rudi Grinberg f74a064aed Fix #1103
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-07 00:36:27 +03:00
Rudi Grinberg 99e0686447 Test case for --dev bug
jbuilder doesn't accept --dev like it should

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-07 00:34:35 +03:00
Rudi Grinberg 7c597d80e7
Merge pull request #1096 from rgrinberg/missing-loc
Missing loc
2018-08-06 14:30:15 +03:00
Jeremie Dimino 0e6dda2032 Adapt the design of multi directory libraries
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-08-05 21:58:21 +03:00
Rudi Grinberg 66f2004f8f Add rule locs to failed rules
this will add a location that will point to the rule that failed

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-04 20:03:58 +03:00
Rudi Grinberg b9cbdd236b Add test case for deps field
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-04 19:59:16 +03:00
Rudi Grinberg a064b59692 Track locations when executing programs
Only works for searched programs for now

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-04 13:16:58 +03:00
Rudi Grinberg 4483627348 Add tests for missing locations when running programs
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-04 13:16:00 +03:00
Rudi Grinberg b394896c1f Make opaque information available to compilation context
Subsequently, use it as a flag when calculating rules and includes

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-02 15:26:45 +02:00
Jérémie Dimino b05e28569e
Add support for staged ppx rewriters such as ones using the typer (#1080)
Fix #193

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-08-02 12:11:59 +01:00
Louis Roché a5d0941b14 replace jbuilder with dune
* when printing context
* in meta comments
* error messages

Signed-off-by: Louis Roché <louis@louisroche.net>
2018-08-02 12:41:35 +02:00
Jérémie Dimino 5aa9a07f1a
Fix merlin generation in presence of include_subdirs (#1083)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-08-02 09:27:55 +01:00
Jérémie Dimino 282c0b3c41
Add support for multi directory libraries and executables (#1034)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-08-01 15:23:26 +01:00