Commit Graph

1186 Commits

Author SHA1 Message Date
Rudi Grinberg 326e2f5115
Merge pull request #535 from rgrinberg/utop-exe
Refactor utop module to use the new exe module
2018-02-21 18:07:38 +07:00
Rudi Grinberg 7bd693ed3b Remove build-test from jbuilder's opam file
jbiulder isn't allowed to have any test dependencies so this is useless
2018-02-21 16:46:57 +07:00
Rudi Grinberg 80ed205e38 Refactor utop module to use the new exe module 2018-02-21 16:44:31 +07:00
Rudi Grinberg 6bde0c21b3 beta18 changelog 2018-02-21 11:04:46 +07:00
Jeremie Dimino db345be90b Trivial fix 2018-02-20 18:55:52 +00:00
Jérémie Dimino 2a531c5d24
Detect when a module is used by several stanzas (#532)
- print a warning
- don't generate several rules for the .d files
- Added tests for multiple rules for .ml.d
2018-02-20 16:44:25 +00:00
Jérémie Dimino 19f1c6f6b3
Add an Exe module to build and link executables (#533) 2018-02-20 16:38:22 +00:00
Rudi Grinberg d8e4145dba Warn instead of error on harmless fake modules
E.g. (modules (:standard \ does_not_exist)) is harmless
2018-02-20 20:23:28 +07:00
Rudi Grinberg 7977b8371a Test case for excluding missing module
Setting the field modules as follows (modules (:standard \ foo)) where foo
doesn't exist is an error.
2018-02-20 20:21:34 +07:00
Jérémie Dimino 9e4cc84370
Refactor library management (#516)
Lib module
----------

We have a new module Lib that replaces Lib, parts of Lib_db and parts
of Findlib. It is used to manage all libraries (internal and
extrernal). Lib.t represent a completely resolved library, i.e. where
all the dependencies have been resolved. Lib.Compile is used to
provide what is necessary to build the library itself. Lib.Meta
provides what is necessary to generate the META file for the library.

We also have library databases represented as Lib.DB.t. A library
database is simply a mapping from names to Lib.t values and and
created from a resolve function that looks up a name and return a
Lib.Info.t. A Lib.Info.t is the same as a Lib.t except that
dependencies are not resolved.

A library database can have a parent database that is used to lookup
names that are not found in the current database. In practice we have
the following hierarchy:

1. For every scope, we have a library database that holds all the
   libraries of this scope. In this DB, a library can be referred by
   either it's name or public name

2. the parent of each of these databases is a database that holds all
   the public libraries of the workspace. In this DB libraries must be
   referred by their public name

3. the parent of this DB is for installed libraries

(1) databases are accessible via Scope.libs
    (Super_context.find_scope_by_{name,dir} sctx xxx)
(2) is accessible via Super_context.public_libs sctx
(3) is accessible via Super_context.installed_libs sctx

The dependencies of a library are always resolved inside the DB it is
part of. When we compute a transitive closure, we check that we don't
have two libraries from two different DB with the same name. So for
instance linting Base should now supported.

Jbuild.Scope_info
-----------------

Jbuild.Scope was renamed Jbuild.Scope_info

Scope module
------------

This replaces Lib_db. A Scope.t is now just a pair of a
Jbuild.Scope_info.t and a Lib.DB.t. Scope.DB.t is an object used to
lookup scopes by either name or directory.

We no longer have an external scope or special anonymous
scope. Instead one should use Super_context.installed_libs or
Super_context.public_libs depending on the context.
2018-02-20 11:46:10 +00:00
Rudi Grinberg 41693ae6f9
Merge pull request #531 from rgrinberg/ocamldep-multi-stanza
Multi stanza in 1 jbuild build failure
2018-02-20 11:50:40 +07:00
Rudi Grinberg b27486b4bd Multi stanza in 1 jbuild build failure
After the change to run ocamldep per module, defining an executable and a
library this way doesn't work anymore.
2018-02-20 11:07:51 +07:00
Rudi Grinberg eefe4347f1
Merge pull request #529 from ocaml/share-pps-computations
Share more results when preprocessing modules
2018-02-20 01:55:08 +07:00
Jeremie Dimino 26dc6d2b13 Share some computations on pps when preprocessing modules 2018-02-19 16:04:47 +00:00
Rudi Grinberg a6e6136f3a
Merge pull request #521 from rgrinberg/build-only-public-docs
Change @doc to only build public docs
2018-02-19 19:00:27 +07:00
Rudi Grinberg 4666359acf
Merge pull request #523 from rgrinberg/ocamlc-config-module
Move reading/reading ocamlc -config to own module
2018-02-19 19:00:00 +07:00
Rudi Grinberg 55e8dd99e2 Move reading/reading ocamlc -config to own module 2018-02-18 10:14:38 +07:00
Christophe Troestler 75ab3946f6
Distinguish quoted and unquoted variables
Now only quoted strings support concatenation of text and a split-variable.
2018-02-17 23:44:32 +01:00
Rudi Grinberg e6d3e9fca2
Merge pull request #522 from rgrinberg/duplicate-mlds
Test to reproduce bug with duplicate mld's in same package
2018-02-17 23:32:38 +07:00
Rudi Grinberg 2b73678284 Add test for the same mld's in different scopes
This case on the other hand is allowed
2018-02-17 19:12:52 +07:00
Rudi Grinberg c067a638a6 Update CHANGES 2018-02-16 20:48:41 +07:00
Rudi Grinberg 526c1eef39 Test to reproduce bug with duplicate mld's in same package
Odoc doesn't actually allow this so this test will turn into an error later on.
2018-02-16 19:58:11 +07:00
Rudi Grinberg d28c6e4456 Change @doc to only build public docs
Private docs can still be built using the new @doc-private alias
2018-02-16 16:22:28 +07:00
Jérémie Dimino 5669f57907
Fix display when output is not a tty (#518) 2018-02-15 14:04:00 +00:00
Christophe Troestler 67c9363c7d Use more precise combinators "atom" and "quoted_string" 2018-02-15 00:45:06 +01:00
Christophe Troestler 91b38b6376 Update Changelog 2018-02-15 00:43:08 +01:00
Christophe Troestler b48a9fec53 Usexp: Properly quote atoms when pretty printing 2018-02-15 00:43:08 +01:00
Christophe Troestler 8e9ec4a52a Do not accept the quoted form "->" in place of -> 2018-02-15 00:43:08 +01:00
Christophe Troestler 0cbd1c7450 Usexp: factorize pp of atoms & fix serialization 2018-02-15 00:43:08 +01:00
Christophe Troestler 453ce1eb56 String_with_vars: Use a functor to create generic expansion fun
This required to remove the labeled ~dir arguments in Action because
one would have had to use the same label for the expansion context in
String_with_vars, which would have been odd for generic expansion
functions.
2018-02-15 00:43:08 +01:00
Christophe Troestler a91cf637ae Trigger an error for unquoted concatenations with list variables
Thus x${v} where v is a variable that returns several values must
necessarily be quoted: "x${v}".
2018-02-15 00:43:08 +01:00
Christophe Troestler 754aa59cc3 String_with_vars: Distinguish quoted and unquoted strings
This implies that an atom can only contain a single variable, such as
${@}, and not something like xxx${@}xxx.  The internal representation
was changed not to be able to represent the latter.
2018-02-15 00:43:08 +01:00
Christophe Troestler cc9c71661e Fix Jérémie Dimino remarks 2018-02-15 00:43:08 +01:00
Christophe Troestler f9e17f76e0 Requires that atoms are unquoted is some contexts 2018-02-15 00:43:08 +01:00
Christophe Troestler 73f529ae82 Rename String to Quoted_string 2018-02-15 00:43:08 +01:00
Christophe Troestler 75ad9736f8 Move usexp in src/ as it diverged from parsexp 2018-02-15 00:43:08 +01:00
Christophe Troestler 4ddb268b39 Update the documentation for quoted strings 2018-02-15 00:43:08 +01:00
Christophe Troestler 8b50352db7 Properly convert quoted atoms to strings 2018-02-15 00:43:08 +01:00
Christophe Troestler c27cb3541e Let the parser distinguish quoted strings
Fixes https://github.com/ocaml/dune/issues/408
2018-02-15 00:43:08 +01:00
Christophe Troestler e8e3698e15 String_with_vars: represent quoted vars differently from unquoted ones
Define the representation for quoted variables, adapt the test of
strings made of a single variable, and add a constructor.
[String_with_vars.t] is not yet able to use that representation
because the necessary information is not available from the parser.
2018-02-15 00:43:08 +01:00
Christophe Troestler 3e2dc2517d Document the interface of String_with_vars 2018-02-15 00:43:08 +01:00
Rudi Grinberg 02abc3ca6e Update CHANGELOG for beta 18 2018-02-14 22:13:43 +07:00
Rudi Grinberg ee48e865dd
Merge pull request #514 from ocaml/small-findlib-improvements
Rewrite the findlib predicate stuff
2018-02-14 15:21:48 +08:00
Jeremie Dimino c569984af1 Rewrite the findlib predicate stuff
- intern predicate names
- add a Variant module
2018-02-13 19:04:30 +00:00
Jeremie Dimino 77ef63773f 4.02 compat 2018-02-13 19:04:21 +00:00
Jeremie Dimino a1f70209bf Fix previous commit 2018-02-13 18:52:58 +00:00
Jérémie Dimino bd0593c11a
Fix printing of errors (#513)
The status line wasn't properly cleared
2018-02-13 18:31:21 +00:00
Rudi Grinberg 7e1300ab95
Add .merlin tests (#508)
These require post-processing all the absolute paths out of the .merlin
2018-02-14 02:13:57 +08:00
Jeremie Dimino 807251c931 Added missing file 2018-02-13 18:01:44 +00:00
Jérémie Dimino dfb8afb46e
Compute the transitive closure of findlib packages lazily (#507)
We are now computing the transitive closure of findlib packages
lazily. This simplify the code and prepare for subsequent changes to
library management.

Fix #484 at the same time
2018-02-13 17:49:07 +00:00