Commit Graph

1709 Commits

Author SHA1 Message Date
Rudi Grinberg a57013c3f3 Add check for relative path in Local.relative
this is to prevent an infinite loop in explode_path
2018-05-11 09:37:39 +07:00
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
Rudi Grinberg 229007a891
Merge pull request #760 from diml/fix-759
Fix #759
2018-05-10 13:24:27 +07: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 fc5ecdac9d
Merge pull request #756 from rgrinberg/path-parent-option
Path parent option
2018-05-09 18:39:47 +07: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 7e9be66e6f Don't check if path is root directly 2018-05-09 17:54:52 +07:00
Rudi Grinberg 28f451f33c
Merge pull request #757 from rgrinberg/path-refactors
Path refactorings.
2018-05-09 17:53:56 +07:00
Rudi Grinberg ad4bc43a9f
Merge pull request #755 from rgrinberg/rm-rf-safety
Rm -rf safety
2018-05-09 17:45:06 +07:00
Rudi Grinberg c563fc1db8 Re-implement many path functions using kind
This will make it easier to port them to symbolic paths as this check is also
necessary there.
2018-05-09 17:33:05 +07:00
Rudi Grinberg 92b351de30 Small refactoring to call Path.absolute one less time 2018-05-09 17:32:36 +07:00
Rudi Grinberg 46d74e1a96 Implement Path.explode_exn in terms of Path.explode 2018-05-09 17:32:33 +07:00
Rudi Grinberg 65385bbaa4 Remove Path.drop_prefix
not used anywhere
2018-05-09 17:29:19 +07:00
Rudi Grinberg 47d54854e4 Safety feature for Path.rm_rf 2018-05-09 17:11:09 +07:00
Rudi Grinberg 08b33331ea Path.rm_rf test 2018-05-09 17:10:41 +07:00
Jérémie Dimino 5ac3acf195
Add File_tree.Dir.dune_file (#749) 2018-05-09 09:18:01 +01: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 2dcd95d3dd
Merge pull request #754 from rgrinberg/path-append-behavior
Unit tests for current Path.append behavior
2018-05-09 14:50:30 +07:00
Rudi Grinberg 7d17a30a99 Unit tests for current Path.append behavior 2018-05-09 09:14:21 +07:00
Rudi Grinberg 78612e0649 Move of_user_written_path to Alias0.T
This is done to avoid double check of the path being in build dir
2018-05-09 08:10:41 +07:00
Rudi Grinberg 8eba040b92 Rename Alias.of_path to Alias.of_user_written_path
And add a loc argument for correct error messages
2018-05-09 08:05:57 +07:00
Rudi Grinberg 76c1a32da4 Add tests for invalid alias paths 2018-05-09 08:05:57 +07:00
Rudi Grinberg 84831308f0 Make sure that Alias0.dir always goes through dir check
the directory must always be inside the build dir, so we make sure that any way
to create the record validates this invariant
2018-05-09 08:05:57 +07:00
Rudi Grinberg 0f648f1387 Make sure Alias0.dir is always in the build_dir 2018-05-09 08:05:57 +07:00
Rudi Grinberg 92220d34a3
Merge pull request #752 from rgrinberg/pass-missing-loc
Pass some missing loc's when using Path.relative
2018-05-09 08:02:44 +07:00
Rudi Grinberg 4c7a78e5d6 Pass some missing loc's when using Path.relative 2018-05-09 08:01:57 +07:00
Jérémie Dimino e6650a322f
Better error message for #745 (#748) 2018-05-08 16:28:50 +01:00
Rudi Grinberg f603fd6598
Merge pull request #747 from rgrinberg/insert-after-build-dir-exn
Insert after build dir exn behavior tweak
2018-05-08 19:19:59 +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
Jeremie Dimino 70abc5544d Add support for dune files 2018-05-04 12:26:26 +01:00
Jeremie Dimino cb4e167232 Get rid of jbuild_file_in
This function will be wrong once we support both dune and jbuild
files. Use more precise locations instead.
2018-05-03 13:54:47 +01:00
Tim McGilchrist 4505907ef3 Spelling (#742)
s/whish/wish
2018-05-03 11:08:33 +01:00
Jeremie Dimino db91543e3f Support version stanzas in dune-project files 2018-05-03 11:07:45 +01:00
Jeremie Dimino 8d4e1904a2 Refactor dune-project parsing 2018-05-03 11:07:45 +01:00
Rudi Grinberg 2e47052bb2
Merge pull request #738 from rgrinberg/no-_build
Remove all hard coded uses of "_build"
2018-05-03 00:33:19 +07:00
Rudi Grinberg 25c34c222c Remove all hard coded uses of "_build"
Always route these cases through Path.build_dir
2018-05-02 22:38:50 +07:00