You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 5102 Reporter:@dbuenzli Assigned to:@xclerc Status: closed (set by @xavierleroy on 2015-12-11T18:08:14Z) Resolution: fixed Priority: normal Severity: minor Version: 3.12.0+beta1 or 3.12.0+rc1 Target version: 4.01.0+dev Fixed in version: 4.00.2+dev Category: -for ocamlbuild use https://github.com/ocaml/ocamlbuild/issues Monitored by:@dbuenzli
Bug description
The %(name) syntax doesn't work when there's only %(name) used in ~prod see the examples below.
Thanks,
Daniel
Steps to reproduce
Bug (single %(file) in ~prod):
cat myocamlbuild.ml
open Ocamlbuild_plugin;;
dispatch begin function
| Before_rules ->
rule "test: %.test -> %"
~dep:"%(file).%(suff).test"
~prod: "%(file)"
begin fun env build ->
cp (env "%(file).%(suff).test") (env "%(file)")
end
| _ -> ()
end
dispatch begin function
| Before_rules ->
rule "test: %.test -> %"
~dep:"%(file).%(suff).test"
~prod: "%(file).%(suff)"
begin fun env build ->
cp (env "%(file).%(suff).test") (env "%(file).%(suff)")
end
| _ -> ()
end
The following is also strange. With this plugin trying to build anything that doesn't exist hangs forever.
cat myocamlbuild.ml
open Ocamlbuild_plugin;;
dispatch begin function
| Before_rules ->
rule "test: %.test -> %"
~dep:"%.test"
~prod: "%"
begin fun env build ->
cp (env "%.test") (env "%")
end
| _ -> ()
end
Fixed in trunk (revision 13002) and 4.00 (revision 13003) branches.
The "Not_found" exception was caused by the use of an unbound
variable in the dependency. Now, unbound variables are replaced
by empty strings.
The non-terminating behavior is not an ocamlbuild bug. Indeed,
if one has the rule "%(x).test -> %(x)" and asks to build "foo", then
a try will be made to create "foo.test" which in turn will try to create
"foo.test.test", and so on... thus looping unless one of these "*.test"
file already exists.
Original bug ID: 5102
Reporter: @dbuenzli
Assigned to: @xclerc
Status: closed (set by @xavierleroy on 2015-12-11T18:08:14Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 3.12.0+beta1 or 3.12.0+rc1
Target version: 4.01.0+dev
Fixed in version: 4.00.2+dev
Category: -for ocamlbuild use https://github.com/ocaml/ocamlbuild/issues
Monitored by: @dbuenzli
Bug description
The %(name) syntax doesn't work when there's only %(name) used in ~prod see the examples below.
Thanks,
Daniel
Steps to reproduce
Bug (single %(file) in ~prod):
dispatch begin function
| Before_rules ->
rule "test: %.test -> %"
~dep:"%(file).%(suff).test"
~prod: "%(file)"
begin fun env build ->
cp (env "%(file).%(suff).test") (env "%(file)")
end
| _ -> ()
end
No bug (more than one %(arg) in ~prod):
dispatch begin function
| Before_rules ->
rule "test: %.test -> %"
~dep:"%(file).%(suff).test"
~prod: "%(file).%(suff)"
begin fun env build ->
cp (env "%(file).%(suff).test") (env "%(file).%(suff)")
end
| _ -> ()
end
The text was updated successfully, but these errors were encountered: