File tree 1 file changed +35
-0
lines changed
test/blackbox-tests/test-cases/optional-executable.t
1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -52,3 +52,38 @@ The following command should fail because the executable is not optional:
52
52
^^^^^^^^^^^^^^
53
53
Error : Library "does-not-exist " not found .
54
54
[1 ]
55
+
56
+ A strange behavior discovered in #4786 . Dune would ignore an executable if any
57
+ of its dependencies were optional .
58
+
59
+ $ mkdir optional-binary
60
+ $ cd optional-binary
61
+ $ cat >dune-project <<EOF
62
+ > (lang dune 3.0 )
63
+ > (package (name myfoo))
64
+ > EOF
65
+
66
+ $ mkdir exe
67
+ $ cat >exe /bar .ml <<EOF
68
+ > print_endline "hello world "
69
+ > EOF
70
+ $ cat >exe /dune <<EOF
71
+ > (executable (public_name dunetestbar) (name bar) (libraries foo))
72
+ > EOF
73
+
74
+ $ mkdir lib
75
+ $ cat >lib /dune <<EOF
76
+ > (library (name foo) (libraries xxx-does-not-exist) (optional) (modules ()))
77
+ > EOF
78
+
79
+ $ cat >dune <<EOF
80
+ > (rule
81
+ > (alias run-x )
82
+ > (action (echo % {exe: bar. exe})))
83
+ > EOF
84
+
85
+ $ dune build @run-x
86
+ Error : No rule found for bar .exe
87
+ - > required by %{exe:bar . exe} at dune: 3
88
+ -> required by alias run-x in dune: 1
89
+ [1 ]
You can’t perform that action at this time.
0 commit comments