Commit Graph

14 Commits

Author SHA1 Message Date
Rudi Grinberg a57c488dd7
Fix jbuilder rule in case of missing binaries (#292)
Make jbuilder rules work even when binaries are missing

* Proper error messages for missing binaries

* Unify Prog_spec and Maybe_prog

both can simply be unified into a path type that has a hint for the error

* Remove scarcely useful in_the_tree parameter

It's always true except for the C compiler. In which case, there's no harm in
making it true.

* Make Artifacts return Action.Prog

The old return value was simply converted to this anyway. It's simpler to just
return the proper error straight up.

* Remove remains of in_the_tree
2017-11-07 21:42:55 +08:00
David Allsopp 3a64432d04 Expand variables in flags
Extend Ordered_set_lang.Unexpanded.expand to include a mapping function
for the S-expression for each atom. The previous behaviour can be
achieved with ~f:Sexp.Of_sexp.string, but this allows the S-expression
to be parsed using String_with_vars.t, thus allowing variable expansion.
2017-08-03 17:28:32 +01:00
David Allsopp cebbb219e7 Extend (:include ) form to OCaml flags
flags, ocaml_flags and ocamlopt_flags now support the (:include ) form
of the ordered set language.
2017-08-03 17:28:32 +01:00
Jeremie Dimino 4b40cad247 Revert public_interfaces for now
The code to support it is starting to become increasingly complicated
and the number of problem found is a bit alarming.

We'll reinclude it later after a bit more testing and hopefully some
simplifications.
2017-07-21 17:32:39 +01:00
Jeremie Dimino 9893c14500 Fix some problems related to public_interfaces
The dependencies on library artifacts are now properly setup to point
to the files in _build/install/...

Moreorver, private interfaces are now only visible inside the library
itself and are only allowed for private libraries. When a project
defines multiple packages, this ensures that the visibility when all
packages are built simultaneously and when they are installed one by
one.

We can relax these restrictions later with a bit more work and a clear
definition of where private modules should be visible.
2017-07-21 16:52:28 +01:00
François Bobot a3933a2c18 Add public_interfaces selection for libraries (#106)
Add a field "public_interfaces" to library stanza listing which modules are public.

Private modules won't be accessible outside the scope where the library is defined.
2017-07-19 15:26:48 +01:00
Jeremie Dimino 9f8803af67 Add (modes ...) for executables 2017-05-29 14:18:07 +01:00
Jeremie Dimino a3ee81055d Refactor IO functions and fix invalid IOs in gen_rules 2017-05-18 17:12:32 +01:00
Jeremie Dimino a399d9df8a Declare dependencies on external library files
This way, when an external library is reinstalled, jbuilder knows to
rebuild things.

Currently, because the library dependencies transitive closures are
computed dynamically and jbuilder doesn't yet support dynamic targets,
every single rule has to depend on all the external files.

When jbuilder support dynamic targets, we can setup one alias per
external directory.

Tested the build of 97 Jane Street repository at once. No slow down
observed for the initial build.

Then a null build goes from ~1.5s to 2s. The test case is a bit
extreme so it's bot that bad given the benefits.
2017-05-18 13:52:35 +01:00
Jeremie Dimino 648b2b2990 Revert some changes:
- Make targets explicit b7ad08df84.
- Get rid of Vfile      e73fd90b65.

Without vfile we need some new concepts to avoid parsing the requires
file multiple times and with vfile it's annoying to specify the
dependencies by hand.

Will leave that for future work. Just use memoize where it make sense,
for instance when we read the result from only the current directory
(for instance the ocamldep stuff).
2017-05-15 14:58:37 +01:00
Jérémie Dimino b7ad08df84 Make targets explicit 2017-05-15 09:37:46 +01:00
Jeremie Dimino 411d1a2f2c Refactoring
- add Super_context.resolve_program and use it everywhere.
- add src/js_of_ocaml.mli
2017-05-02 12:01:27 +01:00
hhugo 86a4f0324a Add js_of_ocaml support (#60)
Add rules for building .js files from .bc files using js_of_ocaml as well as rules for separate js compilation when --dev is passed.
2017-05-02 11:25:37 +01:00
Jeremie Dimino 416d4c6ead Move rules for module compilation in their own file 2017-04-28 15:13:43 +01:00