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>
Use the build_dir variable rather than the "_build" string and treat the case
Path.build_dir argument differently. Previously this would error:
Path.insert_after_build_dir_exn Path.build_dir "foo"
Now, it will return _build/foo
- install two identical binaries: jbuilder and dune
- rename the man pages to dune-*
- change the name in man pages
- change the name of libraries
- add support for dune-project files and add a dune-project file
- add support for dune-workspace files
- start updating the manual
- update the tests
* This requires moving Fatal_error and Loc_error to Stdune.Exn as well
* Clflags.workspace_root can no longer be used in Path.to_absolute_filename. We
just take a parameter instead for now.
- 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
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.
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