Remove path-no-dep syntax
See #944 Signed-off-by: Etienne Millon <etienne@cryptosense.com>
This commit is contained in:
parent
9ece73dadc
commit
35ff6466de
|
@ -112,6 +112,8 @@ next
|
||||||
|
|
||||||
- Rename `path:file` to `dep:file` (#944, @emillon)
|
- Rename `path:file` to `dep:file` (#944, @emillon)
|
||||||
|
|
||||||
|
- Remove `path-no-dep:file` (#948, @emillon)
|
||||||
|
|
||||||
1.0+beta20 (10/04/2018)
|
1.0+beta20 (10/04/2018)
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
|
|
|
@ -830,12 +830,8 @@ In addition, ``(action ...)`` fields support the following special variables:
|
||||||
- ``<`` expands to the first dependency, or the empty string if there are no
|
- ``<`` expands to the first dependency, or the empty string if there are no
|
||||||
dependencies
|
dependencies
|
||||||
- ``^`` expands to the list of dependencies, separated by spaces
|
- ``^`` expands to the list of dependencies, separated by spaces
|
||||||
- ``dep:<path>`` expands to ``<path>``
|
- ``dep:<path>`` expands to ``<path>`` (and adds ``<path>`` as a dependency of
|
||||||
- ``path-no-dep:<path>`` is the same as ``path:<path>``, except that
|
the action)
|
||||||
``<path>`` is not considered as a dependency of the action. For instance
|
|
||||||
``(chdir ${ROOT} (run foo --base ${path-no-dep:bar}))`` in ``src/blah/jbuild``
|
|
||||||
will expand to ``(chdir ../.. (run foo --base src/blah/bar))`` where
|
|
||||||
``src/blah/bar`` doesn't have to be an existing or buildable file
|
|
||||||
- ``exe:<path>`` is the same as ``<path>``, except when cross-compiling, in
|
- ``exe:<path>`` is the same as ``<path>``, except when cross-compiling, in
|
||||||
which case it will expand to ``<path>`` from the host build context
|
which case it will expand to ``<path>`` from the host build context
|
||||||
- ``bin:<program>`` expands to a path to ``program``. If ``program``
|
- ``bin:<program>`` expands to a path to ``program``. If ``program``
|
||||||
|
|
|
@ -171,7 +171,11 @@ Jbuild Dune
|
||||||
``${^}`` ``%{deps}``
|
``${^}`` ``%{deps}``
|
||||||
``${<}`` ``%{deps[0]}``
|
``${<}`` ``%{deps[0]}``
|
||||||
``${path:file}`` ``%{dep:file}``
|
``${path:file}`` ``%{dep:file}``
|
||||||
``${path-no-dep:file}`` ``%{path:file}``
|
|
||||||
``${SCOPE_ROOT}`` ``%{project_root}``
|
``${SCOPE_ROOT}`` ``%{project_root}``
|
||||||
``${findlib:..}`` ``%{lib:..}``
|
``${findlib:..}`` ``%{lib:..}``
|
||||||
======================== ============
|
======================== ============
|
||||||
|
|
||||||
|
Removed Variables
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
``${path-no-dep:file}`` has been removed.
|
||||||
|
|
|
@ -644,7 +644,7 @@ module Action = struct
|
||||||
Loc.fail
|
Loc.fail
|
||||||
loc
|
loc
|
||||||
"${dep:%s} is not supported in jbuild files.\n\
|
"${dep:%s} is not supported in jbuild files.\n\
|
||||||
Did you mean: ${path:%s}"
|
Hint: Did you mean ${path:%s} instead?"
|
||||||
s
|
s
|
||||||
s
|
s
|
||||||
| Pair ("bin", s) -> begin
|
| Pair ("bin", s) -> begin
|
||||||
|
@ -755,7 +755,12 @@ module Action = struct
|
||||||
| _ ->
|
| _ ->
|
||||||
match String_with_vars.Var.destruct var with
|
match String_with_vars.Var.destruct var with
|
||||||
| Pair ("path-no-dep", s) ->
|
| Pair ("path-no-dep", s) ->
|
||||||
Some (path_exp (Path.relative dir s))
|
if syntax_version < (1, 0) then
|
||||||
|
Some (path_exp (Path.relative dir s))
|
||||||
|
else
|
||||||
|
Loc.fail
|
||||||
|
loc
|
||||||
|
"The ${path-no-dep:...} syntax has been removed from dune."
|
||||||
| _ ->
|
| _ ->
|
||||||
let exp = expand var syntax_version in
|
let exp = expand var syntax_version in
|
||||||
Option.iter exp ~f:(fun vs ->
|
Option.iter exp ~f:(fun vs ->
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
$ dune clean --display short
|
$ dune clean --display short
|
||||||
$ dune build --display short @just-in-src
|
$ dune build --display short @just-in-src
|
||||||
running in src
|
running in .
|
||||||
$ dune clean --display short
|
$ dune clean --display short
|
||||||
$ dune build --display short @everywhere
|
$ dune build --display short @everywhere
|
||||||
running in src/foo/bar
|
running in bar
|
||||||
running in src/foo/baz
|
running in baz
|
||||||
running in src
|
running in .
|
||||||
$ dune clean --display short
|
$ dune clean --display short
|
||||||
$ dune build --display short @x
|
$ dune build --display short @x
|
||||||
running in src/foo/bar
|
running in bar
|
||||||
running in src/foo/baz
|
running in baz
|
||||||
running in src
|
running in .
|
||||||
$ dune build --display short @plop
|
$ dune build --display short @plop
|
||||||
From the command line:
|
From the command line:
|
||||||
Error: Alias "plop" is empty.
|
Error: Alias "plop" is empty.
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
(alias
|
(alias
|
||||||
(name x)
|
(name x)
|
||||||
(action (chdir %{ROOT} (echo "running in %{path-no-dep:.}\n"))))
|
(action (chdir %{ROOT} (echo "running in .\n"))))
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
(alias
|
(alias
|
||||||
(name x)
|
(name x)
|
||||||
(action (chdir %{ROOT} (echo "running in %{path-no-dep:.}\n"))))
|
(action (chdir %{ROOT} (echo "running in bar\n"))))
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
(alias
|
(alias
|
||||||
(name x)
|
(name x)
|
||||||
(action (chdir %{ROOT} (echo "running in %{path-no-dep:.}\n"))))
|
(action (chdir %{ROOT} (echo "running in baz\n"))))
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
(alias
|
||||||
|
(name test-path-no-dep)
|
||||||
|
(action
|
||||||
|
(chdir
|
||||||
|
sub-tree/dir
|
||||||
|
(progn
|
||||||
|
(echo "%{path-no-dep:file-that-does-not-exist}\n")
|
||||||
|
(echo "%{path-no-dep:.}\n")))))
|
|
@ -0,0 +1 @@
|
||||||
|
(lang dune 1.0)
|
|
@ -12,12 +12,3 @@
|
||||||
(progn
|
(progn
|
||||||
(echo "%{path:file-that-does-not-exist}\n")
|
(echo "%{path:file-that-does-not-exist}\n")
|
||||||
(echo "%{path:.}\n")))))
|
(echo "%{path:.}\n")))))
|
||||||
|
|
||||||
(alias
|
|
||||||
(name test-path-no-dep)
|
|
||||||
(action
|
|
||||||
(chdir
|
|
||||||
sub-tree/dir
|
|
||||||
(progn
|
|
||||||
(echo "%{path-no-dep:file-that-does-not-exist}\n")
|
|
||||||
(echo "%{path-no-dep:.}\n")))))
|
|
||||||
|
|
|
@ -13,12 +13,13 @@ In expands to a file name, and registers this as a dependency.
|
||||||
%{path-no-dep:string}
|
%{path-no-dep:string}
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
It expands to a file name, but does not register it as a dependency.
|
This form does not exist, but displays an hint:
|
||||||
|
|
||||||
$ dune build --root dune @test-path-no-dep
|
$ dune build --root dune-invalid @test-path-no-dep
|
||||||
Entering directory 'dune'
|
Entering directory 'dune-invalid'
|
||||||
../../file-that-does-not-exist
|
File "dune", line 7, characters 17-54:
|
||||||
../..
|
Error: The ${path-no-dep:...} syntax has been removed from dune.
|
||||||
|
[1]
|
||||||
|
|
||||||
jbuild files
|
jbuild files
|
||||||
============
|
============
|
||||||
|
@ -51,5 +52,5 @@ This form does not exist, but displays an hint:
|
||||||
Entering directory 'jbuild-invalid'
|
Entering directory 'jbuild-invalid'
|
||||||
File "jbuild", line 5, characters 16-37:
|
File "jbuild", line 5, characters 16-37:
|
||||||
Error: ${dep:generated-file} is not supported in jbuild files.
|
Error: ${dep:generated-file} is not supported in jbuild files.
|
||||||
Did you mean: ${path:generated-file}
|
Hint: Did you mean ${path:generated-file} instead?
|
||||||
[1]
|
[1]
|
||||||
|
|
Loading…
Reference in New Issue