Commit Graph

2408 Commits

Author SHA1 Message Date
Rudi Grinberg 385a3ebd54
Merge pull request #1081 from rgrinberg/remove-string-map
Remove String_map module
2018-08-01 12:35:37 +02:00
Rudi Grinberg 6e29bd10ef Remove String_map module
We can just use String.Map

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-01 11:59:33 +02:00
Rudi Grinberg d6c2a434db
Merge pull request #1078 from rgrinberg/update-changes
Update CHANGELOG with optional names entry
2018-08-01 10:19:02 +02:00
Rudi Grinberg 919c0bc403 Don't use rst syntax in markdown file
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-01 10:07:29 +02:00
Rudi Grinberg 7d0a9c5cff Update CHANGELOG with optional names entry
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-01 10:07:24 +02:00
Jérémie Dimino 3c5fddf5fe
Add module Lib_deps_info (#1077)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-08-01 09:01:43 +01:00
Frédéric Bour b4d8d4b355 modules_without_implementation suggestion uses old (pre-dune) syntax
Signed-off-by: Frédéric Bour <def@fb.com>
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-08-01 09:58:32 +02:00
Rudi Grinberg 58bfe376e1
Merge pull request #1074 from rgrinberg/clarify-opam
Fix opam build instructions in usage.rst
2018-08-01 09:52:51 +02:00
Rudi Grinberg 500dd1182c
Merge pull request #1075 from rgrinberg/fix-manual
Little manual fixes
2018-08-01 09:52:35 +02:00
Rudi Grinberg 1b553d56c6 Fix osl link jsoo page
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-31 21:33:07 +02:00
Rudi Grinberg e3a7e68c37 Fix duplicate label in manual
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-31 21:30:15 +02:00
Rudi Grinberg 5094d58774 Fix opam build instructions in usage.rst
They should include dune subst when pinning as well

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-31 21:00:08 +02:00
Jérémie Dimino 4e15fa1522
Fix #1070 (#1072)
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-31 18:06:17 +01:00
Rudi Grinberg 9ea98b1846
Merge pull request #1069 from rgrinberg/port-enabled-if-tests
Port enabled if tests
2018-07-31 17:35:35 +02:00
Rudi Grinberg bd1c57c03a Remvoe -skip-platforms from cram.mll
It can be supported via enabled-if now

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-31 13:47:46 +02:00
Rudi Grinberg 3f2d260be7 Add Ordering.to_string
it was useful for debugging

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-31 13:45:25 +02:00
Rudi Grinberg a425e0ad94 Define alias as empty if it's disabled
this is so that others can still depend on it

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-31 13:44:59 +02:00
Rudi Grinberg 4f0d056b8b Fix Op.eval in blang
Neq is compatible with Lt/Gt

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-31 13:44:39 +02:00
Rudi Grinberg de0ccfaec4
enabled_if (#819)
# Problem

The problem this PR is trying to solve is a bit specific to dune, but it's likely that it will be encountered by other projects as well. Currently, dune has a complicated script for generating test definitions that make sure tests run only in environments which support them. For example, some tests may not run on win32. A mechanism to enable tests conditionally would fix these problems.

# Proposal

Add an `enabled_if` field to aliases to toggle the execution of the alias. This field will be valued by a little EDSL for expressing boolean expressions. Here's an example of the kind of conditions we'd express with it:

```
(alias
 ((name runtest)
  (deps (foo.exe))
  (action (run ${<}))
  (enabled_if (and (<> ${os} win32) (>= ${ocaml_version} 4.0.5)))))
```

# Progress

This stalled a bit since I'm not sure how to do handle type safety here. Ideally, we only allow numbers and versions to be compared with `>=`, `<`, etc. I guess we really need to annotate which variables are comparable and making sure that we don't compare numbers to strings or versions.
2018-07-31 13:07:57 +02:00
Rudi Grinberg 3e4720e479 CHANGES entry
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-31 11:01:08 +02:00
Rudi Grinberg 3d9612f95c Add enabled_if to aliases/tests
This field controls whether the alias/test will be run or not. Boolean
expressions are defined using the Blang.t type. This type represents simple
boolean expressions that become useful when we allow to interpolate variables
into them.

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-31 10:59:35 +02:00
Etienne Millon e59feacb6d
Merge pull request #1067 from ocaml/applicative-map-syntax
Use let%map for applicative code
2018-07-31 10:33:19 +02:00
Etienne Millon 4823795fd1 Use let%map for applicative code
This converts easy instances of applicative code. The rewrite rule is
generally speaking:

```ocaml
e1 >>= pat1 ->
e2 >>= pat2 ->
e3 >>| pat3 ->
r
```

to:

```ocaml
let%map pat1 = e1
and pat2 = e2
and pat3 = e3
in
r
```

Signed-off-by: Etienne Millon <me@emillon.org>
2018-07-31 10:25:58 +02:00
Rudi Grinberg 835a44ff1e
Make name and names fields optional when public_name or public_names are present (#1041)
Make name field optional when public_name is specified

When name is omitted, it will be defaulted to public_name

This feature is 1.1 only.
2018-07-31 10:15:31 +02:00
Rudi Grinberg a13325e389
Merge pull request #1048 from rgrinberg/jsoo-cctx
Refactor jsoo rules to use Compilation_context.t
2018-07-31 09:36:01 +02:00
Rudi Grinberg 5c93619b47
Merge branch 'master' into jsoo-cctx 2018-07-31 08:56:35 +02:00
Rudi Grinberg ad0b376aeb
Merge pull request #1064 from rgrinberg/jsoo-manual
Move Jsoo content to its own page
2018-07-30 19:03:07 +02:00
Etienne Millon fc5e3e7b59
Merge pull request #1065 from ocaml/test-cat-output
Do not rely on cat output in tests
2018-07-30 17:45:27 +02:00
Etienne Millon 772c1c05ac Do not rely on cat output in tests
The error messages of `cat` can change a bit, for example if a different
locale is set. This uses a shell test instead.

Signed-off-by: Etienne Millon <me@emillon.org>
2018-07-30 17:40:48 +02:00
Rudi Grinberg baa5b773b5
Merge pull request #1038 from rgrinberg/workspace-env-2
Env stanza in workspace files part #2
2018-07-30 17:07:54 +02:00
Rudi Grinberg 89a381530d
Merge branch 'master' into workspace-env-2 2018-07-30 17:07:41 +02:00
cedlemo 7af0af94ed doc: remove %{first-dep} in quick-start.rst
Signed-off-by: Cédric Le Moigne <cedlemo@gmx.com>
2018-07-30 15:30:55 +01:00
Marek Kubica ed5f2c5b40 ocamlyacc does not require parens either
Signed-off-by: Marek Kubica <marek@xivilization.net>
2018-07-30 15:01:43 +01:00
Marek Kubica 371c863a32 Parens not required
Closes #1054
Closes #1056

Signed-off-by: Marek Kubica <marek@xivilization.net>
2018-07-30 15:01:43 +01:00
Marek Kubica f58bca1d06 ocamllex does not need the list of modules to be in a list
Noticed this issue while finding another issue in #1056.

Signed-off-by: Marek Kubica <marek@xivilization.net>
2018-07-30 15:01:43 +01:00
Rudi Grinberg 024438e3cc Represent env_nodes using a record rather than a list
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-30 15:12:17 +02:00
Rudi Grinberg 2836a3c6b0 Document the workspace level env stanza
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-30 15:12:17 +02:00
Rudi Grinberg bd860d29e7 Pass the workspace env to context creation
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-30 15:12:17 +02:00
Rudi Grinberg 61d33114ee Bump latest version to 1.1
And make this version a pre-req for the env field in workspaces

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-30 15:12:17 +02:00
Rudi Grinberg 8cda4349fa Use toplevel env stanza from workspace file
This should be the top most env stanza when it's available

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-30 15:12:17 +02:00
Rudi Grinberg c112516a67 Add test setting env for workspace
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-30 15:12:17 +02:00
Rudi Grinberg 200f9d0a52 Add toplevel env stanza to workspace files
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-30 15:12:17 +02:00
Rudi Grinberg 4697a7f9f4 Refactor jsoo rules to use Compilation_context
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-30 15:12:08 +02:00
Rudi Grinberg a898448510 Fix typo in comment
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-30 15:12:08 +02:00
Rudi Grinberg 5e7841abf2
Merge pull request #1043 from rgrinberg/module-evaluator
Simplify module evaluator logic
2018-07-30 15:07:48 +02:00
Rudi Grinberg 7eb7c6e21a Simplify module OSL evaluation
Use Ordered_set_lang.Make_loc to automatically book keep the location for us.
Also cut down on some module name to string conversions that was just making the
code noisy. The fake_modules detection has been changed to hide the mutabiility
from the main algorithm

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-30 14:33:24 +02:00
Rudi Grinberg 4970448edf Add Module.uncapitalize
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-30 14:33:24 +02:00
Rudi Grinberg 093cefc58b Add Loc preserving version of Ordered_set_lang.Make
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-30 14:33:24 +02:00
Rudi Grinberg 50eacb0690 Add signature to Modules_field_evaluator
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-07-30 14:33:24 +02:00
Jeremie Dimino 5f7d1b0285 Fix #1040
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-07-30 12:52:07 +01:00