Commit Graph

1112 Commits

Author SHA1 Message Date
Rudi Grinberg 95c254a6a0 Revert "Add support for upcoming ppx_base. (#541)"
This reverts commit 032cb62af6.
2018-02-26 21:07:02 +07:00
Rudi Grinberg 31ea39949b Make prefix_rules accessible through Super_context 2018-02-26 15:54:15 +07:00
Jérémie Dimino 0c30689404 Make Ocamldep.rules already_used arg optional
String_set.empty is a good default value
2018-02-26 15:53:19 +07:00
Jérémie Dimino 6e7d297ea3 Introduce short syntax for sexps 2018-02-26 15:53:19 +07:00
Jérémie Dimino 5a73753095 Extend interned module with a Table type 2018-02-26 15:53:19 +07:00
Jérémie Dimino 9943acb4dc Add utility functions to result
all and concat_map
2018-02-26 15:53:19 +07:00
Jérémie Dimino e77bd30681 prefix_rules should append rather than overwrite the prefix 2018-02-26 15:53:19 +07:00
Rudi Grinberg 3fd3d5b44c Don't pass lib_name if lib is already passed
We can easily get the library name
2018-02-26 14:55:40 +07:00
Rudi Grinberg 290bcceb17 s/capitalize_ascii/capitalize/ 2018-02-26 01:39:16 +07:00
Rudi Grinberg 5017ac2a2a
Merge pull request #551 from rgrinberg/revert-utop-gen
Revert "Use _utop.ml to avoid creating a separate dir for utop rules"
2018-02-26 01:32:34 +07:00
Rudi Grinberg 1cb005bb50 Add a way to customize obj dir for executables
Use this function to simplify the obj dir for the utop runner
2018-02-26 01:30:02 +07:00
Rudi Grinberg b4e0c04368 Revert "Use _utop.ml to avoid creating a separate dir for utop rules"
This reverts commit 9ec894eda0.
2018-02-26 01:30:02 +07:00
Jérémie Dimino 3fd3eb8a12
Split src/import.ml into a new library src/stdune (#548)
- make sure type t always come first
- Map.map, Map.fold, ... never pass the key to the callback while Map.mapi, Map.foldi, ... do
- removed the ~key and ~data labels, I find them useless and annoying
- Set.elements --> Set.to_list
- Map.bindings --> Map.to_list
- Map.of_alist --> Map.of_list
- added Ordering.t for comparison functions
- renamed Inl/Inr to Left/Right. The latter seems clearer
- moved List.longest to String.longest
- added a Pp module with a nicer API than Format
2018-02-25 16:35:25 +00:00
Jérémie Dimino 4cf7dc558b
Fix generation of the alias module with 4.02 (#549) 2018-02-25 12:58:40 +00:00
Christophe Troestler fbafb3d47a Make Atom.t private and consequences (#524) 2018-02-24 23:33:26 +00:00
Rudi Grinberg 8a81c79531 Update CHANGELOG for beta 18 2018-02-25 02:56:56 +07:00
Jérémie Dimino 361773fdb6 Remove gen_dot_merlin flag
It's no longer necessary after switching to the new Exe api. The new API will
not generate a .merlin file for utop.
2018-02-24 18:25:14 +07:00
Rudi Grinberg df5009510a
Merge pull request #545 from rgrinberg/jsoo-compiler
Explicitly depend on the jsoo compiler for tests
2018-02-23 15:32:37 +07:00
Rudi Grinberg c275e360c3 Explicitly depend on the jsoo compiler for tests
We also use the ppx but we should list these dependencies explicitly
2018-02-23 15:04:50 +07:00
Rudi Grinberg 4c9da64290
Merge pull request #537 from rgrinberg/use-fake-module-name
Use .utop.ml to avoid creating a separate dir for utop rules
2018-02-23 12:10:28 +07:00
Xavier Clerc 032cb62af6 Add support for upcoming ppx_base. (#541) 2018-02-22 20:38:27 +00:00
Rudi Grinberg 9ec894eda0 Use _utop.ml to avoid creating a separate dir for utop rules 2018-02-22 17:34:39 +07:00
Rudi Grinberg 6235cb6b99
Merge pull request #539 from SaswatPadhi/patch-1
Fixed a small typo in the Quickstart Guide
2018-02-22 13:04:53 +07:00
Saswat Padhi af76ecb6a0
Fixed a small typo 2018-02-21 20:29:48 -08:00
Jeremie Dimino 41b5017eb2 Fix #534 2018-02-21 13:35:47 +00:00
Jeremie Dimino 4993c6b89a Added a test for #534 2018-02-21 13:35:47 +00:00
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