Commit Graph

1443 Commits

Author SHA1 Message Date
Rudi Grinberg 0c048ac0c5 Remove module private type
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-07 00:02:21 +07:00
Rudi Grinberg eff7a24390 Add an intern option to control ordering
There are 2 ways to order interned strings:

* Fast but "random"
* Slow but respects the original order

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:48:11 +07:00
Rudi Grinberg 7d8a7e94aa Fix incorrect concatenation for multivalues in quoted context
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg 6ebff9d388 Move Value.t list functions to Value.L
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg c96df4dc15 Inline expand_var
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg 9cc8ff920a Special case t.items = [Text _] and t.items = []
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg 243f3437f2 implement expand in terms of partial_expand
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg 774306c396 Remove old usage for Var_expansion in ppx driver
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg 9221b1ed6c Change echo to be variadic
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg ff173b98d8 Share quote handling in partial and normal expansion
The partial expansion had a bug in its condition for a 1 element value list.
This fixes the bug by implementing the condition once and for all.

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg 589943df60 Simplify String_with_vars
Make it expand only to Value.t since the string only version wasn't really used.
Variable expansions are now Value.t list. Which also gives the flexibility for a
value to expand to a collection of more than 1 value.

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg bab65e989d Allow for proper expansoin of vars in super contexts
Multivalues are no longer allowed when unquoted, and paths are no longer
needlessly converted.

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg 588129d582 Move Var_expansion to own module
These variables can occur outside actions so such expansions shouldn't live
under Var_expansion.

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg cadee0e661 Write explicit interface for Expand_to
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg eab7c46bdb Add flag to allow/disallow multivalue expansions
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:42:33 +07:00
Rudi Grinberg 9545d9a854 Add length function to exapnsions
This is useful for an error message that includes the number of items we've
expanded to.

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:41:57 +07:00
Rudi Grinberg 731b61b0b9 Improve the error message with invalid strings
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:41:57 +07:00
Rudi Grinberg 8351fcb466 Move the multivalue error to a function
Since it's used more than once

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:41:57 +07:00
Rudi Grinberg bb58cf8599 s/false/true/
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:41:57 +07:00
Rudi Grinberg c1d6faef79 Remove Concat_or_split
Thie property will now be determined from the context

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 23:41:57 +07:00
Rudi Grinberg b3870f78b1
Merge branch 'master' into path-table 2018-06-06 23:39:36 +07:00
Jérémie Dimino bb7827a7b2
Make the output of Dune deterministic in tests (#855)
When the root is not the cwd, print a relative path for the "Entering
..." line rather than an absolute one.

Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-06 16:25:04 +01:00
Rudi Grinberg 2a85cbe074
Merge branch 'master' into path-table 2018-06-06 22:24:18 +07:00
Jérémie Dimino 0fafebe9be
Fix generation of the ppx key for jbuild directories (#860)
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-06 16:17:40 +01:00
Rudi Grinberg 6ada532b10 type specialize (=)
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 22:15:53 +07:00
Rudi Grinberg 2350bb1161 Use polymorhic equality
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 19:23:13 +07:00
Rudi Grinberg d4e8e6dbd4 Change all path indexed tables to Path.Table
This will allow to experiment with faster hashing for paths

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 13:54:24 +07:00
Rudi Grinberg 3ab6be3cc2 Add a functorized hashtable with all the functions we expect to stdune
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 13:54:11 +07:00
Rudi Grinberg 3ad4c06f4a Add Path.Table module
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-06 13:28:14 +07:00
Jeremie Dimino ec6ca4be67 Refactor handling of backend selection errors + add tests
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-05 19:19:10 +01:00
Jeremie Dimino 84f1f9b82b Add a hint for ppx rewriters that are not compatible
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-05 19:19:10 +01:00
Jeremie Dimino cc5e8443c4 Improve the code for building and installing the compat ppx.exe program
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-05 19:19:10 +01:00
Jeremie Dimino adcf44942f Add a warning for with_lib_deps
I just spent an hour debugging a stupid bug caused by this...

Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-05 19:19:10 +01:00
Jeremie Dimino b5dfb826ef Restore old ppx behavior for directories with jbuild files
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-05 19:19:10 +01:00
Jeremie Dimino ed583b7651 Add List.assoc
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-05 19:19:10 +01:00
Jeremie Dimino b35fbbd7b2 Abstract the ppx driver system
- remove hard-coded knowledge of ocaml-migrate-parsetree and ppx_driver
- get the exact driver parameters directly from the driver itself

Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-05 19:19:10 +01:00
Jérémie Dimino 9358bd5d64
Make Module.t private and add Module.make (#853)
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-05 18:38:27 +01:00
Jeremie Dimino 5b01ed8246 Add support for block strings
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-04 13:57:27 +01:00
Jeremie Dimino b7afc006ee Drop support block and sexp comments in Dune files
They are almost never used and they complicate the language. The
parsing of jbuild files in unchanged.

Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-04 13:57:27 +01:00
Rudi Grinberg be7e3d6dfc Implement --build-dir and change Path.t to use symbolic paths
The motivation for this change is implement the --build-dir feature. This
feature lets us control the build directory which previously always defaulted to
_build. To accomplish this, Path.t had to be modified to be:

External of External.t | In_source_tree of Local.t | In_build_dir of Local.t

To represent the 3 kinds of paths dune is dealing with. The In_build_dir
constructor in particular, is relative to Path.root or some external path.

A few other refactorings had to be done to support this transition:

* The workspace is now "settable". This means that we no longer have to pass it
  explicitly when converting local to absolute paths.

* Path.is_local no longer makes sense and is renamed to Path.is_managed.
  Roughly, is_managed identifies paths in the build and source directories.

* Path.absoulte has been renamed of_filename_relative_to_initial_cwd

* Path.Local.root is now "." (as opposed to "")

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-02 18:14:44 +07:00
Rudi Grinberg 93070c9a4d
Merge pull request #833 from rgrinberg/return-expand
Change return type of string expansions
2018-06-02 12:22:31 +07:00
Rudi Grinberg 52d0f3f552 Change return values of SW expansions
The nested either types obscure the meaning of the return values

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-02 12:11:08 +07:00
Etienne Millon e45e431588 Fix error message when no package is defined (#836)
Closes #830

Signed-off-by: Etienne Millon <etienne@cryptosense.com>
2018-06-01 14:25:35 +01:00
Rudi Grinberg 576ff5293e Re-indent string_with_vars with ocp-indent
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-01 19:48:19 +07:00
Jeremie Dimino f0e448dc36 Strengthen the parsing of the (lang ...) line
It now has to be the first line of the dune-project file and the
lexical conventions are stricter than the rest of the syntax.

This will allow making changes to the lexical conventions of the
language in the future.

Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-06-01 08:42:45 +01:00
Jeremie Dimino 39e74826f4 Simplify the parser
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>
2018-06-01 08:42:45 +01:00
Rudi Grinberg 2e86529ece
Merge branch 'master' into little-cleanups 2018-06-01 02:37:09 +07:00
Rudi Grinberg f07dff5696
Merge branch 'master' into sexpable 2018-06-01 02:33:54 +07:00
Rudi Grinberg f9a215921b Wait for deps and sdeps at once
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-06-01 01:28:14 +07:00
Etienne Millon e97d0c5ad6 Rename Path.readdir to Path.readdir_unsorted (#828)
As `Sys.readdir`, it returns entries in an nondeterministic order.
This can cause problems if caller relies on the list being sorted.

See #820.

Signed-off-by: Etienne Millon <etienne@cryptosense.com>
2018-05-31 14:52:10 +01:00
Rudi Grinberg 5bfacf766a Move sexpable signature to Stdune.Sexp
Also tweak Syntax.Version to match this signature

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-31 13:17:52 +07:00
Rudi Grinberg 03c5ffb805
Merge branch 'master' into merlin-fix 2018-05-30 21:51:58 +07:00
Etienne Millon 29f711985d Make "path already scanned" message deterministic (#820)
When a symlink loop is detected, the following message is printed:

> Path X has already been scanned. Cannot scan it again through symlink Y

However, the actual symlink that is displayed depends on the order in
with `readdir` outputs the contents (which depends on FS internals).

This sorts the directory list so that the message is deterministic.

It can be tested by adding for example a `List.rev` call after
`Path.readdir`: the affected version will return a different version in
the `github764` test.

Signed-off-by: Etienne Millon <etienne@cryptosense.com>
2018-05-30 12:57:23 +01:00
Jérémie Dimino 171c22614d
Use Marshal for the incremental and digest databases (#817)
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-05-30 11:54:04 +01:00
Rudi Grinberg 0d3bdf34fc Small cleanup of merlin generation
Use the the known src/obj dirs as the initial value for accumulation

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-30 14:41:56 +07:00
Rudi Grinberg 8f16afe293 Fix merlin generation
The optional build contexts were being dropped from the obj dirs instead of the
source dirs.

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-30 14:39:47 +07:00
Rudi Grinberg 85e4b13780 Change Paths_glob to return a set of paths
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-29 02:24:52 +07:00
Jeremie Dimino d2b66279f6 Use Sys.{win32,cygwin} rather than Sys.os_type
The former functions are optimized away while the latter isn't.

Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-05-28 17:02:51 +01:00
Jeremie Dimino 547998d6c6 Fix an issue when a file is part of several packages
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-05-28 13:47:55 +01:00
Rudi Grinberg 2b7ee377af
Merge branch 'master' into no-interning 2018-05-28 19:18:21 +07:00
Rudi Grinberg 665c251678
Merge branch 'master' into remove-path-set-conversion 2018-05-28 18:38:04 +07:00
Rudi Grinberg 4a0e5a76af Remove more Path <-> List conversion in rules_for_files
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-28 18:04:48 +07:00
Rudi Grinberg 836b27ae2b Remove an extra conversion in rules_for_files
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-28 17:52:05 +07:00
Rudi Grinberg da8064893c Add No_interning module for easy experimentation
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-28 14:51:37 +07:00
Rudi Grinberg 2bb9895817 Make explode_path work in 1 pass
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-28 14:38:35 +07:00
Rudi Grinberg da469e66f0 Fix explode_path to work on absolute paths
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-28 14:36:40 +07:00
Rudi Grinberg 7b824febf3
Merge branch 'master' into suffix-prefix-fast 2018-05-28 14:30:53 +07:00
Rudi Grinberg fe9e6fb8c9
Make Interned generative again (#808)
I accidentally removed this in the last PR. I think it should probably be brought back.

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-28 14:18:10 +07:00
Rudi Grinberg 6f3467ad96
Merge branch 'master' into suffix-prefix-fast 2018-05-28 14:16:13 +07:00
Jeremie Dimino b31d281949 Add Module_compilation.ocamlc_i
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-05-28 08:10:12 +01:00
Jeremie Dimino 3bd9addeb2 Use Compilation_context in menhir
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-05-28 08:10:12 +01:00
Jeremie Dimino c9ead23c7d Add Compilation_context
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-05-28 08:10:12 +01:00
Jeremie Dimino 69af40dced Compute includes outside of build_modules
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-05-28 08:10:12 +01:00
Jeremie Dimino 634cd25b1b Allow to compute the deps of an auxiliary module
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-05-28 08:10:12 +01:00
Jeremie Dimino cc7bd5ebb1 Allow modules to be only preprocessed and not linted
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-05-28 08:10:12 +01:00
Jeremie Dimino ac1c407cab Split Preproressing.pp_and... in two functions
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2018-05-28 08:10:12 +01:00
Jeremie Dimino 5c4027aff8 Re-work the code to handle (include ...)
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-05-28 07:59:05 +01:00
Jeremie Dimino d211272d24 Ignore jbuild_version stanzas
These are no longer necessary as they are super-seeded by (lang
...) stanzas in dune-project files

Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-05-28 07:59:05 +01:00
Jeremie Dimino cb6baa6c96 Make Stanza.t an open type
Signed-off-by: Jeremie Dimino <jdimino@janestreet.com>
2018-05-28 07:59:05 +01:00
Rudi Grinberg 89b0e397f7 Check suffix and prefix without allocation
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-27 01:23:55 +07:00
Rudi Grinberg e5f873da15 Make Interned generative again
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-26 17:14:00 +07:00
Rudi Grinberg 88e71c3432
Speed up merlin generation (#805)
Improve merlin generation by minimizing intermediate strings and reusing a buffer.
2018-05-26 11:04:21 +07:00
Rudi Grinberg 15ce5211b8
Merge branch 'master' into remove-extra-conversion 2018-05-25 19:17:38 +07:00
Rudi Grinberg f0e0bf5156 Remove extra set to list conversion
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-25 12:06:22 +07:00
Jérémie Dimino 459d17fc13
Merge branch 'master' into odoc-master-titles 2018-05-24 17:37:28 +01:00
Rudi Grinberg d3edc454ac Add initial size to interned
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-24 20:51:12 +07:00
Rudi Grinberg cbf2727209 Add a resizing policy for Interned
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-24 20:22:13 +07:00
Rudi Grinberg 1aa6209584 Move interned to stdune
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-24 18:23:02 +07:00
Rudi Grinberg 274bb70994 Move fmt to stdune
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-24 18:22:55 +07:00
Rudi Grinberg 6b130e809c Move int sets and maps to stdune
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-24 18:22:36 +07:00
Rudi Grinberg f838c89d74 Remove aliases of Path.{Set,Map}
They save very little in terms of typing but grepping harder than it should be

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-24 17:34:32 +07:00
Rudi Grinberg 8e8cda01b2 Replace dyn_paths with dyn_path_set
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-24 14:56:39 +07:00
Rudi Grinberg d600db2158 Change Build_job to be set
The elements are unique and the order isn't well defined anyway

Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-24 10:44:47 +07:00
Jeremie Dimino 48cd886bfc Simplify the API for inlined records in constructors 2018-05-23 14:24:41 +01:00
Jeremie Dimino b48b1a168b Simplify the API for capturing the location of constructors 2018-05-23 14:24:41 +01:00
Jeremie Dimino d22eebf5a1 Simplify the API for parsing remaining arguments of constructors 2018-05-23 14:24:41 +01:00
Anil Madhavapeddy b2dd904847 odoc: make indexes work with the development version of odoc
We now generate library titles at level 2 instead of level 1,
and remove trailing fullstop after the `modules` entry.

The development branch of odoc has a more precise parser that
enforces that there is only a single title level field in the
generated odoc.

Closes #791

Signed-off-by: Anil Madhavapeddy <anil@recoil.org>
2018-05-23 10:59:19 +01:00
Rudi Grinberg dc254638e3
Merge pull request #780 from ocaml/dup-fields
Allow to define that can appear multiple times
2018-05-21 00:13:58 +07:00
Rudi Grinberg 3548e2f6d4
Merge pull request #777 from rgrinberg/spec-reach-for-running
Add tests for reach_for_running
2018-05-20 23:57:40 +07:00
Rudi Grinberg fc7d2fef21 Use reach_for_running consistently
Also change the default from to Path.root
2018-05-20 20:48:32 +07:00
Rudi Grinberg a6f2b5be9b Fix exception to be friendly when loc is available
When the loc is available, the error is likely because of an ill-defined user
rule. We should simply reflect the location back to the user.
2018-05-20 13:22:59 +07:00
Rudi Grinberg 9a62e70471 Fix command line printing for errors 2018-05-19 18:11:31 +07:00
Jeremie Dimino cae4948b72 Allow fields that can appear multiple times 2018-05-19 10:14:50 +01:00
Rudi Grinberg 8e72a3a951 Use Path.root as the default 2018-05-17 22:58:21 +07:00
Jeremie Dimino 9d3117d63e Fix bug exposed by previous commit 2018-05-17 15:48:19 +01:00
Rudi Grinberg 8cea102d3c Fix type of Path.reach_for_running
It should return a string rather than a path. Also, make Process.run use it
rather than relying on the caller to do it.
2018-05-17 20:23:48 +07:00
Jérémie Dimino ac8bffc1f3
Get rid of Jbuild.Scope_info and use Dune_project instead (#776) 2018-05-16 16:21:08 +01:00
Rudi Grinberg da827f7946
Merge pull request #769 from rgrinberg/fix-764
Detect circular sym links
2018-05-16 21:58:22 +07:00
Jeremie Dimino 2192a549f4 Use dev/inode to detect loops 2018-05-16 14:23:01 +01:00
Jérémie Dimino 95d9cf0415
Refactor Jbuild.Scope_info.Name and Dune_project.name (#775) 2018-05-15 14:07:02 +01:00
Rudi Grinberg ac078fcdbb add cycle and max depth to symlink following 2018-05-15 19:29:20 +07:00
Rudi Grinberg 540a22315b Refactor symlink following
Correctly resolve relative symlinks and add better error handling. Also move the
logic to the path module.
2018-05-15 17:33:51 +07:00
Rudi Grinberg 7580b8e16f Detect circular sym links
Fix #764
2018-05-15 17:33:27 +07:00
Jérémie Dimino 60c7f6fde4
Collect projects in the file tree directly (#774) 2018-05-15 09:46:07 +01:00
François Pottier d444aeefea Cleanup of [src/menhir.ml]. (#770)
This is purely for the sake of readability;
there should be no change in functionality.
Code is now shared between the case where [--base]
is used and the case where it isn't.
2018-05-14 13:07:48 +01:00
Jeremie Dimino 76ab05d620 Use Utils.executable_object_directory instead of inlining it in gen_rules.ml 2018-05-14 13:06:32 +01:00
Jérémie Dimino bc19e14b35
Add ignored_subdirs stanza (#767) 2018-05-12 15:38:22 +02:00
Rudi Grinberg 3a8e4cf54d Fix off by 1 in Path.is_descendant 2018-05-11 10:30:21 +07:00
Rudi Grinberg a57013c3f3 Add check for relative path in Local.relative
this is to prevent an infinite loop in explode_path
2018-05-11 09:37:39 +07:00
Jeremie Dimino bffd5407ce Fix #734 2018-05-10 11:31:39 +01:00
Jeremie Dimino ef7a5519aa Fix #761 2018-05-10 11:27:56 +01:00
Jeremie Dimino 7c1e1923a0 Fix #759 2018-05-09 16:32:35 +01:00
Rudi Grinberg f7f22cbf52 Make Path.parent return option
Use _exn whenever we know the parent exists
2018-05-09 17:56:50 +07:00
Rudi Grinberg 7e9be66e6f Don't check if path is root directly 2018-05-09 17:54:52 +07:00
Rudi Grinberg 28f451f33c
Merge pull request #757 from rgrinberg/path-refactors
Path refactorings.
2018-05-09 17:53:56 +07:00
Rudi Grinberg ad4bc43a9f
Merge pull request #755 from rgrinberg/rm-rf-safety
Rm -rf safety
2018-05-09 17:45:06 +07:00
Rudi Grinberg c563fc1db8 Re-implement many path functions using kind
This will make it easier to port them to symbolic paths as this check is also
necessary there.
2018-05-09 17:33:05 +07:00
Rudi Grinberg 92b351de30 Small refactoring to call Path.absolute one less time 2018-05-09 17:32:36 +07:00
Rudi Grinberg 46d74e1a96 Implement Path.explode_exn in terms of Path.explode 2018-05-09 17:32:33 +07:00
Rudi Grinberg 65385bbaa4 Remove Path.drop_prefix
not used anywhere
2018-05-09 17:29:19 +07:00
Rudi Grinberg 47d54854e4 Safety feature for Path.rm_rf 2018-05-09 17:11:09 +07:00
Jérémie Dimino 5ac3acf195
Add File_tree.Dir.dune_file (#749) 2018-05-09 09:18:01 +01:00
Rudi Grinberg 78612e0649 Move of_user_written_path to Alias0.T
This is done to avoid double check of the path being in build dir
2018-05-09 08:10:41 +07:00
Rudi Grinberg 8eba040b92 Rename Alias.of_path to Alias.of_user_written_path
And add a loc argument for correct error messages
2018-05-09 08:05:57 +07:00
Rudi Grinberg 84831308f0 Make sure that Alias0.dir always goes through dir check
the directory must always be inside the build dir, so we make sure that any way
to create the record validates this invariant
2018-05-09 08:05:57 +07:00
Rudi Grinberg 0f648f1387 Make sure Alias0.dir is always in the build_dir 2018-05-09 08:05:57 +07:00
Rudi Grinberg 4c7a78e5d6 Pass some missing loc's when using Path.relative 2018-05-09 08:01:57 +07:00
Jérémie Dimino e6650a322f
Better error message for #745 (#748) 2018-05-08 16:28:50 +01:00
Rudi Grinberg 0f8dcc5848 Change Path.insert_after_build_dir_exn not to hard code _build
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
2018-05-08 18:55:19 +07:00
Jérémie Dimino 4d8ca489be
Add support for environment & build profiles (#419) 2018-05-04 16:49:25 +01:00
Jeremie Dimino dc0a6d4401 Rename all jbuild files 2018-05-04 12:26:26 +01:00
Jeremie Dimino 70abc5544d Add support for dune files 2018-05-04 12:26:26 +01:00
Jeremie Dimino cb4e167232 Get rid of jbuild_file_in
This function will be wrong once we support both dune and jbuild
files. Use more precise locations instead.
2018-05-03 13:54:47 +01:00
Jeremie Dimino db91543e3f Support version stanzas in dune-project files 2018-05-03 11:07:45 +01:00
Jeremie Dimino 8d4e1904a2 Refactor dune-project parsing 2018-05-03 11:07:45 +01:00
Rudi Grinberg 25c34c222c Remove all hard coded uses of "_build"
Always route these cases through Path.build_dir
2018-05-02 22:38:50 +07:00
Jérémie Dimino 325584adfc
Renaming to Dune (#721)
- 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
2018-05-02 12:56:12 +01:00
Jérémie Dimino b54c438fda
Scan the file-system lazily (#732)
Fix #228
Fix #718
2018-05-01 16:55:31 +01:00
Rudi Grinberg 5f237e3a4d Add pretty printers to Findlib.Conf.t 2018-05-01 19:37:51 +07:00
Rudi Grinberg ec3a3bf673 Remove interpret' 2018-05-01 18:50:51 +07:00
Rudi Grinberg 3e9bc8c0c3 Allow setting ENV vars in findlib.conf per toolchain
This is useful for configuring PKG CONFIG for cross compilation
2018-05-01 00:13:50 +07:00
Rudi Grinberg 7b17fa013f Fix #717
Extensions should be removed from the map of basenames to mld paths
2018-04-29 00:52:29 +07:00
Jérémie Dimino 53202d0a09
Make -j default to the number of CPUs (#726) 2018-04-26 16:10:14 +01:00
Rudi Grinberg 4240c632b4
Merge pull request #722 from rgrinberg/path-everywhere
Use Path where Possible
2018-04-25 21:21:37 +07:00
Jérémie Dimino 2af69cb303
Make sure all_lib_deps_by_context doesn't report invalid contexts (#723) 2018-04-25 15:04:57 +01:00
Rudi Grinberg a1835c7fa0 s/relative_build_dir/relative_to_build_dir/ 2018-04-25 20:16:19 +07:00
Rudi Grinberg f44b8bdb1b Unhardcode _build dir everywhere 2018-04-25 18:22:48 +07:00
Rudi Grinberg 4b2a609396 Ignore Sys_error in Path.exists 2018-04-25 18:12:45 +07:00
Rudi Grinberg 62aa5acab3 Remove some path conversion from Action 2018-04-25 16:37:38 +07:00
Rudi Grinberg 63af8747a7 Change std_output_to and opened_file to use Path.t 2018-04-25 16:33:25 +07:00
Rudi Grinberg b02c61f63c Change the prog arg in Process to Path.t 2018-04-25 16:30:18 +07:00
Rudi Grinberg 729e85716c Port tmp files to use Path.t 2018-04-25 16:23:47 +07:00
Rudi Grinberg e310f17237 Get rid of Path.is_file 2018-04-25 16:18:32 +07:00
Rudi Grinberg 5eb444e357 Change Process.run's ~dir argument to use Path.t
This also requires Scheduler.with_chdir to use Path.t as well
2018-04-25 13:25:07 +07:00
Rudi Grinberg 7820e29d28 Port Io to use Path.t 2018-04-25 03:25:27 +07:00
Rudi Grinberg 79e434c658 Move sexp's io functions to Io.Sexp
to avoid circular dependencies when adding Path.t to Io
2018-04-24 23:21:42 +07:00
Rudi Grinberg 0d76abca91 Move ocaml-syntax related stuff to jbuild_load
This stuff is too specific to parsing jbuild files to be in stdune
2018-04-24 23:17:53 +07:00
Jérémie Dimino 239ff0054e
Remove jbuilder_ prefix for vendored libraries (#720)
It's not useful since we are not installing them. Also unwrap
libraries that are unwrapped upstream.
2018-04-24 14:38:30 +01:00
Rudi Grinberg 6aa1b84fee Move Path to Stdune
* 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.
2018-04-24 19:33:40 +07:00
Rudi Grinberg bfd0f2eada Fix 4.02.3 build 2018-04-24 10:10:01 +07:00
Rudi Grinberg 10c01ac741 Move Sexp to stdune
In the process, change all the Loc.fail's to Of_sexp exceptions
2018-04-24 01:47:54 +07:00
Rudi Grinberg 77af5b3a88 Add Usexp.Loc.in_file
Moved from Loc
2018-04-24 01:46:57 +07:00
Rudi Grinberg 03e439e449 Decouple sexp from Import 2018-04-24 00:17:58 +07:00
Rudi Grinberg 5147de3873 Decouple hint handling in sexp parser from Import 2018-04-24 00:17:19 +07:00
Rudi Grinberg 6dee7c9c39 Remove dependence on Improt in Path 2018-04-23 23:53:54 +07:00
Rudi Grinberg 980f5037cc Move maybe_quoted to string module 2018-04-23 23:51:22 +07:00
Rudi Grinberg 9aa827ac35 Replace all code_errorf with code_error 2018-04-23 23:48:24 +07:00
Rudi Grinberg 59eda906b0 Convert locs to sexps
Done in a crappy way for now because the converters haven't yet made it to Usexp
2018-04-23 23:47:55 +07:00
Rudi Grinberg 24041593da Move Code_error to Stdune.Exn
This exception is useful outside of jbuilder
2018-04-23 14:04:15 +07:00
Rudi Grinberg 98b2ea795c Move String_map to stdune 2018-04-23 12:43:20 +07:00
Rudi Grinberg 530dbfeb81 Move String_set to stdune 2018-04-23 12:08:09 +07:00
Jeremie Dimino 13b770962d Remove the ?extra_targets argument of Build.run
Instead, use Hidden_targets
2018-04-18 17:00:11 +01:00
Jeremie Dimino bd7f793792 Add Arg_spec.Hidden_targets
Same as Hidden_deps: allows to declare targets than don't appear on
the command line.
2018-04-18 17:00:11 +01:00
Rudi Grinberg 3e1495e47e Add entry module for configurator
Only expose the public api (v1) in it
2018-04-17 22:25:45 +07:00
Rudi Grinberg 1d33f81298 Extract #define's using @whitequark's hack 2018-04-17 22:25:45 +07:00
Rudi Grinberg e0d7570752 Do not run compiled programs to extract #define's
Running a program to extract a #define value doesn't work in a cross compilation
environment. Nevertheless, we can extract #define constants by invoking the
preprocessor directly using the -E flag and doing some parsing to extract
values.

As a consequence, we now ignore the link_flags argument. As we're not going to
be linking any executables. We aren't removing the argument altogether since
it's technically a breaking change. The user will instead see a deprecation
warning when ~link_flags is provided.
2018-04-17 22:24:40 +07:00
Rudi Grinberg 5a89767184
Merge pull request #707 from Chris00/master
Add Configurator.V1.write_as_sexp
2018-04-17 22:20:55 +07:00
Etienne Millon 1dbf960d41 Skip alias modules in the map 2018-04-17 15:51:29 +01:00
Etienne Millon ec9ff813ad Fallback to implementation if there is no mli 2018-04-17 15:51:29 +01:00
Etienne Millon 40624e744b Build transitive dependencies with ocamldep
This uses two different extensions:

- `.d` corresponds to the raw `ocamldep` output.
- `.all-deps` corresponds to this output, merged with the dependencies
of all the interfaces mentioned in the earlier.

This also means that `.all-deps` files will contain output from multiple
files.
2018-04-17 15:51:29 +01:00
Christophe Troestler 7e1b521d7b Add Configurator.V1.write_flags
See https://github.com/ocaml/dune/pull/696/files#r181721525
2018-04-17 16:07:38 +02:00
Rudi Grinberg 9414913286 Add test to make sure that ${null} isn't a target 2018-04-17 10:58:53 +07:00
Rudi Grinberg 69b76f0c8e Add ?prelude argument when import constants
A user can now define their own macros to use with extracting compile time info
2018-04-17 00:26:23 +07:00
Rudi Grinberg 75bc824f97 Get rid of the -ocamlc arg altogether 2018-04-12 18:05:40 +07:00
Rudi Grinberg 86e4df847b Warn the user when DUNE_CONFIGURATOR is overwritten with -ocamlc 2018-04-12 00:16:36 +07:00
Rudi Grinberg 22576fac7e Fix compatibility for ocaml without Sys.getenv_opt 2018-04-11 22:37:25 +07:00
Rudi Grinberg d65845abb8 Pass ocamlc explicitly to configurator using DUNE_CONFIGURATOR 2018-04-11 21:26:51 +07:00
Rudi Grinberg a3a9a1c719 Move current configurator API to V1 module 2018-04-11 09:43:37 +07:00
Rudi Grinberg bd52821556 Mark internal (unstable) libraries as such
Add an internal description in the synopsis and also a comment in the ocamldoc
2018-04-10 23:02:14 +07:00
Rudi Grinberg e832b7230d Add public_name's to all dune sub libraries
These will all live under the jbuilder package
2018-04-10 22:05:52 +07:00
Rudi Grinberg 0bbbf5320f
Merge pull request #686 from rgrinberg/remove-has-dot-merlin
Remove ~has_dot_merlin flag
2018-04-10 20:07:06 +07:00
Rudi Grinberg 62bbd5d30e
Merge pull request #671 from rgrinberg/pr/653
Cosmetic changes for default package entry point.
2018-04-10 20:04:28 +07:00
Rudi Grinberg c5633c9c34 Fix indentation 2018-04-10 11:51:04 +07:00
Rudi Grinberg 9acf617563 Remove ~has_dot_merlin flag
it was introduced to avoid generaitng a needless .merlin file for utop levels.
But now that we have a better mechanism for that, it serves no purpose.
2018-04-10 02:01:33 +07:00
Jeremie Dimino 3c7672c696 Report the ppx runtime deps as external dependencies 2018-04-09 06:31:52 +08:00
Jeremie Dimino 22b024a977 More hacks for external-lib-deps
Fix #644
2018-04-09 06:31:52 +08:00
Jeremie Dimino 1215fe2f8a Remove unused Lib.Compile.make 2018-04-09 06:31:52 +08:00
Jeremie Dimino 0104309f25 Use Arg_spec.Hidden_deps 2018-04-09 06:31:52 +08:00
Jeremie Dimino 85c8fff7f5 Add Arg_spec.Hidden_deps 2018-04-09 06:31:52 +08:00
Jeremie Dimino 606ad1b10f Pass around library dependencies as static values
This way we know more of the compilation DAG statically. This helps
for parallelism as well as for `jbuilder external-lib-deps`
2018-04-09 06:31:52 +08:00
Jeremie Dimino 9e75552c6b Add Cm_kind.Dict.make_all 2018-04-09 05:59:12 +08:00
Jeremie Dimino 9b1adee13c Record library dependencies using Build.prefix_rules 2018-04-09 05:59:12 +08:00
Jeremie Dimino 950a37b1ad Generate select rules explicitely in gen_rules 2018-04-09 05:59:12 +08:00
Jeremie Dimino 75269117cd Use static requires in merlin 2018-04-09 05:59:12 +08:00
Rudi Grinberg c0c69b44db Update configurator to use Exn.raise_with_backtrace 2018-04-06 23:34:02 +08:00
Rudi Grinberg 52a3833e0e Add Exn.raise_with_backtrace 2018-04-06 22:26:49 +08:00
Rudi Grinberg 10c5447608 Print backtrace in case of uncaught exception
Otherwise uncaught by configurator are hard to debug
2018-04-06 21:26:15 +08:00
Rudi Grinberg 6688144a74 Add Char module to stdune 2018-04-06 11:51:03 +08:00
Rudi Grinberg 41047e36d1
Merge pull request #677 from rgrinberg/4.02.3-configurator-fixes
4.02.3 configurator fixes
2018-04-06 10:23:27 +08:00
Rudi Grinberg f19d5c69ee Add Char compatibility module for 4.02.3
This is needed for configurator
2018-04-05 23:35:45 +08:00
Rudi Grinberg 9f9a770b13 Disable warning 50 for configurator on 4.02.3 2018-04-05 23:35:22 +08:00
Rudi Grinberg 651d12df5d Implement manual printers for Meta type 2018-04-05 23:02:57 +08:00
Rudi Grinberg 4314dd7db3 Add some primitives to make writing formatters easier
* ocaml_list
* quoted
* const
* record
2018-04-05 23:02:25 +08:00
Jeremie Dimino a1812fccd5 Add INSIDE_DUNE to detect when we are running from unside Dune
And use the following defaults: -j 1 --root . --display quiet
2018-04-03 11:43:07 +08:00
Jeremie Dimino 31858c9680 Don't on side-effects for setting up the environment
Instead of making sure we set global variables and call Unix.putenv in
the right order, pass the environment explicitely everywhere.
2018-04-03 11:43:07 +08:00
Thomas Refis 77c717b9af Cosmetic changes for default package entry point. 2018-04-03 00:54:30 +08:00
Anton Bachin f29ff0945d Place module list on its own line (take 2)
See eb05f4f643 and
https://github.com/ocaml/dune/pull/367#issuecomment-352209790.
2018-04-03 00:13:36 +08:00
Rudi Grinberg ff211b18a7 Fix lazy loading of rules
We must load package rules when a file in the _mld dir is requested
2018-04-02 23:15:56 +08:00
Rudi Grinberg 85d69b8e1a Remove Odoc.pkg_odoc
This function is only used once
2018-04-02 19:47:13 +08:00
Jeremie Dimino 01fab4c1c3 Add Stdune.Or_exn 2018-03-30 16:55:44 -04:00
Jeremie Dimino ba439b534d Fix previous commit 2018-03-30 16:47:29 -04:00
Jeremie Dimino cd2cfb44e8 Register a few more dependencies statically
This is needed for "external-lib-deps" and it improves parallelism.
2018-03-30 13:16:23 -04:00
Jeremie Dimino 341de6e50f Fix check for empty libraries 2018-03-30 11:22:53 -04:00
Jeremie Dimino e65213e303 Fix Main.external_lib_deps 2018-03-29 15:33:18 -04:00
Jeremie Dimino c7b9c2cd3e Fix #661: better error when a public library is defined twice 2018-03-29 15:04:14 -04:00
Jeremie Dimino ad00c1509f Fix #657 2018-03-27 17:25:25 -04:00
David Allsopp 808644533f Don't color the whitespace in --display=short 2018-03-24 12:25:27 +00:00
Rudi Grinberg 8fd04e5a9f Use doc_dir rather than dir
dir is the source directory which is useless to us
2018-03-24 00:54:33 +08:00
Rudi Grinberg aea0131b11 Don't pass library include flags to odoc
We should pass directories where we store .odoc files instead
2018-03-24 00:38:34 +08:00
Rudi Grinberg 141e979611
Merge pull request #649 from rgrinberg/PATH-x
Set the target's PATH when cross compiling
2018-03-24 00:13:53 +08:00
Rudi Grinberg 8859a644e9 When executing in the target, use the host's PATH variable 2018-03-23 22:39:06 +08:00
Rudi Grinberg fae5e78fc2 Change Meta.load to return the simplified meta
It's always simplified anyway
2018-03-23 10:12:34 +08:00
Rudi Grinberg 9f3eb956d3 Add Env.update 2018-03-22 22:42:42 +08:00
Rudi Grinberg a83c15b085 Alphabetical listings in odoc
List sub libraries and their modules in alphabetical order
2018-03-22 20:40:46 +08:00
Rudi Grinberg f8225b1e7b Replace blank c compilers with dummy values
This is how we treat the assembler.
2018-03-22 00:03:35 +08:00
Rudi Grinberg 96222ee681 Don't error out when asm is a blank value
Treat it as missing instead
2018-03-22 00:03:35 +08:00
Rudi Grinberg 994fb12651 Tweak order in Map.of_list error (#645)
We should show the key that came earlier in the list first
2018-03-20 14:08:02 -04:00
Rudi Grinberg d2c85e3329 Use dummy value for asm when absent
On bytecode only systems, this parameter may be absent. We use a dummy in such
situations. A dummy value is used so that users do not get immediate erros when
using an absent value.
2018-03-21 00:53:37 +08:00
Jérémie Dimino f5f151dc19
Inspect OCAMLPATH when not using `ocamlfind` (#642) 2018-03-20 12:43:51 -04:00
Rudi Grinberg cc02277095 Handle duplicate environment variables
Fixes #638
2018-03-20 22:02:49 +08:00
Rudi Grinberg 2e636ef43e
Merge pull request #636 from ocaml/fix-path-sep-on-cygwin
Use ; as path separator for OCAMLPATH on Cygwin
2018-03-20 09:22:54 +08:00
Jérémie Dimino a8072f08bc
Rework the sub system select (#632)
Split the select_backends between two functions:
- one for backends that support extensions
- one for backends that support replacement

it might be possible to support both at once, but for now this is
enough and it's simpler.
2018-03-19 20:47:51 -04:00
Jeremie Dimino fae09828af Use ; as path separator for OCAMLPATH on Cygwin
Since this is what ocamlfind expects
2018-03-19 19:25:50 -04:00
Jérémie Dimino 3f22d9f82b
Do not pass -runtime-variant _pic on Windows (#635) 2018-03-19 19:13:02 -04:00
Jeremie Dimino 53ec04adfe fix 2018-03-18 16:32:20 -04:00
Jeremie Dimino bdb03925d1 Add Lib.Compile.compile_and_link_flags 2018-03-18 16:22:56 -04:00
Jeremie Dimino 945583ff43 Add Arg_spec.of_result{,_map} 2018-03-18 16:22:05 -04:00
Jeremie Dimino 09ff33951b Change the type of Build.of_result and add Build.of_result_map 2018-03-18 16:21:59 -04:00
Jeremie Dimino 997d541c50 Make Top_closure more polymorphic 2018-03-18 16:21:46 -04:00
Jeremie Dimino e638c04cb2 Add Jbuild.Lib_deps.of_pps 2018-03-18 16:20:32 -04:00
Jeremie Dimino d15974c4ea Add Option.some 2018-03-18 16:20:19 -04:00
Jeremie Dimino 2c59032181 A file might be part of several packages 2018-03-19 01:24:17 +08:00
Jeremie Dimino c685e8ac6d Remove useless load_dir 2018-03-19 01:24:04 +08:00
Jeremie Dimino b5fad14f16 Less Path.Set.t -> Path.t list conversions 2018-03-19 01:19:41 +08:00
Jeremie Dimino 30c59cc476 Use dynamic dependencies for the package deps 2018-03-19 01:19:31 +08:00
Jeremie Dimino 9043280160 Allow dynamic dependencies for aliases 2018-03-19 01:19:20 +08:00
Jeremie Dimino a55cde2969 fix 2018-03-19 01:19:09 +08:00
Jeremie Dimino 73873b31bc Recursive package deps 2018-03-19 01:18:55 +08:00
Jeremie Dimino 1b8fbfc149 Use an alias name that is less likely to clash with user aliases 2018-03-19 01:18:45 +08:00
Jeremie Dimino 1a4037f8d1 Define the package_install alias at once
This is slightly more efficient that calling `add_alias_deps` for each
file.
2018-03-19 01:17:57 +08:00
Jeremie Dimino ee5dd505fb comment 2018-03-19 01:17:47 +08:00
Rudi Grinberg b187d6e4ba Add the (package ..) dependency type
Add a (package <name>) dependency type which adds a dependency on all the
installable files of a package.
2018-03-19 01:05:55 +08:00
Rudi Grinberg 4a0f4c0ff9 Fix encoding of inline_tests
Encode optional fields as records where optional keys that are None will be
omitted in the resultant sexp. This will match reading the keys back with field_o
2018-03-18 22:48:42 +08:00
Rudi Grinberg 7a26c18e20 New odoc rules 2018-03-18 17:44:08 +08:00
Rudi Grinberg 86768475b2 Install rules for mlds 2018-03-18 17:00:28 +08:00
Rudi Grinberg 25d52d1e3a Add Lib.Map 2018-03-18 13:42:01 +08:00
Rudi Grinberg 0a57a02819 Add documentation stanza 2018-03-18 13:42:01 +08:00
Rudi Grinberg 8f967dbca5
Merge pull request #627 from rgrinberg/pkg-lib-map
Add a map from package names to libraries to super context
2018-03-18 13:25:48 +08:00
Jeremie Dimino 93d33592c6 Fix Atom.is_valid 2018-03-17 14:23:43 +00:00
Jeremie Dimino da7874ebdf Fix Atom.is_valid 2018-03-17 14:23:43 +00:00
Rudi Grinberg 5a5ba64503 Fix 4.02.3 compat in usexp
Do not use Char.equal
2018-03-17 14:23:43 +00:00
Rudi Grinberg f39b302a8d Fix Atom definition of Usexp
Fix the is_valid function to only validate atoms that don't contain spaces,
parens, comment characters.
2018-03-17 14:23:43 +00:00
Rudi Grinberg 9b5ac4060f Add a map from package names to libraries to super context
Will be used for odoc and installation
2018-03-16 13:49:33 +08:00
Jérémie Dimino 69c5a4a79d Implement Lib.package
Gets the opam package of a library for a public or installed library
2018-03-16 11:11:48 +08:00
Jérémie Dimino b59dab57da Include the package in the public status of libraries 2018-03-16 11:11:18 +08:00
Rudi Grinberg 07385a15ed Remove double extending the env with context's env 2018-03-16 01:45:52 +08:00
Rudi Grinberg 68cf393c5f Use Bin.path_sep 2018-03-16 01:45:39 +08:00
Rudi Grinberg 2634477def Change Action to include the context's exec env 2018-03-16 00:44:23 +08:00
Rudi Grinberg 3c7e6adc73
Merge pull request #619 from rgrinberg/install-run-fixes
Tweaks to Actions
2018-03-15 19:10:13 +08:00
Rudi Grinberg db55b4e880
Merge pull request #618 from rgrinberg/scope-encode
Move they '@' scope encoding to common module
2018-03-15 19:09:56 +08:00
Rudi Grinberg 9a1910cf6f Add context for alias actions 2018-03-15 18:25:21 +08:00
Rudi Grinberg bd457ea549 Use Env.t over string array in another place 2018-03-15 18:24:41 +08:00
Rudi Grinberg dea2ac77ca No optional args for context 2018-03-15 18:24:36 +08:00
Rudi Grinberg a62e92a0ee Move they '@' scope encoding to common module
This encoding will also be used by odoc so it's best to share it
2018-03-15 14:50:34 +08:00
Rudi Grinberg 25158fc702 Share Ordered_set_lang.Make(String)(String) 2018-03-15 14:25:04 +08:00
Rudi Grinberg 286f93a963 indentation 2018-03-15 14:24:55 +08:00
Jeremie Dimino 3b1bef8b9c ocamlX_flags --> ocamlX_cflags 2018-03-14 12:02:56 +00:00
Rudi Grinberg 521a36dcef
Merge pull request #603 from diml/universe
Allow to depend on the universe
2018-03-14 13:02:23 +07:00
Rudi Grinberg 28208a1c12
Merge pull request #612 from rgrinberg/rename-result-private-lib
Rename the result private library
2018-03-14 12:59:36 +07:00
Rudi Grinberg 48ca91e013 Move the results lib into Caml
The result name is taken by other libs hence it breaks `jbuilder utop`. Hence we
simply move it our stdlib overlay. The -open flag is used to avoid having to
modify vendored code.
2018-03-14 12:09:20 +08:00
Jeremie Dimino 6fc1e0659a Workaround non-precise mtime on OSX 2018-03-13 19:15:06 +00:00
Jeremie Dimino e2adf9d44a Allow to depend on the universe
Fix #255
2018-03-13 19:12:57 +00:00
Jérémie Dimino 8e4c9fce4c
Import the Sexp parser generator (#608) 2018-03-13 19:06:34 +00:00
Rudi Grinberg d6a6a817f7 Move Io to stdune
This allows configurator to drop the dependency on jbuilder itself
2018-03-13 20:27:07 +07:00
Rudi Grinberg 12511a68ea
Merge pull request #607 from rgrinberg/private-public-overlap-take2
Disallow public/private overlap
2018-03-13 03:39:55 +07:00
Jérémie Dimino ca5c383b3b
Fix locations reported by the parser (#609)
The start position of atoms wasn't saved by the parser.
2018-03-12 18:41:49 +00:00
Jeremie Dimino e57a706960 Use the use-site location for errors from pps 2018-03-12 18:07:05 +00:00
Jeremie Dimino 7e361d596e Let Report_error print the location for Private_deps_not_allowed 2018-03-12 17:58:54 +00:00
Jeremie Dimino 178e26cfd9 Use a more informative name 2018-03-12 17:56:24 +00:00
Jeremie Dimino 69209d7243 Remove extra parentheses 2018-03-12 17:53:00 +00:00
Rudi Grinberg 753badd481 Fix private deps check for ppx runtime dependencies 2018-03-13 00:11:12 +07:00
Rudi Grinberg 0823f9d803 allow_private_deps flag
Flag to guard public dependencies from acquiring private ones
2018-03-12 23:38:48 +07:00
Rudi Grinberg 2f7db648ed
Merge pull request #601 from rgrinberg/env-context
Move env var handling outside of Context.t
2018-03-12 19:13:33 +07:00
Jeremie Dimino f74817e00d Fill the loc field of rules 2018-03-12 12:02:55 +00:00
Jeremie Dimino eef3633d9a Tweak error messages 2018-03-12 18:45:47 +07:00
Rudi Grinberg 4a68db622d Change representation to map from assoc list 2018-03-12 18:45:47 +07:00
Rudi Grinberg 161be3af1c Stage Var.compare 2018-03-12 18:45:47 +07:00
Rudi Grinberg 1f99d0fb70 Simplify Env.get
we already have Var.equal now
2018-03-12 18:45:47 +07:00
Rudi Grinberg f4955cdc22 Remove env_extra from Context.t
Rely on diffing
2018-03-12 18:45:47 +07:00
Rudi Grinberg 79d47ab68e Simplify Env.t
Use assoc list
2018-03-12 18:45:47 +07:00
Rudi Grinberg 26d6b03c66 Make unix representation more efficient
By not allocation a closure on every update
2018-03-12 18:45:47 +07:00
Rudi Grinberg e604c69510 Remove env_extra in Action
It's simply to just use Env.t everywhere. Also, there's no need to have the env
in the execution context since it's not used for anything. Only the env that is
passed directly is used.
2018-03-12 18:45:47 +07:00
Rudi Grinberg f1baaa23a8 Add Env.add
Just add 1 binding to Env
2018-03-12 18:45:47 +07:00
Rudi Grinberg 3193e4902d Make Process.run take Env.t directly 2018-03-12 18:45:47 +07:00
Rudi Grinberg 4b191b2b03 s/Env.get_var/Env.get/ 2018-03-12 18:45:47 +07:00
Rudi Grinberg 206cc69fd9 Simplify Context.create
There's no need for a base_env parameter as it's always Env.initial
2018-03-12 18:45:47 +07:00
Rudi Grinberg 35d4153641 Make Env.t abstract 2018-03-12 18:43:02 +07:00
Rudi Grinberg 8458bf3b15 Move env related functions to Env module 2018-03-12 18:43:02 +07:00
François Bobot feba0827b8 Allow to link executables as static or shared objects (#23)
- Setup the rules to use the `-output-complete-obj` option of OCaml
- Introduce a `best` mode in addition to `byte` and `native`
- Extend the `modes` field of executables to mean "linking modes", and add linking modes for static and shared objects
2018-03-12 11:40:53 +00:00
Jeremie Dimino 5286b42f58 Fix #597 2018-03-10 08:25:45 +07:00
Jeremie Dimino b219f28a8a Format fix 2018-03-09 20:43:57 +00:00
Jérémie Dimino 1feab6b2a6
Allow to specify additional libraries for the test runner (#600) 2018-03-09 19:51:02 +00:00
David Allsopp b604871aab Limit number of simultaneously opened fds (#578)
Non-optimal solution: only handles the common case.
2018-03-08 18:28:14 +00:00
Jérémie Dimino b029d32dfb
fix String_with_vars.sexp_of_t (#595) 2018-03-07 15:01:46 +00:00
Jeremie Dimino 0f0b154de6 Remove ranlib, doesn't seem to be available on Windows 2018-03-07 09:40:08 +00:00
Jeremie Dimino 98bb8adf83 fix 2018-03-07 09:40:08 +00:00
Jeremie Dimino cc845e5fdb Make all variables accessible in jbuild files 2018-03-07 09:40:08 +00:00
Jeremie Dimino 21a980a5d1 Update configurator 2018-03-07 09:40:08 +00:00
Jeremie Dimino 6ee6ed35d2 Ocamlc_config --> Ocaml_config 2018-03-07 09:40:08 +00:00
Jeremie Dimino 3bc21617b2 Refactor ocamlc_config 2018-03-07 09:40:08 +00:00
Jeremie Dimino 0b6a7eee2f Recent versions of ocaml expose 'ext_exe' 2018-03-07 09:40:08 +00:00
Jeremie Dimino 9c178480ea Update configurator 2018-03-07 09:40:08 +00:00
Jeremie Dimino d415ed5f6c Expose a few more variables 2018-03-07 09:40:08 +00:00
Jeremie Dimino 1ff05d52e2 Refactor a bit the variables in super_context.ml 2018-03-07 09:40:08 +00:00
Jeremie Dimino a95fd29dba Move Ocamlc_config to its own library and refactor it a bit 2018-03-07 09:40:08 +00:00
Jérémie Dimino dfdb6c09f4
Allow to set the library path at configure time (#575)
This allow to drop the dependency on ocamlfind
2018-03-06 14:56:24 +00:00
Jeremie Dimino 232acdd92f Libraries and executables can allow overlapping dependencies 2018-03-06 12:59:01 +00:00
Jeremie Dimino a5f9a9e063 Detect overlapping libraries 2018-03-06 12:59:01 +00:00
Rudi Grinberg c8355b454c Generalize Ordered_set_lang to return a custom map
This simplifes all the conversion from and to Module.Name.Map.t
2018-03-06 18:45:38 +07:00
Rudi Grinberg ddefafa58b Introduce private type for module name 2018-03-06 18:45:38 +07:00
Jeremie Dimino 6eace337bc typo 2018-03-05 18:06:41 +00:00
Jérémie Dimino cd6812f269
Accept and ignore ppx.driver fields (#588) 2018-03-05 17:59:56 +00:00
Jérémie Dimino 4857ed444a
Reduce interleaving in the scheduler (#586) 2018-03-05 17:52:21 +00:00
Rudi Grinberg 5ded45faf0
Merge pull request #584 from rgrinberg/improve-error-modules
Improve error in modules partition
2018-03-05 23:47:19 +07:00
Jeremie Dimino 348d2b1a1e display tweaks 2018-03-05 16:24:24 +00:00
Rudi Grinberg 719cf5eea0 Improve error in modules partition
Specify how to fix the error (by writing modules fields)
2018-03-05 23:11:45 +07:00
Jeremie Dimino 3edc029bf4 ws 2018-03-05 15:05:24 +00:00
Rudi Grinberg 75fe147da9
Merge pull request #577 from rgrinberg/menhir-own-module
Move menhir rules to own module
2018-03-05 21:30:17 +07:00
Jeremie Dimino a1beb25d12 Add a bit more doc to Build 2018-03-05 14:14:09 +00:00
Jeremie Dimino 1a4362b0b1 Document Arg_spec a bit more 2018-03-05 14:00:29 +00:00
Jeremie Dimino 4c2768e805 style + doc 2018-03-05 14:00:21 +00:00
Rudi Grinberg 6d5c2de689 Change menhir flags to use ordered set language
Consistent with how flags are handled elsewhere in jbuilder
2018-03-05 20:03:16 +07:00
Rudi Grinberg f06519e231 Implement menhir rules from scrath
Rather than changing them to user_rules and then compiling those.
2018-03-05 19:56:27 +07:00
Rudi Grinberg 288de19920 Move menhir rules to own module 2018-03-05 18:32:25 +07:00
Rudi Grinberg 09aa2cd1cf
Merge pull request #574 from diml/workaround-broken-builtins
Add a simple workaround for #563
2018-03-05 16:34:34 +07:00
Rudi Grinberg 7c287a5e0a Change Package.Name.t to interned type 2018-03-03 20:41:29 +07:00
Jeremie Dimino d1feb062b6 Add a workaround for broken META file for builtin packages
Fixes #563
2018-03-03 11:33:40 +00:00
Rudi Grinberg ff05369868 Introduce package name private type 2018-03-03 01:44:03 +07:00
Rudi Grinberg e4aac2da97 Improve error message for missing scopes 2018-03-02 15:55:48 +07:00
Jeremie Dimino de99d84f73 Ignore errors while generating the .merlin file
Fix #568
Fix #51
2018-03-01 23:34:43 +00:00
Jeremie Dimino 1b279f30bf Make Merlin.t abstract 2018-03-01 23:30:06 +00:00
Jeremie Dimino 39ac04a535 Add Build.catch 2018-03-01 23:30:06 +00:00
Jeremie Dimino 2e7f881d4c Fix #567
The alias module needs an implementation for non-jbuilder users.
2018-03-01 20:47:08 +00:00
Rudi Grinberg 7790d6bd4c Fix DB.all returning non unique libs (#565)
DB.all will return duplicate libraries in cases when it has 2 names for the same
library. This fix changes all to return a set of values. This is to indicate and
guarantee the uniqueness.
2018-03-01 11:53:27 +00:00
Rudi Grinberg 66a907be58
Merge pull request #467 from ocaml/import-configurator
Import configurator
2018-03-01 12:28:32 +07:00
Jeremie Dimino d5ebd0e9be Allow to capture the library a backend is attached to 2018-02-28 19:08:03 +00:00
Jeremie Dimino 17f4567014 Still build a Lib.t value for hidden libraries
This makes everything else simpler
2018-02-28 19:08:03 +00:00
Rudi Grinberg 3e73397638 Port configurator to dune 2018-02-28 23:37:20 +07:00
Rudi Grinberg 9b6abc4014 Initial import of configurator
This is the original source imported
2018-02-28 23:36:35 +07:00
Rudi Grinberg 070fd95cac Add configurator build
For now the library is private
2018-02-28 23:33:16 +07:00
Jérémie Dimino 55675598c4 Extend ocamlc_config for configurator
* Add make to create ocamlc_config.t
* Add function to get bindings
2018-02-28 23:32:24 +07:00
Rudi Grinberg 9a6d9a3aa9 Extend stdlib for configurator 2018-02-28 23:31:24 +07:00
Jérémie Dimino 45535f7afd
Extracted SC.PP as Preprocessing (#560) 2018-02-28 12:26:34 +00:00
Rudi Grinberg d01a684f71 Move SC.Doc to Odoc module
It longer has a rason to exist in super context.
2018-02-28 17:24:37 +07:00
Rudi Grinberg 02c5b005dd Move intallation and META rules to install_rules module 2018-02-28 12:21:25 +07:00
Rudi Grinberg 5ecf354127 Add a sub-system for inline tests (#547)
To support frameworks such as ppx_inline_test, ppx_expect and qtest
2018-02-27 19:06:12 +00:00
Xavier Clerc c324736d11 Support upcoming ppxlib (was "ppx_base") (#554) 2018-02-27 12:56:47 +00:00
Jeremie Dimino 4dc8d2456f Pass obj_dir explicitely to Exe.build_and_link and don't return it
The only place where we used the default value was gen_rules
2018-02-26 16:05:48 +00:00
Jérémie Dimino 138c920069 Add support for sub-systems
- Add a Sub_system module that allows to register sub-systems
  that are implemented in a single file
- Add a Syntax module to deal with versioned syntaxes

Other changes:
- Add location to all library dependencies in jbuild files, to report
  properly located errors
- Change the type of functions in Lib to return (_, exn) result
  rather than (_, Lib.Error.t With_required_by.t) result, which was
  hard to use
- Remove With_required_by.t as it was unused
- Rename With_required_by to Dep_path
- Cleanup a bit the Exe module, move a lot of stuff that was specific to
  executable stanzas in gen_rules.ml
- Add String_with_vars.Unexpanded.sexp_of_t
- Rework a bit the code in Lib, in particular factorize the code
  for taking the transitive closure of libraries
- Add an ?extra_vars argument to functions that expand variables
  in Super_context
- Fix the printing of dependency path
- Merge the handling of dependency path between the build system and
  the Lib module
2018-02-26 16:05:48 +00:00
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 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
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 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
Jeremie Dimino 41b5017eb2 Fix #534 2018-02-21 13:35:47 +00:00
Rudi Grinberg 80ed205e38 Refactor utop module to use the new exe module 2018-02-21 16:44:31 +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
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
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 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 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 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 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
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
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
Jérémie Dimino 8e27f1966d
Fix #485 (#512) 2018-02-13 15:56:59 +00:00
Jérémie Dimino 2fb65c05ba
Fix #330 (#510) 2018-02-13 12:49:50 +00:00
Rudi Grinberg 0d62c34e42
Make Lib.t abstract (#498)
* Make Lib.t abstract

This requires removing the external/internal separation in most places in the
source code. Briefly, these are:

* Special casing of external libs for incremental compilation in jsoo
* .merlin generation
* stamp file generation
* transitive closure having a flag for walking external libs
* checking if a lib is a driver (checking various names)

These cases are fixed by introducing an src_dir, obj_dir abstractions, and the
ability to check if a library is local.
2018-02-13 18:36:15 +08:00
Rudi Grinberg 2b442c6019 Change .merlin generation to not use PKG
We know the build directory of exteranl packages, hence we should simply use it
as the build and source dir (B and S respectively).
2018-02-13 00:08:45 +08:00
Rudi Grinberg 8781c81bd3 Fix the top closure for internal libs
keying by the private name isn't enough. We include the dir in the key, because
private names are unique per dir.
2018-02-12 19:55:39 +08:00
Rudi Grinberg baa009a0fb Fix map of private installable libraries
It should be keyed by a unique name because the old key - the internal name,
isn't unique. Also take this change to fix the instalable -> installable typo.
2018-02-12 19:55:39 +08:00
Rudi Grinberg 0873ae2b10
Remove primed Lib_db.find_scope (#505)
Two versions aren't really necessary as mostly the primed version was used.
2018-02-10 22:38:28 +08:00
Rudi Grinberg fd6e8ad91f Remove {anonymous,external}_scope from Super_context
These were re-exported to avoid access libs directly, but there's already an
accessor to do that, so these functions weren't used consistently anyway.
2018-02-10 00:15:26 +08:00
Hugo Heuzard dad2458879 install all sources 2018-02-08 23:09:55 +08:00
Jeremie Dimino e22dee5f75 tweaks 2018-02-08 11:01:54 +00:00
Rudi Grinberg c33269b914 Deduplicate closure and closed_ppx_runtime_deps_of (#499) 2018-02-08 10:58:02 +00:00