Commit Graph

863 Commits

Author SHA1 Message Date
David Allsopp b6eec7a33d Correct promote-until-clean atom 2018-01-26 16:51:28 +00:00
Jérémie Dimino 437211f74f
Expose the promote mode (#437) 2018-01-25 19:07:46 +00:00
Rudi Grinberg 27e31a3196 Avoid catching wildcard exceptions when calling Findlib.find
But to avoid making the catch statements verbose, move all findlib exceptions to
a variant.
2018-01-25 22:00:52 +08:00
Jérémie Dimino c066efd196
Add the transitive dependencies of used ppx rewriters (#450) 2018-01-25 11:22:50 +00:00
Jeremie Dimino 062cca21e5 Fix #447 2018-01-25 10:13:18 +00:00
Jeremie Dimino ad9b82e92a Compute the transitive closure of ppx runtime deps only when needed
We only need it when the kind is ppx_rewriter or ppx_deriver.
2018-01-24 18:12:50 +00:00
Rudi Grinberg ab18b13a04 Fix META generation wrt scope
We should respect the scope of the current internal library to generate the META
2018-01-24 16:32:10 +08:00
Jérémie Dimino ba5ffbc414
Fix meta generation for ppx runtime deps (#441)
Use the transitive closure for the deprecated ppx method
2018-01-23 16:03:59 +00:00
Rudi Grinberg 58f9e9840c Replace janestreet/jbuilder with ocaml/dune
Update all links where necessary
2018-01-23 17:52:44 +08:00
David Allsopp 6873478307 Display a warning for bad jbuild-ignore lines (#389)
jbuild-ignore should only refer to directories in the current directory
(unlike .gitignore): referring to subdirectories doesn't work.

Signed-off-by: David Allsopp <david.allsopp@metastack.com>
2018-01-23 09:14:22 +00:00
Rudi Grinberg a34f71f922
Merge pull request #410 from rgrinberg/new-odoc-minimal
New odoc rules (minimal)
2018-01-23 02:58:06 +08:00
Rudi Grinberg 6cce747141 Make odoc work with multiple libraries defined in the same dir 2018-01-23 02:56:23 +08:00
Thomas Refis 815c332dc5 odoc: handle .mld files 2018-01-23 02:56:23 +08:00
Jeremie Dimino 13843f93dd Fix #436 2018-01-22 13:12:29 +00:00
David Allsopp 61b3e5f189 Use /Fo instead of -o when invoking CL
The -o option in the Microsoft C Compiler is deprecated (and has been for
a very long time). The warning is tedious, so use /Fo instead. The only
problem with this is that "-o foo.obj" must become "/Fofoo.obj" with no
space, which requires a little support in Arg_spec.

Signed-off-by: David Allsopp <david.allsopp@metastack.com>
2018-01-22 12:17:28 +00:00
Jérémie Dimino f9837a278b
Detect recursive includes (#435)
Fix #432
2018-01-22 11:32:40 +00:00
David Allsopp d2706b448b Remove readonly attribute on Windows before unlink
The legacy DOS readonly attribute is a tedious difference on Windows,
because a user may have permission to delete a file, but unlink fails
because the attribute is set.

Signed-off-by: David Allsopp <david.allsopp@metastack.com>
2018-01-22 11:14:18 +00:00
Jeremie Dimino b401284b84 Restore .merlin-exists trick
This is needed so that command don't depend on the contents of the .merlin
2018-01-19 22:54:05 +00:00
Jeremie Dimino 8b11b494d2 Fix Path.pp 2018-01-19 22:44:30 +00:00
Jeremie Dimino 92c7927432 Fix Path.explode 2018-01-19 22:43:40 +00:00
Jérémie Dimino 5651eb80b5
Better behavior when aliases have targets (#426)
Ignore the targets and report a warning.
2018-01-19 22:17:11 +00:00
Jeremie Dimino 92f9ce4edb Fix the order of files in (diff file.ml file.ml.ppx-corrected)
The generated correction must come after for promotion to work.
2018-01-19 15:32:29 +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
Jérémie Dimino b06aad431e
Replace promote actions by diff actions + promote command (#421)
* Remove (promote ...) and (promote-if ...)
* Remove `--promote ...`
* Add (diff ...) and (diff? ...)
* Add `jbuilder promote` and `--auto-promote`
* Fix #423
2018-01-18 11:32:20 +00:00
hhugo 9347d4a767 tailrec split_lines (#416) 2018-01-17 13:34:53 +00:00
Jérémie Dimino 314da72d3c
Better signature for Artifacts.file_of_lib (#418) 2018-01-16 13:40:04 +00:00
Jérémie Dimino 49edf8ed65
Accept correction files produced by ppx_driver (#415)
* Accept correction files produced by ppx_driver so that [@@deriving_inline] works
* Change promote-if so that it doesn't promote the file when the source file doesn't exist in the source tree
2018-01-16 12:28:02 +00:00
Jeremie Dimino d4dec9b4f5 Change the default of --promote from check to copy
As said in the PR. I forgot to push the commit.
2018-01-15 14:55:17 +00:00
Jeremie Dimino ce901a4731 Fix the build 2018-01-15 13:50:08 +00:00
Jérémie Dimino af5d7f5e6f
Report better errors for globs pointing to non-existing directories (#413)
Fix #412
2018-01-15 13:28:32 +00:00
Jérémie Dimino eab1ff6c7b
Add promote actions and include stanzas (#402)
Add a promote action that allows to copy over generated files as
source files and an include stanza allowing to include a file in a
jbuild file.
2018-01-15 13:24:25 +00:00
Christophe Troestler f8617b5721 Let "concat" or "split" be a quality of the variable (#336)
* Let variables say whether they are Concat or Split

To concatenate the contents of a split variable, put it in a string:
"${var} ".

Fixes #300

See also https://github.com/janestreet/jbuilder/issues/408

* Issue a deprecation warning for ${!...}

* Treat ${CC}, ${<}, ${^} and ${read-lines:...} as split vars

* Change ${!^} into ${^} for this project jbuild rules
2018-01-15 09:32:40 +00:00
Jérémie Dimino d3410e0659 Refactor alias handling
* Improve documentation of alias module
* Add add_alias helper function to help create rules in alias
2018-01-13 19:51:24 +08:00
Jérémie Dimino a1026f46d1 Add action helpers
Add constructor functions for Actions
2018-01-13 19:51:18 +08:00
Jérémie Dimino e28344a24b
Do not use the transitive closure in generated META files (#405) 2018-01-12 16:41:23 +00:00
Rudi Grinberg 92d4cbb7be
Merge pull request #404 from janestreet/make-lint-standard
Make lint alias standard
2018-01-12 15:46:26 +08:00
Rudi Grinberg 6bd46a76f8 Make lint alias standard 2018-01-11 16:20:19 +08:00
Rudi Grinberg 3776acd8d2 Fix c_compiler parsing for OCaml >= 4.06.0 (#393) 2018-01-10 16:54:25 +00:00
Rudi Grinberg ca1c8dd897 Add -null option to linters
Since the omp driver doesn't support this option yet, we must add it
conditionally. This is a temporary workaround.
2018-01-10 22:45:50 +08:00
Rudi Grinberg 1fc0ef0ab1 Add lint rules 2018-01-10 22:45:50 +08:00
Rudi Grinberg 6d2152e7b1 Add Alias.add_{stamp,action}_dep
These functions will be useful to construct alias elsewhere
2018-01-10 22:45:50 +08:00
Rudi Grinberg bfbfc0bf30 Change lint option to be the same as preprocessing 2018-01-10 22:45:50 +08:00
Rudi Grinberg 66fc8db600 add lint alias 2018-01-10 22:45:49 +08:00
Rudi Grinberg 897c1e2e5e Add helper functions
* Path.Set.sexp_of_t
* Module.iter
* List.last
2018-01-10 22:45:31 +08:00
Jeremie Dimino 469079f9c6 Connect usexp errors to the error reporter
Fix #384
2018-01-09 09:55:01 +00:00
Rudi Grinberg 1ff8a7989c Cross compilation support
In a host/target setup, all binaries that are built (including preprocessors)
are ran using the host *for* building targets. Final target artifacts are
compiled using the target toolchain
2018-01-01 22:34:41 +08:00
Jeremie Dimino 6e64156913 Add target support
* Create targets from findlib toolchains by reading findlib configs
* Define targets inside workspace files
* Set cross compilation targets with -x argument
2018-01-01 22:34:41 +08:00
Jeremie Dimino afb602d7ef Add add_install_prefix function
To control installation prefix
2018-01-01 21:48:25 +08:00
Jeremie Dimino 86dc606fef Add Utils.install_file
Determines the .install depending on the toolchain for x compilation
2018-01-01 21:48:25 +08:00
Jeremie Dimino 5d451e7034 Add cstr_record 2018-01-01 21:48:25 +08:00
Jeremie Dimino e06c060121 Add module to parse findlib config
Necessary to read toolchains
2018-01-01 21:48:25 +08:00
Rudi Grinberg 1a8c328b2d Make is_directory work when dir doesn't exist 2018-01-01 21:48:25 +08:00
Rudi Grinberg 829b85ec44 Add Path.drop_prefix 2018-01-01 21:48:25 +08:00
François Bobot 9ec6b22066
Merge pull request #379 from janestreet/usexp
Replace the S-expression Parser by Usexp
2017-12-22 14:56:22 +01:00
David Allsopp 9d3c0b649c Fix copy# for Microsoft C compiler
Microsoft CL doesn't support #n and requires the more strictly correct
directive #line

Signed-off-by: David Allsopp <david.allsopp@metastack.com>
2017-12-22 08:16:09 +01:00
Jeremie Dimino 3e525d8eec Vendored usexp and switch to it 2017-12-21 13:13:47 +00:00
Rudi Grinberg bbb6108924 Fix Path.descendent
It was broken for local paths with equal length
2017-12-20 09:06:12 +00:00
Rudi Grinberg 2f8d95cdeb
Merge pull request #373 from rgrinberg/reason-preprocess-fix
Reason preprocess fix
2017-12-18 23:25:10 +08:00
Jeremie Dimino 18d8cb847d Fix the test added in the previous commit 2017-12-18 13:30:49 +00:00
Rudi Grinberg 4570020ce7 Fix reason preprocessing
and previously failed test
2017-12-18 20:52:52 +08:00
Anton Bachin eb05f4f643 Place module list on its own line
The markup emitted by Jbuilder treated module lists as inline elements
that can appear inside a line. However, neither ocamldoc nor odoc render
module lists as inline elements. They are instead block elements, that
are laid out vertically, like lists or paragraphs. Correspondingly, odoc
now rejects inline module list markup.

A side effect of the (rejected) misconception is that there was a stray
period appearing on its own line in every module list generated by
Jbuilder. This is now fixed.
2017-12-16 14:27:36 -06:00
Anton Bachin 0aa6faa145 odoc: don't generate raw HTML and level 1 headings
This page generation code really should be moved to odoc, however.
2017-12-16 14:07:51 -06:00
Xavier Clerc 2be876cb49 Availability of "num" depends on the OCaml version (#358) 2017-12-11 13:05:20 +00:00
Rudi Grinberg a0c2ed942b
Merge pull request #343 from rgrinberg/fix-ppx-recompile
Fix incremental compilation with ppx's
2017-12-02 21:27:04 +08:00
François Bobot 13fed1f1ce
Merge pull request #339 from rgrinberg/fix-jbuilder-exec-utop
Fix jbuilder exec from sub dirs & utop
2017-12-01 13:41:21 +01: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
Rudi Grinberg 6f498db212 Fix incremental compilation with ppx's
Same fix as 6a3c51c358 but also for ppx's
2017-11-27 21:14:24 +08:00
Rudi Grinberg 7a30bbf8ea Use absolute paths for lib paths in utop
This makes $ jbuilder utop usable from sub directories
2017-11-25 23:25:26 +08:00
Christophe Troestler d8a39b66de Move escape_double_quote to Import.String & refactor 2017-11-24 16:08:34 +01:00
Christophe Troestler 1e280e56d1 Escape double quotes for META field values
Fixes https://github.com/janestreet/jbuilder/issues/331
2017-11-23 19:25:45 +01:00
Rudi Grinberg 5103035bef
Pass context when executing actions (#329) 2017-11-14 23:36:12 +08:00
Rudi Grinberg 0c2228e7bc
Refactor jbuilder exec path handling (#327)
There's no need for runcwd as initial_cwd is already defined somewhere. Add
Filename.analyze_program_name function to make the clearer.
2017-11-14 15:19:58 +08:00
Spiros Eliopoulos 7383b0b006 docs: add some docstrings in various places (#252)
* docs: update some documentation in the Build module

* docs: document what [Scope.resolve] does

* docs: add a toplevel docstring to the Alias module

* docs: document (or not) the bootstrap function

* docs: lightly document the bootstrap module

* fix ignore comment
2017-11-09 20:41:52 +08:00
Rudi Grinberg ea7fa8541b
Fix off by 1 error in String.drop_prefix (#319) 2017-11-09 12:45:53 +08:00
Rudi Grinberg 5fa8f6eb26
Add "S ." to .merlin (#284) 2017-11-07 22:16:36 +08:00
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
Rudi Grinberg 9c8ecc9fbc
Improve jbuilder exec (#286)
* Improve jbuilder exec

When the path passed contianed to exec contains a '/', it will be interpreted
relative to the path of a build context (default context when absent)

* Update man page of jbuilder exec

* Add String.drop_prefix

* Make jbuilder exec understand relative/absolute paths

jbuilder exec will now interpret absolute paths as relative to the specified
build context. While relative paths will now be intepreted relative to the cwd
appended to the specified build context.

* Fix jbuilder exec /absolute/path

When the path provided to jbuilder exec is absolute, we should ignore the build
context for looking up the binary.

* Fix exec when ran outside of root

Previously, a call like $ jbuilder exec ./xxx --root=p would raise
an exception. Now ./xxx will be intepreterd relative to --root.

* Fix relative paths when jbuilder is ran outside of --root

* Simplify documentation for jbuilder exec
2017-11-07 21:41:09 +08:00
Rudi Grinberg 8718fdac88
Merge pull request #306 from MiloDavis/doc-non-public
Build documentation for non-public libraries
2017-11-07 20:54:00 +08:00
xclerc e28cc8d070 Fix regression introduced by PR303. 2017-11-06 09:30:50 +01:00
Milo Davis f645f0c030 Build documentation for non-public libraries 2017-11-03 16:12:06 +01:00
Xavier Clerc 70946320fd Use `=` rather than `String.equal` for better compatibility. 2017-11-03 13:49:47 +00:00
Xavier Clerc 9b04e7e931 Look for architecture size in the output of `ocamlc -config` first. 2017-11-03 13:44:41 +00:00
Xavier Clerc 72a3cb008f Look for `ARCH_SIXTYFOUR` in both `config.h` and `m.h`. 2017-11-02 12:31:14 +00:00
François Bobot 2bd8fe49b4 Revert "RFC update odoc rules" 2017-10-24 13:58:34 +02:00
François Bobot e88b94b4f5 Merge pull request #290 from janestreet/new-odoc
Compelte and update odoc comments
2017-10-24 13:58:10 +02:00
Thomas Refis 765302461d odoc: handle .mld files 2017-10-24 11:51:28 +01:00
Rudi Grinberg aaafdf02fe Merge pull request #287 from rgrinberg/duplicate-public-names
Report duplicate names with a good error message
2017-10-22 19:17:11 +08:00
Zach Ploskey 3c9de3a9d1 Fix depending spelling and add comma in error message 2017-10-19 23:28:14 -07:00
Rudi Grinberg bfc83d71d7 Report duplicate names with a good error message
Indicate which name is duplicated in which jbuild files
2017-10-20 11:08:42 +08:00
Rudi Grinberg bfb241cce0 add pretty printers to Alias
Useful for debugging
2017-10-19 08:31:52 +08:00
Rudi Grinberg 02a4c59654 Remove mention of recursive aliases from error message
all aliases are non recursive
2017-10-19 08:17:34 +08:00
Jeremie Dimino ed55ca9efe Fix interpretation of (alias ...) and (alias_rec ...) 2017-10-14 10:37:36 +08:00
Jeremie Dimino b69a6432dd Add (alias_rec ...) in dependency specification
(alias_rec XXX) means the same as @XXX on the command line.
2017-10-14 10:37:36 +08:00
Jeremie Dimino b281554009 Get rid of recursive aliases 2017-10-14 10:37:36 +08:00
Jeremie Dimino 30a914278e All aliases on the command line are recursive
Calling 'jbuilder build @path/x' always request the alias `x` in
`path` and all its descendant.

To implement that, change the build system interface to take an
arbitrary request as argument.
2017-10-14 10:37:36 +08:00
Jeremie Dimino 3e13492b7a Get rid of Alias.tree 2017-10-14 10:37:36 +08:00
Jeremie Dimino 7a5698c7b1 Interpret jbuild-ignore files sooner
Interpret then while loading the file tree.
2017-10-14 10:37:36 +08:00
Rudi Grinberg c28ee8fa10 Merge pull request #280 from aantron/odoc-index-libraries-not-packages
Docs: list all libraries in top-level index
2017-10-11 21:31:15 -04:00
Rudi Grinberg 00b62c4d5a Merge pull request #282 from aantron/odoc-highest-up-links
Fix "Up" links to top-level index
2017-10-11 21:22:17 -04:00
Rudi Grinberg 9326c412d9 Merge pull request #281 from aantron/nits
Fix typo
2017-10-11 15:41:34 -04:00
Anton Bachin 9e3b64af86 Fix "Up" links to top-level index
When the docs are viewed locally, the URL ".." causes the browser to
display a listing of the parent directory, instead of "../index.html".
The "../index.html" interpretation is only provided by web servers.
2017-10-11 10:24:02 -05:00
Anton Bachin 48d9be2d00 Docs: list all libraries in top-level index
This commit changes the top-level index of the docs generated by
Jbuilder so that the index lists all installed libraries (Findlib
library packages generated by Jbuilder), rather than only opam packages.
For example, current Markup.ml installs libraries

  markup
  markup.lwt
  markup.lwt.unix

With this change, all these libraries are listed in the index. Before
this change, only markup was listed, because it happened to coincide
with the name of the opam package that contains all three libraries.

Not listing the extra libraries makes them undiscoverable, as they can
only be reached by direct URL.
2017-10-11 09:39:46 -05:00
Anton Bachin 21a5296994 Fix typo 2017-10-11 07:32:41 -05:00
Rudi Grinberg 7c6f3e6dd6 support ${..} in :include 2017-10-10 15:53:39 -04:00
Rudi Grinberg 001daa62d0 Merge pull request #232 from rgrinberg/string-with-vars-bounds
Fix out of bounds access when tokenising String_with_vars
2017-10-10 15:42:05 -04:00
Jeremie Dimino 5de73ca740 Add support for locks in rules
This is to allow users define more complicated tests without having
to resort to -j1.
2017-09-29 12:20:08 +01:00
Jeremie Dimino 30076e7d79 Fix #264 2017-09-29 12:01:47 +01:00
Jeremie Dimino 50cbbe2ac5 Add ${path-no-dep:...}
To be able to resolve path names that are not dependencies.
2017-09-29 11:55:23 +01:00
Jeremie Dimino 3fb1915033 Fix #262
Use the absolute path when evaluating a jbuild file in OCaml syntax.
2017-09-22 11:20:13 +01:00
Jeremie Dimino e37e630da5 Allow to use utop when the library has C stubs 2017-09-22 02:22:46 +01:00
Jeremie Dimino b965c66af5 Avoid generating useless .utop/.merlin files 2017-09-22 02:16:26 +01:00
Jeremie Dimino dd3eaf2695 Fix quoting of generated strings in utop.ml
It was broken in Windows
2017-09-22 02:04:57 +01:00
Jeremie Dimino 157e4d6548 Print "Entering directory '...'" when necessary
When the root of the workspace is not the current directory, print:

  Entering directory '<absolute path to root>'

This way editors such as emacs or vim knows how to interpret filenames
reported by the compiler.

Fixes #138
2017-09-22 01:59:45 +01:00
Jeremie Dimino b2e7720b41 Interpret empty jbuild-workspace files as default configuration
If a workspace file is empty, interpret it the same as if it contained:

  (context default)

As discussed in #234
2017-09-22 01:59:45 +01:00
Jeremie Dimino af5208416f Simplify overrides in the bootstrap path
- vendored libraries are replaced by files in `vendor/boot`
- files named `XXX.boot.EXT` replace their `XXX.EXT` equivalent

For instance, to build boot.exe, we use `src/glob_lexer.boot.ml`
rather than `src/glob_lexer.ml` (which would be generated from
`src/glob_lexer.mll`).
2017-09-22 01:52:04 +01:00
François Bobot cecf0a2aaf Add (copy_files <glob>) stanza (#35)
Add (copy_files <glob>) and (copy_files# <glob>) stanzas. These
stanzas setup rules for copying files from a sub-directory to the
current directory.

This provides a reasonable way to support multi-directory
library/executables in jbuilder.
2017-09-10 02:31:07 +01:00
Jeremie Dimino d55c807d51 Allow to localize the error reported by Path.relative/of_string
Since these are often used to parse user input.
2017-09-10 01:26:06 +01:00
Rudi Grinberg 1da474bc4a Merge branch 'pr/238' 2017-09-05 20:41:19 -04:00
David Allsopp 6a3c51c358 Ensure executables also depend on archive files
Signed-off-by: David Allsopp <david.allsopp@metastack.com>
2017-09-05 19:53:08 -04:00
Rudi Grinberg a7067f5aa8 Merge pull request #224 from samoht/doc-index
Add a toplevel html index to the docs
2017-08-27 15:55:50 -04:00
David Allsopp da240468d0 Ensure .cmxs depends on archive file
Signed-off-by: David Allsopp <david.allsopp@metastack.com>
2017-08-26 15:06:32 +01:00
David Allsopp 1053d4e65a Ensure .cmxa files depend on object files
Signed-off-by: David Allsopp <david.allsopp@metastack.com>
2017-08-26 15:05:54 +01:00
David Allsopp 77c79ebff8 Ensure executables depend on object files
Previously, in Mode.Native, executables depended on .cmx files only.
This was fine when changes were detected by timestamp, but it is
possible to semantically alter an .ml such that only the .o/.obj file
alters. In this situation, Jbuilder would rebuild the .cmx file, but not
relink the executable.

Fixes #237.

Signed-off-by: David Allsopp <david.allsopp@metastack.com>
2017-08-26 14:01:20 +01:00
David Allsopp 9180f88dc3 Add Path.change_extension
Signed-off-by: David Allsopp <david.allsopp@metastack.com>
2017-08-26 14:01:12 +01:00
David Allsopp 2d100b1150 Improve error handling for (:include )
The form (:include $(SCOPE_ROOT)\foo) requires quoting, but the error
message was cryptic ("Error: undefined symbol include").

Signed-off-by: David Allsopp <david.allsopp@metastack.com>
2017-08-25 11:12:15 +01:00
Rudi Grinberg 95844035aa Fix out of bounds access when tokenising String_with_vars
When the current character is '$' we peek at the next character. But we first
need to make sure that there is a next character.
2017-08-25 01:08:05 -04:00
Thomas Gazagnaire 71952a0983 Add a toplevel html index to the docs 2017-08-22 11:12:33 +02:00
Jeremie Dimino 297e82061e Update_file --> Write_file
The difference is not meaningful anymore. Also expose Write_file as
write-file.
2017-08-17 15:13:11 +01:00
Jeremie Dimino 7a8fa99f5a Remove Create_file action
Makes no sense now that we use digests rather than timestamps
2017-08-17 15:13:11 +01:00
Jeremie Dimino 508c90201f Replace timestamp checks by file contents checks 2017-08-17 15:13:11 +01:00
Jérémie Dimino ca81d1704e Get rid of the deprecated-ppx-method sub-package (#222)
Instead, inline the fields it contains into the parent package
2017-08-17 12:41:49 +01:00
Jérémie Dimino 6bed864057 Better behavior when the targets of a rule already exist in the source tree (#218)
Warn when a file is both present in the source tree and generated by
a rule. Before, jbuilder would silently ignore the rule. One now has
to add a field `(fallback)` to custom rules to keep the current
behavior.
2017-08-15 11:16:11 +01:00
Rudi Grinberg 188134775f Make warning 31 non fatal for utop (#211)
This allows jbuilder to create toplevels with conflicting module names. Such as
ExtLib's and Camomiles' UChar for example.
2017-08-09 10:04:01 +01:00
Jeremie Dimino 06b47a73f6 Do not accept per_file anymore
It was renamed per_module and it is planned to reuse per_file for
another purpose.
2017-08-04 09:24:02 +01:00
Rudi Grinberg b668d9189f Add a utop subcommand (#183)
Add a utop subcommand that build and execute a utop where all the libraries defined in the current directory are immediately available for interactive use.
2017-08-04 08:59:35 +01:00
David Allsopp be4b5fa454 Extend (:include ) form to library_flags
library_flags already included variable expansion.
2017-08-03 17:28:32 +01: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 83bba5af61 Use an AST for Ordered_set_lang 2017-08-03 17:28:32 +01:00
David Allsopp 13b0eb9f2b Convert link_flags to the ordered set DSL 2017-08-03 17:28:32 +01:00
David Allsopp ec29651cff Extend (:include ) form to js_of_ocaml flags 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
David Allsopp 712981d847 Make Ocaml_flags.t abstract 2017-08-03 17:28:32 +01:00
Jérémie Dimino ea377efbbb Use absolute paths for ppx drivers in .merlin files (#201)
Fixes #196 and #199
2017-07-28 16:49:45 +01:00
aalekseyev b5f0b85e56 Allow digits and apostrophes in library/module names (#206)
* Allow digits in library/module names

Also include the malformed module name in the error message so it's more clear what it's complaining about.

* Update jbuild.ml
2017-07-28 08:40:09 +01:00
Jeremie Dimino cfd43d5282 Simplify a bit the rules for installation of library files 2017-07-25 17:07:24 +01:00
François Bobot b6498d11c2 Consider that a failing opam is an absent opam 2017-07-25 16:44:14 +01:00
François Bobot 747cf220c6 Install by specifying libdir for opam-installer
- change default findlib directory (ocamlc -where)
2017-07-25 16:44:14 +01:00
Jérémie Dimino c7e67d49b8 Use the full path of archives when linking (#197)
Instead of passing `-I <path> file.cma` to the compiler, pass `-I
<path> <path>/file.cma`.

Fixes #118 and #177. Using the fill path should also be slightly
faster as the compiler won't have to do the lookup through all include
paths. The only drawback is that it makes linking command line
slightly longer.
2017-07-25 14:08:39 +01:00
Marcello Seri 8bace6bc3b Preserve quotes on certain flags that contain spaces (#200)
This is useful, for example, if one needs to pass specific  flags
by hand (due to the need to use old libraries for example).  Fixes
#198

Signed-off-by: Marcello Seri <marcello.seri@citrix.com>
2017-07-25 11:38:47 +01:00
Jeremie Dimino 6e48e70a74 Fix the quoting of FLG lines in .merlin files 2017-07-24 15:32:18 +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
Jeremie Dimino cec825bf18 memoize one more computation in odoc 2017-07-21 15:43:44 +01:00
Jeremie Dimino 45e04010c5 style 2017-07-19 15:35:05 +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 0d1a3b7378 Change the name of intermediate files for reason projects
before:

- foo.re  --> foo.re.ml
- foo.rei --> foo.rei.mli

after:

- foo.re  --> foo.re.ml
- foo.rei --> foo.re.mli

When compiling foo.re.ml with ocamlc or ocamlopt, the compiler checks
for the existence of foo.re.mli to determine whether the file has an
explicit interface or not. With the previous naming scheme, the
compiler always thought that there was no interface and was
re-creating the .cmi, which caused a race condition.

Fixes #184
2017-07-18 16:16:00 +01:00
Jeremie Dimino 71c748860d Fix #190 2017-07-17 12:49:59 +01:00
François Bobot 9935c838b3 Use lowercase_ascii 2017-07-07 12:27:31 +02:00
Rudi Grinberg 97a855524c Remove duplicate check for merlin context (#175)
This check is done in add_rules and dot_merlin. Only of those checks is
necessary. The check in dot_merlin is removed.
2017-06-30 12:03:11 +01:00
Jeremie Dimino aed36a76dd Quote a few paths in error messages when necessary 2017-06-26 13:33:01 +01:00
François Bobot 52afe84c83 Fix some warning 50 for 4.02.3 (#161)
Warning 50: unattached documentation comment (ignored)
2017-06-26 10:28:37 +01:00
Jeremie Dimino c0200c3baa Add Alias.of_file and Alias.name_of_file 2017-06-26 09:53:37 +01:00
Jeremie Dimino bf5f366e96 Typo 2017-06-15 17:39:25 +01:00
Jeremie Dimino 34df3d5fd9 Fix check for dependency on the lib interface module 2017-06-15 14:17:54 +01:00
David Allsopp 574866af2e Correct detected value for ocaml on Windows 2017-06-15 12:14:56 +02:00
David Allsopp d809a3362a Prevent Future.Temp.destroy from failing 2017-06-15 12:14:56 +02:00
David Allsopp bf3fa0831d Add Sys.force_remove
Sys.force_remove is Sys.remove, except on Windows, where it will remove
the "read-only" attribute and re-try a failed Sys.remove
2017-06-15 12:14:56 +02:00
Jeremie Dimino daeb40b087 Add SCOPE_ROOT
While analysing packages using jbuilder, I found that some packages
use ${ROOT} to refer to the root of the project. However, this doesn't
work as ${ROOT} depends on the workspace configuration.

Add ${SCOPE_ROOT} to make this easier for projects with a lot of
nested sub-directories.
2017-06-09 12:45:05 +01:00
Jeremie Dimino 572774490a Report an error for invalid dependency between modules in wrapped libraries
Report an error when in a wrapped library, a module that is not the
toplevel module depends on the toplevel module. This doesn't make as
such a module would in theory be inaccessible from the outside

If this causes compilation failures of released packages, we'll need
to turn this into a warning.
2017-06-09 12:45:05 +01:00
Jeremie Dimino b63718ada0 Fix error message about too many opam files 2017-06-08 14:11:31 +01:00
Jeremie Dimino 0a3abd96a1 Fix expansion of ROOT 2017-06-08 11:42:14 +01:00
Jeremie Dimino eb7b5e2be4 Help users to not use non-future proof features in jbuild files 2017-06-08 11:33:59 +01:00
Jeremie Dimino c2f04a4963 Refactor action processing and avoid extra work 2017-06-08 11:26:21 +01:00
Jeremie Dimino 43c2710c43 Fix late expansion or ${ROOT} 2017-06-08 10:56:59 +01:00
Jeremie Dimino 06ab34981c Capture locations of string-with-vars generated inside jbuilder 2017-06-08 10:54:46 +01:00
Jeremie Dimino e4300e7b51 Make (run prog ...) behave the same as (run ${bin:prog} ...)
This just seems like a better default
2017-06-08 10:37:25 +01:00
Jeremie Dimino 5307a92ddc Do not allow (chdir ...) with dynamic directories
For instance (chdir ${read:foo} ...) is not allowed. This doesn't seem
really useful since we couldn't express the targets anyway and
supporting it complicate the code.
2017-06-08 10:03:11 +01:00
Jérémie Dimino 2e2a707d4b Automatically install executable with extension `.exe` on Windows (#123)
- Automatically add exe extension when installing executables
- Look for local binaries with .exe extension on Windows
2017-06-08 09:59:43 +01:00
David Allsopp 843e5d864d Minor typo in ml_of_mli message 2017-06-07 14:15:30 +01:00
Jeremie Dimino 63ef644766 Fix #129 2017-06-07 11:15:15 +01:00
Jeremie Dimino 87f009a881 f --> map_cclibs + make the code build with --dev 2017-06-07 10:52:06 +01:00
David Allsopp bb527b1e38 Further MSVC C library import hacking (#119) (#127) 2017-06-07 10:49:15 +01:00
Jeremie Dimino 0e4f2dcd15 Handle dynamic targets in user actions 2017-06-06 15:42:10 +01:00
Jeremie Dimino 6a8a440c63 Wrap c_library_flags with -ldopt for ocamlmklib with msvc
This should fix #119
2017-06-06 10:55:38 +01:00
Jeremie Dimino e51002d1b7 Restrict what one can do with the OCaml syntax
Until we decide in what direction it should go.
2017-06-06 10:23:22 +01:00
Jeremie Dimino 172467a7b6 Fix expansion of ${@} 2017-06-05 16:33:09 +01:00
Jeremie Dimino e5f27b8ba8 Small improvement 2017-06-05 16:33:09 +01:00
Jeremie Dimino 2b70e1930f Disable all warnings in ml files for mli only modules 2017-06-05 13:43:08 +01:00
Jeremie Dimino 11985e3948 Update the code to talk about scopes 2017-06-05 13:42:13 +01:00
Jeremie Dimino a392b59fcd copy-and-add-line-directive --> copy# 2017-06-05 12:11:39 +01:00
David Allsopp 7ec081419c Don't pass -g to cl; it doesn't like it! (#120)
The Microsoft C compiler doesn't recognise -g. For now, easier just not
to compile with any debugging information on MSVC.

Signed-off-by: David Allsopp <david.allsopp@metastack.com>
2017-06-05 11:40:27 +01:00
Jeremie Dimino f713c7ab98 Temporarily remove (foreach ...)
Currently (foreach ...) is too general and variables can be used
anywhere inside S-expressions.

We need to sort out how we are going to handle meta-programming first
as this might impact how we implement (foreach ...).

In any case, it's better not to have it in 1.0.0.
2017-06-02 18:26:13 +01:00
Jeremie Dimino a7446ec7d3 per_file --> per_module 2017-06-02 17:58:20 +01:00
Jeremie Dimino 1a8fc057f4 Remove a few unused things 2017-06-02 16:27:05 +01:00
Jeremie Dimino d8be1aa894 Add jbuild.mli 2017-06-02 15:00:50 +01:00
Jeremie Dimino b74544919a jbuild_types.ml --> jbuild.ml 2017-06-02 14:32:05 +01:00
Jeremie Dimino fd76d7b9a9 Remove (ml_of_mli ...) and (re_of_rei ...)
Instead make jbuilder print the rule to do the same in the warning
message. The rule is not that big. Also add a note about mli only
modules in the "Known issues" section of the README.

This avoids polluting the jbuild specification and is still a
reasonable solution until someone implements proper support for mli
only modules in the compiler.
2017-06-02 13:17:28 +01:00
Jeremie Dimino 29e9b37c61 Implement re_of_rei 2017-06-01 17:07:06 +01:00
Jeremie Dimino 5e06daa5b2 Rename (do ...) to (rule ...) 2017-06-01 16:53:55 +01:00
Jeremie Dimino 52df4a4af3 remove unused code 2017-05-31 17:19:43 +01:00
Jeremie Dimino 1cebba4bd7 Be slightly more clever when scanning the stanzas to generate install files
Instead of doing many List.filter, do one String_map.of_alist_multi
2017-05-31 17:08:32 +01:00
Jeremie Dimino a52c8a4cd7 Add location to a few errors 2017-05-31 16:49:54 +01:00
Jeremie Dimino ad817e7a34 Fixes 2017-05-31 11:24:27 +01:00
Jeremie Dimino 1c8ffaa3aa Check that no targets are generated outside of the current dir 2017-05-31 10:34:17 +01:00
Jeremie Dimino 373e6c2524 Allow ${...:...} for in (do ...) and add more checks
Check that targets written by the user are a superset of inferred
targets.
2017-05-31 10:15:32 +01:00
Jeremie Dimino 81e6ebd09b Simplify inference 2017-05-30 17:39:23 +01:00
Jeremie Dimino acd1e3e571 Do not fail immediately when expanding actions and a program isn't found 2017-05-30 17:35:49 +01:00
Jeremie Dimino 4e7cb253e1 Add support for reading files from actions
- ${read:<filename>}        -> expand to the contents of the file
- ${read-lines:<filename>}  -> expand to the list of lines in the file
- ${read-strings:<filename> -> expand to the list of lines in the file,
  unescaped using OCaml escaping rules

Generalize ${!...} form
2017-05-30 17:02:45 +01:00
Jeremie Dimino a8a43e4b22 Add ${!^} and ${!@} and document them 2017-05-29 19:12:37 +01:00
Jeremie Dimino 116769724f Allow to use ${^} in actions in conjunction with (glob_files ...) and (file_recursively_in ...) 2017-05-29 18:53:54 +01:00
Thomas Refis a5af8efa0a Revert "Only build the toplevel module for wrapped libraries with odoc"
odoc is not ready for that as it turns out.

This reverts commit 5bd391e224.
2017-05-29 15:49:29 +01:00
Jeremie Dimino 5bd391e224 Only build the toplevel module for wrapped libraries with odoc 2017-05-29 14:52:20 +01:00
Jeremie Dimino 1d3341ed28 Add a (mkdir ...) action 2017-05-29 14:51:46 +01:00
Jeremie Dimino 85ae1c75e4 Hack for latest odoc 2017-05-29 14:28:07 +01:00
Jeremie Dimino 65150b4166 Add -debug-backtrace 2017-05-29 14:18:07 +01:00
Jeremie Dimino 9f8803af67 Add (modes ...) for executables 2017-05-29 14:18:07 +01:00
Thomas Refis b52d778d4c Fix .merlin generation: add all workspaces projects to merlin's source path
(otherwise "locate" doesn't work)
2017-05-29 13:22:24 +01:00
Jeremie Dimino c73b1f1fe3 Add a --no-buffer option
Following #107
2017-05-29 10:57:04 +01:00
Jeremie Dimino 5372ebdea1 Remove jane_street version
It's not used. We'll re-add it if really necessary.
2017-05-29 09:54:56 +01:00
Jérémie Dimino f1ebc0ed7d Add (mli-to-ml ...) as a hack for mli only modules 2017-05-29 07:51:52 +01:00
Jérémie Dimino c6cc8204bf Add (foreach ...) form 2017-05-29 07:51:52 +01:00
Jérémie Dimino 1e41feaf8a Add simplified version of rules 2017-05-29 07:51:52 +01:00
Jérémie Dimino 7c9dcbf284 Added deps/targets inference 2017-05-29 07:51:52 +01:00
Jérémie Dimino b9c9b19f0a Refactoring 2017-05-29 07:51:52 +01:00
Jérémie Dimino 73a4cef9f8 Move the context out of Action.t
And add it to the rule. It is never dynamic, so it is simpler this
way, we just set it in Super_context.add_rule.
2017-05-29 07:51:52 +01:00
Jérémie Dimino 7f0a2d7e12 Remove unused function 2017-05-29 07:51:52 +01:00
Jeremie Dimino 500f224098 Delete old odoc artifacts before running odoc 2017-05-26 18:34:49 +01:00
Jeremie Dimino 37d7131a11 Simplify hack for not deleting odoc files 2017-05-26 18:34:49 +01:00
Jeremie Dimino 35ba1bc0f1 Remove the dir field in Action.t
Simplify things for Build.progn
2017-05-26 18:34:49 +01:00
Jeremie Dimino 0a1f4f5658 Replace Build.and_... by Build.progn 2017-05-26 18:34:49 +01:00
Jeremie Dimino 23f00abf18 Update odoc rules 2017-05-26 18:34:49 +01:00
Jeremie Dimino d9165fc53e Memoize a computation in odoc.ml 2017-05-26 18:34:49 +01:00
Jeremie Dimino 76d637fa74 Fix dependencies 2017-05-26 18:34:49 +01:00
Jeremie Dimino 43f413a59a Support library indexes 2017-05-26 18:34:49 +01:00
Jeremie Dimino 7f8f4b23ee Start of odoc rules 2017-05-26 18:34:49 +01:00
Jeremie Dimino 60d09f7e27 Print background process failures when exiting 2017-05-26 17:30:34 +01:00
Jeremie Dimino 550a8d8f57 Fix #101 2017-05-26 17:23:49 +01:00
Jeremie Dimino 9f9660b91a Remove the global ppx_drivers variable in super_context.ml
Fix #100
2017-05-26 14:25:51 +01:00
Jeremie Dimino 1de95b9d81 Print the contents of OCAMLPARAM in the log 2017-05-26 14:07:21 +01:00
Jeremie Dimino f3cdbfa66f Fix Path.rm_rf
It didn't delete the toplevel directory
2017-05-26 11:37:10 +01:00
Richard Davison 91d03de221 Add clean subcommand (#89) 2017-05-26 11:32:32 +01:00
Jeremie Dimino 2e7140dfef Fix #86 2017-05-22 10:37:42 +01:00
Jeremie Dimino d01270757f Remove ocamllex/ocamlyacc from the context
They were unused and this prevent jbuilder to be used with
opam-cross-windows.

Fixes #75
2017-05-19 15:24:55 +01:00
Jeremie Dimino 4dd0de1723 Fix #72 2017-05-19 14:16:00 +01:00
Jeremie Dimino c6dac87ee9 Ignore all directories starting with '.' pr '_' 2017-05-19 12:36:06 +01:00
Jérémie Dimino 0a2157919c Split more long lines in makefiles 2017-05-19 08:27:21 +01:00
Jérémie Dimino 42cb733c6a Remove --debug-{actions,rules}
They are superseeded by 'jbuilder rules'
2017-05-19 08:27:21 +01:00
Jérémie Dimino 00ddd7f7a2 Improve formatting 2017-05-19 08:27:21 +01:00
Jérémie Dimino 0a98963293 fix 2017-05-19 08:27:21 +01:00
Jérémie Dimino fe30935fa2 Rename 'extract-makefile' to 'rules' 2017-05-19 08:27:21 +01:00
Jeremie Dimino d219020b2f added jbuilder extract-makefile 2017-05-18 19:05:01 +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 9df1bad58c Change an error into a warning
Otherwise this breaks the build of atd.
2017-05-18 16:50:53 +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 08af136c97 Fix another stupid bug 2017-05-17 15:24:09 +01:00
Jeremie Dimino 80792e4e74 Handle the alternative findlib directory layout
Some packages still use this, such as ocp-blah and llvm
2017-05-17 15:12:11 +01:00
Jeremie Dimino b2a9d6dc51 Add: jbuilder installed-libraries --not-available 2017-05-17 14:56:53 +01:00
Jeremie Dimino 1814fc4299 Much better for findlib packages not found 2017-05-17 14:56:53 +01:00
Jeremie Dimino 4621e554d2 Really ignore invalid findlib packages 2017-05-16 15:46:53 +01:00
Jeremie Dimino 60ad83c522 Improve opam parsing errors & use opam-file-format to extract the version 2017-05-16 14:47:52 +01:00
Jeremie Dimino f2a857f406 Fix Super_context.expand_and_eval_set
It declared its own dependencies as action dependencies rather than
rule dependencies
2017-05-16 12:19:18 +01:00
Jeremie Dimino bd62dc8306 Merge build_interpret functions 2017-05-15 15:15:20 +01:00
Jeremie Dimino 9a5bb0ca1f Compute dynamic dependencies correctly for memoized arrows 2017-05-15 15:09:56 +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
Rudi Grinberg 5adfe2d668 Ignore local switch directory (#77)
This makes jbuilder usable for building projects that use a local switch
2017-05-15 10:30:02 +01:00
Jérémie Dimino be3593e449 Distinguish rule dependencies from action dependencies 2017-05-15 09:37:46 +01:00
Jérémie Dimino b7ad08df84 Make targets explicit 2017-05-15 09:37:46 +01:00
Jérémie Dimino b6b417e640 simplification 2017-05-15 09:37:46 +01:00
Jérémie Dimino e73fd90b65 Get rid of Vfile
replace it by just memoize
2017-05-15 09:37:46 +01:00
Jérémie Dimino f5192122f8 add Build.memoize 2017-05-15 09:37:46 +01:00
Jeremie Dimino dd79bdd8d1 Suffix all alias files, to avoid clashes with doc 2017-05-15 09:37:46 +01:00
Jeremie Dimino 87c958f2e0 Add Build.if_file_exists 2017-05-15 09:37:46 +01:00
hhugo c880cd3e2d disable warning 60 with --dev 2017-05-14 13:06:22 +01:00
Jeremie Dimino 4c9f894fe4 fix stupid bug 2017-05-10 16:44:01 +01:00
Jeremie Dimino 76db4d5641 Use OCAML_COLOR and stop using OCAMLPARAM when possible 2017-05-10 16:31:44 +01:00
Jeremie Dimino b514644f9b Revert "Add support for hooks"
This reverts commit c937dc9183.
2017-05-09 15:11:09 +01:00
Jérémie Dimino c937dc9183 Add support for hooks 2017-05-09 08:18:10 +01:00
Jeremie Dimino add2a063c0 Detect the package name as topkg-jbuilder does 2017-05-08 16:56:21 +01:00
Jeremie Dimino 221baefb81 Make subst add the version to the opam file 2017-05-08 16:56:21 +01:00
Jeremie Dimino 61f0f8fd0e Fix bootstrap 2017-05-08 16:56:21 +01:00
Jeremie Dimino 6d0c8198eb Substitute watermarks for jbuilder itself 2017-05-08 16:56:21 +01:00
Jeremie Dimino 87df38d1f6 Fix call to git describe 2017-05-08 16:56:21 +01:00
Jeremie Dimino dce491e661 Add a subst command for watermarking files 2017-05-08 16:56:21 +01:00
Jeremie Dimino 4130bc2f63 Add support for ${version:<package>} 2017-05-05 12:26:56 +01:00
Jeremie Dimino ef6be544a3 Keep the package context after parsing 2017-05-05 11:21:46 +01:00
Jeremie Dimino fbe0810156 Improve location of errors for mispelled package in jbuild files 2017-05-05 10:59:07 +01:00
Jeremie Dimino f017e810d8 Remove some dead code
vjs is mostly unused now given that Jane Street jbuild files are
automatically rewritten. We keep the Vjs version though, just in case.
2017-05-02 13:34:52 +01:00
Jeremie Dimino b73e672cad Move js_of_ocaml to Buildable 2017-05-02 13:30:58 +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
Rudi Grinberg afce8c7f4f Specify package for aliases
Useful for running tests for a specific package
2017-05-02 09:57:03 +01:00
Jeremie Dimino 416d4c6ead Move rules for module compilation in their own file 2017-04-28 15:13:43 +01:00
Jeremie Dimino a8c2dcc928 Move expand_and_eval_set to Super_context 2017-04-28 15:01:19 +01:00
Jeremie Dimino 5f270372bf Move Merlin rules to their own file 2017-04-28 14:54:16 +01:00
Jeremie Dimino 3a266c686e Cleanup lib stuff 2017-04-28 14:50:24 +01:00
Jeremie Dimino 130cadf855 Move pp stuff to Super_context.PP 2017-04-28 14:40:33 +01:00
Jeremie Dimino 17ae22295d Move Action_interpret to Super_context 2017-04-28 14:24:02 +01:00
Jeremie Dimino c6080880b3 Move ocamldep stuff to Ocamldep 2017-04-28 14:19:21 +01:00
Jeremie Dimino 6a40b7602c Move Dep_conf_interpret to Super_context 2017-04-28 14:01:47 +01:00
Jeremie Dimino 32c20cc561 Move var expansions to Super_context 2017-04-28 13:53:44 +01:00
Jeremie Dimino c18eabec72 Move a few more things to Utils and document them 2017-04-28 13:26:16 +01:00
Jeremie Dimino 1b6bc01a2d Split out Ocaml_flags 2017-04-28 13:19:33 +01:00
Jeremie Dimino c7add98ea6 Add a new Super_context module
Moved most of the global values computed at the beginning of
Gen_rules.Gen to Super_context.t. This will allow to split
gen_rules.ml into multiple files.
2017-04-28 11:58:41 +01:00
Jeremie Dimino d1d51595d2 Remove overlays for Mode and Cm_kind in Gen_rules 2017-04-28 10:40:09 +01:00
Jeremie Dimino 9498cb7013 Improve the error message for the last commit 2017-04-26 15:10:59 +01:00
Jeremie Dimino 2c124a0221 Detect conflicts between internal and external libraries 2017-04-26 15:04:32 +01:00
Jeremie Dimino 30ef4012e4 use code_errorf in Map.of_alist_exn 2017-04-26 13:41:10 +01:00
Jeremie Dimino 47d62fec04 typo 2017-04-26 13:38:28 +01:00
Jeremie Dimino 89cdd70563 Check for inconsistent (libraries ...) fields
Better fix for for #62
2017-04-26 13:36:52 +01:00
Jeremie Dimino 43572595b4 Detect clauses that are always false in (select ...) forms 2017-04-26 13:21:59 +01:00
Jeremie Dimino 05581ed8bc Don't crash when a dependency is duplicated
Fix #62
2017-04-26 13:00:10 +01:00
Jeremie Dimino 83f686a821 Hint for mistyped targets 2017-04-25 16:22:17 +01:00
Jeremie Dimino ee43c2718f Environment variable names are not case sensitive on Windows 2017-04-24 12:53:18 +01:00
Jeremie Dimino 229e7fa883 A couple of fixes for Windows
- open files in text mode when reading lines
- open files used for redirections with O_SHARE_DELETE
2017-04-21 17:22:41 +01:00
Rudi Grinberg 66f973cd4c Add Reason support (#58)
jbuilder now recognizes .re/.rei files as modules and pass them through refmt
2017-04-20 16:41:16 +01:00
Jeremie Dimino de0f65b4f4 Remove hard-coded knowledge of a a few specific ppx rewriters 2017-04-17 13:48:52 +01:00
Jeremie Dimino 238c22f3b8 Remove hardcoded PORTABLE_INT63 2017-04-17 13:35:42 +01:00
Jeremie Dimino 31922a590f Make sure the action working directory exist 2017-04-17 13:35:05 +01:00
Jeremie Dimino 2f4ec1c281 refactoring 2017-04-17 13:20:21 +01:00
Jeremie Dimino 07871b1190 Add support for ${lib-available:<name>} forms 2017-04-17 12:48:54 +01:00
Jeremie Dimino 72550dc3e0 Add a -p/--for-release-of-packages command line argument
`-p pkgs` is the equivalent of `--root . --only-packages pkgs`
2017-04-10 10:44:49 +01:00
Jeremie Dimino eb68c98f01 remove unused function 2017-04-10 10:10:49 +01:00
Jeremie Dimino d948edbc4c Add a (no_dynlink) field 2017-04-10 10:10:15 +01:00
Jeremie Dimino cc7ea35a14 Split the building of the .so and .a when needed 2017-04-10 10:10:15 +01:00
Jeremie Dimino d8f7d77a75 Don't generate an "exists_if ..." line in META files
This is useless sine the jbuild is auto-generated
2017-04-10 10:10:15 +01:00
Rudi Grinberg 3e3d92c9e5 Add menhir support (#42)
Adds the menhir stanza which desugars into a Rule.t with Support for:
* ocamlyacc like use
* modular parsers with --base
* passing extra flags

Also add tests and documentation.
2017-04-03 16:25:43 +01:00
Jeremie Dimino 4c3036b3cc Don't fail when opam return the same envirnonemt variable several times
Instead, print a warning and take the last bindings.

Fixes #46
2017-03-31 17:45:38 +01:00
Jeremie Dimino 83c1a6f5bd Fix compat with 4.06 2017-03-31 17:31:55 +01:00
Jeremie Dimino a7dbc12bac Sandbox different actions in different directories 2017-03-31 15:29:47 +01:00
Jeremie Dimino ffa1662ce9 Sandbox the build of the alias module with 4.02
To prevent the compiler from reading the cmi of the aliased modules.
2017-03-31 15:15:54 +01:00
Jeremie Dimino b9976773a3 Add support for sandboxing 2017-03-31 15:06:53 +01:00
Jeremie Dimino 21b29b0cb6 Refactor the job printing code
Fix #50
2017-03-31 13:44:53 +01:00
Jeremie Dimino 99b0d94335 Fixed the implementation of Filename.{split_,}ext 2017-03-31 13:34:30 +01:00
Jeremie Dimino d62429455b Add -keep-locs to the dev mode
Related to #44
2017-03-31 11:01:52 +01:00
Jeremie Dimino be75c8a4c9 Use -short-paths by default in dev-mode
Related to #44
2017-03-30 18:29:23 +01:00
Stephen Dolan b5ae1b1f52 Quieter output (#40)
Makes the output quieter by default and add a `--verbose` argument. Print a message when waiting for background jobs to finish only it it takes more than 0.5 seconds.
2017-03-30 17:36:58 +01:00
Jeremie Dimino d5b5322f12 Fix a bug in the interpretation of META files
Before this commit, when there was more than one applicable
assignment, the one with the lowest number of formal predicates was
selected instead of the one with the biggest number of formal predicates
2017-03-29 17:47:17 +01:00
Jeremie Dimino acb54677d4 Ignore test/ and example/ during bootstrap 2017-03-29 16:51:48 +01:00
Jeremie Dimino 1dda1179aa Add some doc in Path 2017-03-28 14:50:04 +01:00
François Bobot 5cca590e34 Don't use color feature for ocaml 4.02.3 2017-03-27 18:31:26 +01:00
François Bobot 2bf15067cb Remove comment for 4.02.3 2017-03-27 18:31:26 +01:00
Jeremie Dimino c48e90e357 Don't pass specific arguments when not using ppx_driver.runner
Fix #37
2017-03-27 14:31:00 +01:00
Jeremie Dimino 8e64aa0990 Lookup bash in the PATH
Closes #36
2017-03-24 11:04:24 +00:00
Jeremie Dimino 37b1125f03 Remove some unused functions 2017-03-23 10:45:09 +00:00
Jeremie Dimino 3ae53de431 Add an "executable" stanza and make it easier to install executables
(executable ...) is easier to use where there is a single executable.

Also add a (package ...) and (public_name <name>)/(public_names
(<names)) to executable/executables stanzas, to make it easier to
install executables.

Closes #33
2017-03-22 15:09:26 +00:00
Jeremie Dimino 48970caca3 Make sure the build of jbuilder doesn't call ocamlfind or opam 2017-03-22 08:19:26 +00:00
Jeremie Dimino 0c6b30efea tweaks for specific ppxs 2017-03-21 17:22:29 +00:00
Jeremie Dimino d2b8acc3b7 refactoring 2017-03-21 17:17:25 +00:00
Jeremie Dimino a1e898af5b Better error when plugins don't call the send function 2017-03-21 14:03:33 +00:00
Jeremie Dimino 9a8483c615 Give ocamlfind precedence over opam
If ocamlfind is present, don't try to call `opam config var lib`. The
previous behavior was breaking Facebook builds.

Also add ocamlfind as an optional dependency, to avoid race conditions
when installing ocamlfind in parallel.
2017-03-21 10:26:36 +00:00