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
b057c40668
Merge branch 'master' into add-classical-ppx-test
2018-05-31 10:43:22 +07:00
Rudi Grinberg
0677c2d79c
Add test for using a dune library with ocamlfind
...
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-30 15:39:58 +07:00
Rudi Grinberg
939341af16
Add test for classical ppx
...
Test that generated META can be used by ocamlfind
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
2018-05-30 14:59:37 +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
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
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
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
b1be607b9b
Reproduce stack trace leaking out to user
2018-05-20 13:14:24 +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
Jeremie Dimino
9d3117d63e
Fix bug exposed by previous commit
2018-05-17 15:48:19 +01:00
Jeremie Dimino
0d27e9f909
Expose a bug in the S-expression record parser
2018-05-17 15:42:40 +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
Rudi Grinberg
a834e6f6ba
Add tests for reach_for_running
2018-05-17 12:56:35 +07: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
58de56ad0d
Remove useless call
2018-05-16 15:19:04 +01:00
Jeremie Dimino
62997d6676
fix
2018-05-16 15:18:36 +01:00
Jeremie Dimino
2cf1631730
Try again
2018-05-16 15:15:45 +01:00
Jeremie Dimino
46479fd083
Try to make tests pass in Travis
2018-05-16 14:40:21 +01:00
Jeremie Dimino
2192a549f4
Use dev/inode to detect loops
2018-05-16 14:23:01 +01:00
Jeremie Dimino
3a2e136e5c
Add a more complex test
2018-05-16 13:54:12 +01:00
Jeremie Dimino
2033b34983
Update tests
...
- remove tests that were creating files outside the test directory
- add tests with cycles longer than 1
2018-05-16 13:12:45 +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
241ec87a2b
Add test for symlinking outside workspace
2018-05-15 19:42:33 +07:00
Rudi Grinberg
c9916f4a76
Add some more test cases for symlinks
2018-05-15 17:33:51 +07:00
Rudi Grinberg
c1f81bef64
Add test for #764
2018-05-15 17:33:27 +07:00
Rudi Grinberg
19825ae012
Merge pull request #751 from rgrinberg/is-in-build-dir-weird-behavior
...
Path.is_in_build_dir test
2018-05-14 17:01:06 +07:00
Rudi Grinberg
4b798c048c
Remove try/with from Path unit tests
2018-05-14 16:48:06 +07:00
Rudi Grinberg
dc3310c3a0
Remove try/with from Path unit tests
2018-05-12 22:31:20 +07:00
Jérémie Dimino
bc19e14b35
Add ignored_subdirs stanza ( #767 )
2018-05-12 15:38:22 +02:00
Rudi Grinberg
33a99884e4
Improve tests of Path.descendant
...
It should test cases where the paths are build dirs
2018-05-12 12:50:43 +07:00
Rudi Grinberg
3a8e4cf54d
Fix off by 1 in Path.is_descendant
2018-05-11 10:30:21 +07:00
Rudi Grinberg
b6851d7cd7
Add tests Path.is_descendant
...
Notabley, Path.is_descendant is broken for some relative paths
2018-05-11 10:24:12 +07:00
Rudi Grinberg
909142cf6c
Add tests for Path.drop_build_context
2018-05-11 09:43:30 +07:00
Rudi Grinberg
f9f15ceacf
Use exceptions over result type in expect test
...
There's no need to hide stack traces since we turned them off
2018-05-11 09:43:27 +07:00
Rudi Grinberg
f4a5413c46
Don't record backtraces
2018-05-11 09:37:31 +07:00
Jeremie Dimino
bffd5407ce
Fix #734
2018-05-10 11:31:39 +01:00
Jeremie Dimino
30d05eb4f1
Add test for #734
2018-05-10 11:31:39 +01:00
Jeremie Dimino
ef7a5519aa
Fix #761
2018-05-10 11:27:56 +01:00
Jeremie Dimino
ba78e05d95
Add a test for #761
2018-05-10 11:27:56 +01:00
Jeremie Dimino
7c1e1923a0
Fix #759
2018-05-09 16:32:35 +01:00
Jeremie Dimino
4ffa88726a
Add a test for #759
2018-05-09 16:21:01 +01:00
Rudi Grinberg
7a1b3954d7
Change path tests not to include line numbers in stack traces
...
Only include exception names
2018-05-09 17:58:12 +07: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
47d54854e4
Safety feature for Path.rm_rf
2018-05-09 17:11:09 +07:00
Rudi Grinberg
08b33331ea
Path.rm_rf test
2018-05-09 17:10:41 +07:00
Rudi Grinberg
5112c23e3f
Merge pull request #746 from rgrinberg/alias0-build-dir
...
Alias0.dir is always in build_dir
2018-05-09 14:50:55 +07:00
Rudi Grinberg
7d17a30a99
Unit tests for current Path.append behavior
2018-05-09 09:14:21 +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
76c1a32da4
Add tests for invalid alias paths
2018-05-09 08:05:57 +07: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
Rudi Grinberg
6ee133b4dd
Tests for insert_after_build_dir_exn
2018-05-08 17:26:14 +07:00
Rudi Grinberg
fadc57040b
Path.absolute tests
2018-05-08 16:50:49 +07:00
Rudi Grinberg
9dcbc4ce53
Add unit tests for Path.relative
2018-05-07 22:46:28 +07:00
Rudi Grinberg
c149043fde
Tests for Path.reach
2018-05-07 22:41:43 +07:00
Jérémie Dimino
4d8ca489be
Add support for environment & build profiles ( #419 )
2018-05-04 16:49:25 +01:00
Jeremie Dimino
adde723702
Update tests
2018-05-04 12:26:26 +01:00
Jeremie Dimino
dabb77eb09
Rename all jbuild.inc files
2018-05-04 12:26:26 +01:00
Jeremie Dimino
dc0a6d4401
Rename all jbuild files
2018-05-04 12:26:26 +01: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
Rudi Grinberg
623ebfc2da
Add expectation test to parsing out of findlib toolchain config
2018-05-01 20:16:19 +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
Rudi Grinberg
575cbce699
Add test showing odoc failure with index.mld
2018-04-29 00:34:53 +07:00
Rudi Grinberg
40631805ef
Multiple private libs requires odoc
2018-04-27 23:30:42 +07:00
Rudi Grinberg
558b372cf0
Add unit tests to target without deps
2018-04-27 21:55:43 +07:00
Rudi Grinberg
f84550b98a
Tag jsoo and utop tests as taking externals
2018-04-27 21:34:48 +07:00
Jérémie Dimino
8796df8a74
Fix flags in output-obj test ( #728 )
2018-04-26 18:47:20 +01:00
Rudi Grinberg
c406a51bb3
Fix github25 tests
2018-04-26 11:46:14 +01:00
Rudi Grinberg
f8c348983e
Skip <4.06.0 for output-obj
2018-04-26 11:46:14 +01:00
Rudi Grinberg
be3840005e
Generate blackbox tests
...
Generate these tests from the listing of directories. This allows us to
effectively mark which tests are not working in certain conditions/platforms.
2018-04-26 11:46:14 +01:00
Rudi Grinberg
7820e29d28
Port Io to use Path.t
2018-04-25 03:25:27 +07:00
Rudi Grinberg
bc2a375e2c
Merge pull request #719 from rgrinberg/path-stdune
...
Move Sexp to Studune
2018-04-24 20:30:52 +07:00
Jeremie Dimino
dfbb609d39
Update output-obj tests
2018-04-24 13:51:57 +01:00
Jeremie Dimino
85f434de2b
Improve path.mlt
2018-04-24 13:37:53 +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
e991c261ca
Merge pull request #716 from rgrinberg/sexp-stdune
...
Move Code_error to stdune
2018-04-23 18:20:15 +07:00
Rudi Grinberg
98b2ea795c
Move String_map to stdune
2018-04-23 12:43:20 +07:00
Rudi Grinberg
709385ed66
Don't rely on "ext_exe" always being present
...
It's not present in older OCaml, so we need to guess the ext_exe ourselves.
2018-04-20 17:32:48 +07:00
Rudi Grinberg
13eea737f9
Don't use getenv_opt in configurator test
2018-04-20 17:32:37 +07:00
Rudi Grinberg
6819749550
Remove -ocamlv arg from cram tests
...
The ocamlc config is passesd courtesy of configurator anyway
2018-04-18 23:14:32 +07:00
Rudi Grinberg
ab50461741
Make extensions portable in cram output
...
With some really ugly post processing
2018-04-18 21:21:09 +07:00
Rudi Grinberg
f8f1a4036e
Change cram.mll to not use anon args
2018-04-18 19:30:40 +07: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
Etienne Millon
0cf8a8240a
Add tests
...
The symptoms are a bit different depending on the presence of an
interface file.
2018-04-17 15:51:29 +01: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
8c86604ee6
Add test to show that jbuilder mishandles ${null}
...
Jbuilder incorrectly infers ${null} to be a target
2018-04-17 10:37:34 +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
c1ca2f96b9
Improve configurator tests
...
* Don't use asserts to test extracted values. Just print them and relying on
diffing for comparison
* Use a string constant type.
2018-04-16 13:01:25 +07:00
Rudi Grinberg
f1f60c4081
Merge pull request #695 from rgrinberg/dune-pass-ocamlc
...
Pass ocamlc explicitly to configurator using DUNE_CONFIGURATOR
2018-04-12 19:48:58 +07:00
Jérémie Dimino
db41c3549b
Add a test showing a weird quoting problem ( #699 )
2018-04-12 13:02:41 +01: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
148835967e
Add tests for import defines
2018-04-10 22:05:52 +07:00
Rudi Grinberg
fb8d400165
Add formatting to configurator tests
2018-04-10 22:05:52 +07:00
Rudi Grinberg
8ee13dde4d
Test compiling C program
2018-04-10 22:05:52 +07:00
Rudi Grinberg
ab9b278304
Add actual test suite for configurator
2018-04-10 22:05:52 +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
Jeremie Dimino
22b024a977
More hacks for external-lib-deps
...
Fix #644
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
Rudi Grinberg
18948faff8
Use hand made pretty printers for top level expect tests
...
These tests would fail in 4.02.3 because of the toplevel choosing to print some
module paths differently
2018-04-05 23:03:07 +08:00
Jeremie Dimino
4c9de316f0
Simplify blackbox tests
...
Remove all the -j1, --root ., --display quiet
2018-04-03 11:44:10 +08:00
Jeremie Dimino
24de79934b
Simplify a bit blackbox tests
...
- make them depend on (package jbuilder)
- s/$JBUILDER/jbuilder/
2018-04-03 11:42:29 +08:00
Thomas Refis
77c717b9af
Cosmetic changes for default package entry point.
2018-04-03 00:54:30 +08:00
Rudi Grinberg
244773ef80
Improve odoc tests to test wrapped and non wrapped module listings
2018-04-03 00:51:21 +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
1b1c5f032d
Test to show broken lazy loading of rules
2018-04-02 23:15:07 +08:00
Jeremie Dimino
84251a5b81
Update tests as order of deps changed
2018-03-30 16:47:56 -04:00
Jeremie Dimino
fb101857d4
Extend test for #644
2018-03-27 17:46:21 -04:00
Jeremie Dimino
ad00c1509f
Fix #657
2018-03-27 17:25:25 -04:00
Jeremie Dimino
daef49ce55
Add test for #657
2018-03-27 17:25:25 -04:00
Jeremie Dimino
103af8627c
Added a reproduction case for #644
2018-03-27 14:50:36 -04: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
2ea04b706b
Add another package to odoc tests
2018-03-22 20:40:46 +08:00
Rudi Grinberg
1c77992a28
Add test for #637 regression
2018-03-22 00:03:35 +08:00
Jeremie Dimino
c685e8ac6d
Remove useless load_dir
2018-03-19 01:24:04 +08:00
Jeremie Dimino
a729409fa7
Update the package-dep test to test dependencies between packages
2018-03-19 01:22:44 +08:00
Rudi Grinberg
727d9688e9
Add tests for (package foo) dependency type
2018-03-19 01:17:31 +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
Jeremie Dimino
41cdb98e63
Improve sexp tests
2018-03-17 14:23:43 +00:00
Jeremie Dimino
e3f34fab71
Add a test for Usexp.Atom.is_valid
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
154b405e51
use str as runner dep
2018-03-17 14:23:43 +00:00
Rudi Grinberg
a8ee7bfad5
Add test witnessing generation of backend dune files
...
It shows that jbuilder fails to correctly escape the action field
2018-03-17 14:23:43 +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
Jeremie Dimino
e2adf9d44a
Allow to depend on the universe
...
Fix #255
2018-03-13 19:12:57 +00:00
Rudi Grinberg
daf95cef09
private/public tests with (optional)
...
Currently, a library marked (optional) will not build if it's public and has a
private dependency.
2018-03-14 02:37:11 +08:00
Rudi Grinberg
54b93c2f85
Fix incorrect line numbers in tests
2018-03-13 10:50:39 +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
Rudi Grinberg
753badd481
Fix private deps check for ppx runtime dependencies
2018-03-13 00:11:12 +07:00
Rudi Grinberg
b2258b6c98
Remove private/public overlap from meta tests
...
Those will go in their own test
2018-03-12 23:59:52 +07:00
Rudi Grinberg
35da6080e6
Private/Public overlap tests
...
private dependencies aren't allowed in public libraries. These tests
demonstrates that dune accepts them anyway
2018-03-12 22:13:44 +07:00
Jeremie Dimino
cfd4d81be6
Skip object tests for OCaml < 4.06.0
2018-03-12 14:27:44 +00:00
Jeremie Dimino
ff8a53acb7
Extend the syntax of -skip-versions
2018-03-12 14:27:31 +00: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
bc2b740c4c
Add a reproduction case for #597
2018-03-10 08:25:31 +07:00
Jeremie Dimino
f20b43a22b
Strip colors in blackbox tests
2018-03-06 11:01:06 +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
Rudi Grinberg
dcbfc37666
Add flags field to menhir test
2018-03-05 20:03:36 +07:00
Rudi Grinberg
14d1a4f5e0
META file includes private libraries
...
This is incorrect as those aren't installed
2018-03-04 01:29:27 +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
224d627d07
Import the test case for #568
2018-03-01 23:30:01 +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
6dae7ca6ca
Add unit test for configurator
2018-02-28 23:37:27 +07:00
Jeremie Dimino
8fd3335ee8
Make inline tests more reproducible
2018-02-28 11:32:32 +00:00
Rudi Grinberg
60b8c7c968
Update inline tests ( #556 )
2018-02-28 09:34:57 +00:00
Rudi Grinberg
c5da66e156
Use a more unique binary name
...
Use dunetestbar rather than bar as a binary name. The former name is too common
and hence can make the test fail if a bar binary exists elsewhere.
2018-02-28 12:30:19 +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
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
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
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
Jeremie Dimino
4993c6b89a
Added a test for #534
2018-02-21 13:35:47 +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
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
Rudi Grinberg
7977b8371a
Test case for excluding missing module
...
Setting the field modules as follows (modules (:standard \ foo)) where foo
doesn't exist is an error.
2018-02-20 20:21:34 +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
Rudi Grinberg
b27486b4bd
Multi stanza in 1 jbuild build failure
...
After the change to run ocamldep per module, defining an executable and a
library this way doesn't work anymore.
2018-02-20 11:07:51 +07: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
2b73678284
Add test for the same mld's in different scopes
...
This case on the other hand is allowed
2018-02-17 19:12:52 +07:00
Rudi Grinberg
526c1eef39
Test to reproduce bug with duplicate mld's in same package
...
Odoc doesn't actually allow this so this test will turn into an error later on.
2018-02-16 19:58:11 +07: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
Rudi Grinberg
7e1300ab95
Add .merlin tests ( #508 )
...
These require post-processing all the absolute paths out of the .merlin
2018-02-14 02:13:57 +08:00
Jeremie Dimino
807251c931
Added missing file
2018-02-13 18:01:44 +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
Jeremie Dimino
3744c158c2
Added a reproduction case for #484
2018-02-13 17:48:05 +00:00
Jérémie Dimino
8e27f1966d
Fix #485 ( #512 )
2018-02-13 15:56:59 +00:00
Jeremie Dimino
473b8d11ed
Update test for #485
2018-02-13 15:52:18 +00:00
Jérémie Dimino
dc3bfb9b05
Add a test for #485 ( #511 )
2018-02-13 12:58:34 +00:00
Jérémie Dimino
2fb65c05ba
Fix #330 ( #510 )
2018-02-13 12:49:50 +00:00
Jérémie Dimino
1e6ee05ecc
Added tests for byte-code only architectures ( #509 )
2018-02-13 12:46:07 +00: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
ee42ca5301
Add test showing that private libs with same names don't get built
...
2 private libs with equivalent names but living in public names will not be
built as part of @install even if they have different public names
2018-02-12 19:55:39 +08:00
Hugo Heuzard
dad2458879
install all sources
2018-02-08 23:09:55 +08:00
Rudi Grinberg
4ed4cad3e5
Witness failure to install .ml source when .mli is present
2018-02-08 23:08:52 +08:00
Jérémie Dimino
b3838284c6
Better support for mli/rei only modules ( #489 )
2018-02-08 10:12:46 +00:00
Jérémie Dimino
763feda683
Move the addition of <lib>.a dependencies to Lib.archive_files ( #493 )
...
Move the addition of <lib>.a dependencies to Lib.archive_files
And refactor a bit the code
2018-02-08 03:21:11 +08:00
Jeremie Dimino
b46cef533a
Make Findlib.package abstract
2018-02-07 18:10:05 +00:00
Jeremie Dimino
1588ce90f2
Update js_of_ocaml tests
2018-02-07 14:20:56 +00:00
Jeremie Dimino
b17b476048
Set the obj_dir for executables
2018-02-07 12:34:01 +00:00
Grégoire Henry
fda3c7f680
Implement #427
2018-02-07 12:33:52 +00:00
Jérémie Dimino
0570e09f9a
Add a configuration file and a quiet mode ( #490 )
2018-02-07 11:38:21 +00:00
Jérémie Dimino
4e4f651b37
Don't stop on the first error ( #477 )
...
Before, jbuilder used to stop its execution after an error was
encountered. Now it continues until all branches have been explored.
To implement this feature, Future was rewritten as a Fiber module with
a simpler semantic.
This patch contains various other refactorings.
2018-02-06 14:39:03 +00:00
Jérémie Dimino
80c0bfc879
Split calls to ocamldep ( #486 )
...
Instead of doing a single call to ocamldep, do one per file. This is
needed to support "menhir --infer".
This should also make compilation go further when there are files with
syntax errors.
2018-02-06 11:48:04 +00:00
Jérémie Dimino
f618096d6e
Add a test for dependency cycles ( #475 )
2018-02-01 13:05:32 +00:00
Rudi Grinberg
e61142e885
Merge pull request #460 from ocaml/fix-promote-tests-on-osx
...
Fix bad interaction between promotion and incremental builds on OSX
2018-02-01 20:15:18 +08:00
Jeremie Dimino
b9c4dd2339
Remove files from the digest cache when promoting them.
...
This is to avoid problems with incremental compilation on OSX.
Fix #456
2018-02-01 08:23:25 +00:00
Rudi Grinberg
3646e554a9
Add tests of js_of_ocaml flag
...
Make sure that adding js runtime files reflects correctly in the META and
.install files
2018-02-01 04:31:18 +08:00
Rudi Grinberg
721c80273a
Update ppx scope tests
2018-01-31 00:48:58 +08:00
Rudi Grinberg
672120b3b8
Introduce explicit scopes for Lib_db
...
This commit introduces explicit scopes in Lib_db and refactors dune to use these
scopes where appropriate. Briefly, they are appropriate whenever we previously
used a directory to resolve the scope with Lib_db.find ~dir and friends. So a
Lib_db.Scope.t replaces a (dir, Lib_db.t) pair.
This allows to be explicit about the anonymous and external scope. Which is
important when building ppx drivers.
We also harmonize the error handling with the Findlib module. In both cases
we use a flat string list of errors. Rather than the more specific type we had
before in Findlib.
2018-01-30 19:21:40 +08:00
Jérémie Dimino
c066efd196
Add the transitive dependencies of used ppx rewriters ( #450 )
2018-01-25 11:22:50 +00:00
Rudi Grinberg
eac036a446
Add another test case for meta generation ( #449 )
...
A library that has been pp'd with a preprocessor that has runtime deps
2018-01-25 10:21:37 +00:00
Rudi Grinberg
2eb45c4ae3
Test case to reproduce scope bug when building ppx
...
The scope selected when building the ppx is bogus (it corresponds to the
directory with the ppx exe).
2018-01-25 12:20:00 +08:00
Rudi Grinberg
fde877838b
Merge pull request #444 from rgrinberg/reproduce-scope-bug
...
META generation bug in different scopes
2018-01-24 19:32:12 +08: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
Rudi Grinberg
d6601bf2bb
META generation bug in different scopes
2018-01-24 16:09:38 +08:00
Rudi Grinberg
3b3f8afb4d
Improve odoc tests to use mld file
2018-01-24 00:05:52 +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
a34f71f922
Merge pull request #410 from rgrinberg/new-odoc-minimal
...
New odoc rules (minimal)
2018-01-23 02:58:06 +08:00
Rudi Grinberg
d2af91091c
Update odoc tests
...
These now work for libs defined in the same dir
2018-01-23 02:56:23 +08:00
Jérémie Dimino
f9837a278b
Detect recursive includes ( #435 )
...
Fix #432
2018-01-22 11:32:40 +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
9dd5ab74e4
[WIP] Load rules lazily ( #370 )
...
* Change jbuilder to load rules lazily
Rules are now loaded on a per directory basis as needed. This speed up
the start up time on large workspaces.
Does various refactoring as well.
* Simplify the handling of META files
We no longer generate a META.foo.from-jbuilder file. Nobody is using
this feature and it's making the new code more complicated.
2018-01-19 08:50:06 +00:00
Rudi Grinberg
326ca5413a
Merge pull request #422 from rgrinberg/skip-reason-tests
...
Disable reason tests for now
2018-01-18 21:12:19 +08: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
Rudi Grinberg
ec5fac8085
Disable reason tests for now
...
Current version of reason doesn't install on travis
2018-01-18 06:20:33 +08: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
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
e28344a24b
Do not use the transitive closure in generated META files ( #405 )
2018-01-12 16:41:23 +00:00
Rudi Grinberg
f490540538
Update tests for linting
2018-01-10 22:45:50 +08:00
Rudi Grinberg
5dd8d028ae
Improve reason tests
...
* Test that modules are actually built by running their code.
* Make reasonlypp to also be a linter
* Make the reason only pp double as linter When ran with the -lint flag
2018-01-10 02:15:17 +08:00
Jeremie Dimino
f68c1dd042
Add blackbox test for cross compilation
2018-01-01 22:34:41 +08:00
Rudi Grinberg
6422cd606d
Add test for sub library in sub dir
...
Makes sure that that directory option is used appropriately in the META
2017-12-28 16:03:44 +08:00
Rudi Grinberg
dfe0001b5a
Simple stubs test
...
C stub library and executable that will run it
2017-12-23 11:29:41 +08:00
Rudi Grinberg
7d8ca23b62
Test install_c_headers stanza
2017-12-23 11:25:05 +08:00
Rudi Grinberg
5e890ccd67
Merge pull request #382 from rgrinberg/no-empty-modules
...
Add dummy module to make copy_files test pass on 4.02.3
2017-12-23 11:03:53 +08:00
Rudi Grinberg
7363c772aa
Add dummy module to make copy_files test pass on 4.02.3
2017-12-22 21:18:17 +08:00
Rudi Grinberg
a3806d7e3b
Add utop tests
2017-12-22 19:31:25 +08:00
Rudi Grinberg
f365e8f157
Improve copy_files test for c files to make sure source is tracked
2017-12-22 08:16:09 +01:00
David Allsopp
5901d7dee3
Update copy_files blackbox test to include C
...
Tests that the the directive emits #line instead of #n.
Signed-off-by: David Allsopp <david.allsopp@metastack.com>
2017-12-22 08:16:09 +01:00
Rudi Grinberg
2025f1db58
Improve reason tests
...
Test that modules are actually built by running their code.
2017-12-21 20:20:43 +08:00
Rudi Grinberg
3ac73edb42
move copy-sources for reason tests to own dir
...
So that the originals aren't used accidentally
2017-12-20 17:23:26 +07: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
9e4390ddc4
Add tests Path.descendent
...
Some of them are failing because it it doesn't work when the paths are equal or
have the same length
2017-12-20 09:06:12 +00:00
Rudi Grinberg
347c3d7612
disable ppx_runner test with custom omp runner args
2017-12-19 19:05:37 +07:00
Rudi Grinberg
1793827d0b
Tests for running ppx rewriters
...
Testing changing and interacting with drivers by passing arguments.
2017-12-19 19:00:50 +07:00
Rudi Grinberg
3cae475486
Add some reason tests wrt to ppx preprocessing ( #375 )
...
Add some reason tests wrt to ppx preprocessing
2017-12-19 19:49:06 +08: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
d661f74c46
Skip 4.02.3 for the multiple-private-libs test
2017-12-18 13:30:49 +00:00
Jeremie Dimino
18d8cb847d
Fix the test added in the previous commit
2017-12-18 13:30:49 +00:00
Jeremie Dimino
f534387ef6
Add a test exposing a name clash
...
When several private libraries have the same name, jbuilder crashes.
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