Rudi Grinberg
bafb710a5b
Remove duplication between Atom.is_valid and should_be_atom
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-18 18:31:56 +07:00
Rudi Grinberg
eb148da6ec
Use extension parameter in error message
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-15 12:27:02 +07:00
Jérémie Dimino
3c74bf07e8
Use the same monad to parse all list of S-expressions ( #882 )
...
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-14 08:51: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
6abe76c4e7
Get rid of link_executables in dune files (unused)
...
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-13 11:51:41 +01:00
Jeremie Dimino
e05c81ac56
Get rid of Jbuild.Provides (unused)
...
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-13 11:51:41 +01:00
Jeremie Dimino
86b130560e
Store the project directory in Jbuild.Library.t
...
There is no risk of confusion about the interpretation of the root
field anymore since it has type Path.Local.t.
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-12 12:09:11 +01:00
Jeremie Dimino
f24cf5d110
Make Dune_project.t private
...
To ensure we can't mutate the mutable fields and that the value is
shared, which is important for the profile_file field for instance.
To make sure we don't confuse the root field for a path in the build
directory, change its type to Path.Local.t.
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
8727eb6c3c
Strengthen the lexing of escape sequences ( #872 )
...
Things like \a are no longer allowed. Before they would be interpreted
as a literal \a. This will allow to introduce new escape sequences in
the future if needed.
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-06-11 16:21:31 +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
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
cbc3464a85
Merge branch 'master' into doc-private
2018-06-07 20:09:41 +07:00
Rudi Grinberg
eda3088a49
Move stanzas to toplevel value
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-07 17:59:43 +07: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
c842c76036
Rename typ to source
...
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
794b2c696b
Remove unused html_alias field
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-07 17:59:43 +07:00
Rudi Grinberg
20d9b509a1
Setup html rules for libraries and not just their parent pacakge
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-07 17:59:43 +07:00
Rudi Grinberg
c28bc3d75a
Simplify odoc generation
...
Separate package from html docs
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-07 17:59:43 +07:00
Rudi Grinberg
8740554ebf
Rename to_html to setup_html
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-07 17:59:43 +07:00
Rudi Grinberg
acac3e29b3
Do not silently ignore closure errors
...
cc @diml
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-07 17:59:43 +07:00
Rudi Grinberg
a70ccb6d8b
Move types outside of gen functor
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-07 17:59:43 +07:00
Rudi Grinberg
2c424063ab
Remove polymorphic variant that is of questionable use
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-07 17:59:43 +07:00
Rudi Grinberg
08c46dff28
Merge branch 'master' into no-private-module-name
2018-06-07 17:51:36 +07:00
Rudi Grinberg
bc53047a95
Merge branch 'master' into remove-concat-or-split
2018-06-07 00:13:09 +07:00
Rudi Grinberg
0c048ac0c5
Remove module private type
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-07 00:02:21 +07:00
Rudi Grinberg
eff7a24390
Add an intern option to control ordering
...
There are 2 ways to order interned strings:
* Fast but "random"
* Slow but respects the original order
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:48:11 +07:00
Rudi Grinberg
7d8a7e94aa
Fix incorrect concatenation for multivalues in quoted context
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg
6ebff9d388
Move Value.t list functions to Value.L
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg
c96df4dc15
Inline expand_var
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg
9cc8ff920a
Special case t.items = [Text _] and t.items = []
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg
243f3437f2
implement expand in terms of partial_expand
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg
774306c396
Remove old usage for Var_expansion in ppx driver
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.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
ff173b98d8
Share quote handling in partial and normal expansion
...
The partial expansion had a bug in its condition for a 1 element value list.
This fixes the bug by implementing the condition once and for all.
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg
589943df60
Simplify String_with_vars
...
Make it expand only to Value.t since the string only version wasn't really used.
Variable expansions are now Value.t list. Which also gives the flexibility for a
value to expand to a collection of more than 1 value.
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg
bab65e989d
Allow for proper expansoin of vars in super contexts
...
Multivalues are no longer allowed when unquoted, and paths are no longer
needlessly converted.
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg
588129d582
Move Var_expansion to own module
...
These variables can occur outside actions so such expansions shouldn't live
under Var_expansion.
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg
cadee0e661
Write explicit interface for Expand_to
...
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
9545d9a854
Add length function to exapnsions
...
This is useful for an error message that includes the number of items we've
expanded to.
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:41:57 +07:00
Rudi Grinberg
731b61b0b9
Improve the error message with invalid strings
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:41:57 +07:00
Rudi Grinberg
8351fcb466
Move the multivalue error to a function
...
Since it's used more than once
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:41:57 +07:00
Rudi Grinberg
bb58cf8599
s/false/true/
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:41:57 +07:00
Rudi Grinberg
c1d6faef79
Remove Concat_or_split
...
Thie property will now be determined from the context
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:41:57 +07:00
Rudi Grinberg
b3870f78b1
Merge branch 'master' into path-table
2018-06-06 23:39:36 +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
Rudi Grinberg
2a85cbe074
Merge branch 'master' into path-table
2018-06-06 22:24:18 +07: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
Rudi Grinberg
6ada532b10
type specialize (=)
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 22:15:53 +07:00
Rudi Grinberg
2350bb1161
Use polymorhic equality
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 19:23:13 +07:00
Rudi Grinberg
d4e8e6dbd4
Change all path indexed tables to Path.Table
...
This will allow to experiment with faster hashing for paths
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 13:54:24 +07:00
Rudi Grinberg
3ab6be3cc2
Add a functorized hashtable with all the functions we expect to stdune
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 13:54:11 +07:00
Rudi Grinberg
3ad4c06f4a
Add Path.Table module
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 13:28:14 +07: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
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
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
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
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
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
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
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
2e86529ece
Merge branch 'master' into little-cleanups
2018-06-01 02:37:09 +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
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
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
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
85e4b13780
Change Paths_glob to return a set of paths
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-29 02:24:52 +07:00
Jeremie Dimino
d2b66279f6
Use Sys.{win32,cygwin} rather than Sys.os_type
...
The former functions are optimized away while the latter isn't.
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-05-28 17:02:51 +01:00
Jeremie Dimino
547998d6c6
Fix an issue when a file is part of several packages
...
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-05-28 13:47:55 +01:00
Rudi Grinberg
2b7ee377af
Merge branch 'master' into no-interning
2018-05-28 19:18:21 +07:00
Rudi Grinberg
665c251678
Merge branch 'master' into remove-path-set-conversion
2018-05-28 18:38:04 +07:00
Rudi Grinberg
4a0e5a76af
Remove more Path <-> List conversion in rules_for_files
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-28 18:04:48 +07:00
Rudi Grinberg
836b27ae2b
Remove an extra conversion in rules_for_files
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-28 17:52:05 +07:00
Rudi Grinberg
da8064893c
Add No_interning module for easy experimentation
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-28 14:51:37 +07:00
Rudi Grinberg
2bb9895817
Make explode_path work in 1 pass
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-28 14:38:35 +07:00
Rudi Grinberg
da469e66f0
Fix explode_path to work on absolute paths
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-28 14:36:40 +07:00
Rudi Grinberg
7b824febf3
Merge branch 'master' into suffix-prefix-fast
2018-05-28 14:30:53 +07:00
Rudi Grinberg
fe9e6fb8c9
Make Interned generative again ( #808 )
...
I accidentally removed this in the last PR. I think it should probably be brought back.
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-28 14:18:10 +07:00
Rudi Grinberg
6f3467ad96
Merge branch 'master' into suffix-prefix-fast
2018-05-28 14:16:13 +07:00
Jeremie Dimino
b31d281949
Add Module_compilation.ocamlc_i
...
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-05-28 08:10:12 +01:00
Jeremie Dimino
3bd9addeb2
Use Compilation_context in menhir
...
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-05-28 08:10:12 +01:00