Commit Graph

25 Commits

Author SHA1 Message Date
Jérémie Dimino 4d8ca489be
Add support for environment & build profiles (#419) 2018-05-04 16:49:25 +01:00
Rudi Grinberg 98b2ea795c Move String_map to stdune 2018-04-23 12:43:20 +07:00
Jeremie Dimino 22b024a977 More hacks for external-lib-deps
Fix #644
2018-04-09 06:31:52 +08:00
Rudi Grinberg ff05369868 Introduce package name private type 2018-03-03 01:44:03 +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
Jérémie Dimino 4e4f651b37
Don't stop on the first error (#477)
Before, jbuilder used to stop its execution after an error was
encountered. Now it continues until all branches have been explored.

To implement this feature, Future was rewritten as a Fiber module with
a simpler semantic.

This patch contains various other refactorings.
2018-02-06 14:39:03 +00:00
Jérémie Dimino 9dd5ab74e4
[WIP] Load rules lazily (#370)
* Change jbuilder to load rules lazily

Rules are now loaded on a per directory basis as needed. This speed up
the start up time on large workspaces.

Does various refactoring as well.

* Simplify the handling of META files

We no longer generate a META.foo.from-jbuilder file. Nobody is using
this feature and it's making the new code more complicated.
2018-01-19 08:50:06 +00:00
Rudi Grinberg 785beeafac
Add option to force running tests (#320)
Option to force running tests

The mechanism allows for forcing any alias, but only forcing tests is exposed to the user. Aliases are forced by deleting all the alias files that belong to a particular alias. The option for forcing tests is called --force.
2017-11-28 19:03:22 +08:00
Jeremie Dimino 11985e3948 Update the code to talk about scopes 2017-06-05 13:42:13 +01:00
Jeremie Dimino b74544919a jbuild_types.ml --> jbuild.ml 2017-06-02 14:32:05 +01:00
Jeremie Dimino ef6be544a3 Keep the package context after parsing 2017-05-05 11:21:46 +01:00
François Bobot 2bf15067cb Remove comment for 4.02.3 2017-03-27 18:31:26 +01:00
Jeremie Dimino 4fa0844e42 Remove build-package in favor of --only-packages 2017-03-02 18:21:19 +00:00
Jeremie Dimino 97de72c8dd Improve the external-lib-deps command 2017-03-01 19:19:43 +00:00
Jeremie Dimino 4ee2e74131 Make build-package work 2017-03-01 13:25:18 +00:00
Jérémie Dimino 38421d7e41 Replace meta language by ocaml 2017-02-26 19:49:54 +00:00
Jérémie Dimino 4227e756bd Move actual parsing of jbuilds to Gen_rules 2017-02-25 18:21:23 +00:00
Jérémie Dimino 9fe0e9c87d Improve alias management 2017-02-25 01:33:37 +00:00
Jeremie Dimino 593b90723d Implement package version support 2017-02-24 18:21:22 +00:00
Jeremie Dimino ee7ab05d9e Better for user written/generated META files 2017-02-23 17:34:11 +00:00
Jeremie Dimino fe929a07d7 Don't require packages to be defined at the root
To match the manual
2017-02-23 15:59:44 +00:00
Jeremie Dimino 614dbc6f6b Setup copy rules for all source files
This is cleaner and allow dependencies on files that do not
appear in static deps or targets.

With this patch, one can now build all JS packages at once.
2016-12-31 15:12:39 +00:00
Jeremie Dimino e054ce4d71 114.20+69 2016-12-15 13:00:30 +00:00
Jeremie Dimino 2357fa0799 114.20+69 2016-12-15 11:20:46 +00:00
Jeremie Dimino cdcd7e907f 114.20+69 2016-12-02 13:54:32 +00:00