Skip to content

Commit 215a647

Browse files
Merge PR rocq-prover#19899: [build] Fix wrong use of %{project_root}/_build in config files
Reviewed-by: SkySkimmer Co-authored-by: SkySkimmer <[email protected]>
2 parents 46fb258 + cfbdcd5 commit 215a647

File tree

4 files changed

+29
-10
lines changed

4 files changed

+29
-10
lines changed

dev/shim/dune

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,26 @@
1818
(with-stdout-to %{targets}
1919
(progn
2020
(echo "#!/usr/bin/env bash\n")
21-
(bash "echo '\"$(dirname \"$0\")\"/%{bin:coqtop} -I \"$(dirname \"$0\")/%{project_root}/../install/default/lib\" -coqlib \"$(dirname \"$0\")/%{project_root}\" \"$@\"'")
21+
(bash "echo '\"$(dirname \"$0\")\"/%{bin:coqtop} -I \"$(dirname \"$0\")/%{workspace_root}/_build/install/default/lib\" -coqlib \"$(dirname \"$0\")/%{project_root}\" \"$@\"'")
22+
(run chmod +x %{targets})))))
23+
24+
; coqidetop
25+
26+
(alias
27+
(name coqidetop-prelude)
28+
(deps
29+
%{bin:coqidetop.opt}
30+
; XXX: bug, we are missing the dep on the _install meta file...
31+
%{project_root}/theories/Init/Prelude.vo))
32+
33+
(rule
34+
(targets coqidetop.opt)
35+
(deps (alias coqidetop-prelude))
36+
(action
37+
(with-stdout-to %{targets}
38+
(progn
39+
(echo "#!/usr/bin/env bash\n")
40+
(bash "echo '\"$(dirname \"$0\")\"/%{bin:coqidetop.opt} -I \"$(dirname \"$0\")/%{workspace_root}/_build/install/default/lib\" -coqlib \"$(dirname \"$0\")/%{project_root}\" \"$@\"'")
2241
(run chmod +x %{targets})))))
2342

2443
; coqc
@@ -37,7 +56,7 @@
3756
(with-stdout-to %{targets}
3857
(progn
3958
(echo "#!/usr/bin/env bash\n")
40-
(bash "echo '\"$(dirname \"$0\")\"/%{bin:coqc} -I \"$(dirname \"$0\")/%{project_root}/../install/default/lib\" -coqlib \"$(dirname \"$0\")\"/%{project_root} -nI \"$(dirname \"$0\")\"/%{project_root}/kernel/.kernel.objs/byte \"$@\"'")
59+
(bash "echo '\"$(dirname \"$0\")\"/%{bin:coqc} -I \"$(dirname \"$0\")/%{workspace_root}/_build/install/default/lib\" -coqlib \"$(dirname \"$0\")\"/%{project_root} -nI \"$(dirname \"$0\")\"/%{project_root}/kernel/.kernel.objs/byte \"$@\"'")
4160
(run chmod +x %{targets})))))
4261

4362
; coqtop.byte
@@ -80,7 +99,7 @@
8099
(with-stdout-to %{targets}
81100
(progn
82101
(echo "#!/usr/bin/env bash\n")
83-
(bash "echo '\"$(dirname \"$0\")\"/%{bin:coqtop.byte} -I \"$(dirname \"$0\")/%{project_root}/../install/default/lib\" -coqlib \"$(dirname \"$0\")\"/%{project_root} \"$@\"'")
102+
(bash "echo '\"$(dirname \"$0\")\"/%{bin:coqtop.byte} -I \"$(dirname \"$0\")/%{workspace_root}/_build/install/default/lib\" -coqlib \"$(dirname \"$0\")\"/%{project_root} \"$@\"'")
84103
(run chmod +x %{targets})))))
85104

86105
; coqide
@@ -91,7 +110,7 @@
91110
; without this if the gtk libs are not available dune can try to use
92111
; coqide from PATH instead of giving a nice error
93112
; there is no problem with the other shims since they don't depend on optional build products
94-
%{project_root}/ide/coqide/coqide_main.exe
113+
%{project_root}/ide/coqide/rocqide_main.exe
95114
%{bin:coqworker.opt}
96115
%{project_root}/theories/Init/Prelude.vo
97116
%{project_root}/coqide-server.install
@@ -104,5 +123,5 @@
104123
(with-stdout-to %{targets}
105124
(progn
106125
(echo "#!/usr/bin/env bash\n")
107-
(bash "echo '\"$(dirname \"$0\")\"/%{bin:coqide} -I \"$(dirname \"$0\")/%{project_root}/../install/default/lib\" -coqlib \"$(dirname \"$0\")\"/%{project_root} \"$@\"'")
126+
(bash "echo '\"$(dirname \"$0\")\"/%{bin:coqide} -I \"$(dirname \"$0\")/%{workspace_root}/_build/install/default/lib\" -coqlib \"$(dirname \"$0\")\"/%{project_root} \"$@\"'")
108127
(run chmod +x %{targets})))))

dune

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
(source_tree plugins)
4242
(source_tree theories)
4343
(source_tree user-contrib)
44-
%{project_root}/_build/install/%{context_name}/lib/coq-core/META)
44+
%{workspace_root}/_build/install/%{context_name}/lib/coq-core/META)
4545
(action
4646
(with-stdout-to %{targets}
4747
(run tools/dune_rule_gen/gen_rules.exe Corelib theories %{env:COQ_DUNE_EXTRA_OPT=}))))
@@ -52,7 +52,7 @@
5252
(source_tree plugins)
5353
(source_tree theories)
5454
(source_tree user-contrib)
55-
%{project_root}/_build/install/%{context_name}/lib/coq-core/META)
55+
%{workspace_root}/_build/install/%{context_name}/lib/coq-core/META)
5656
(action
5757
(with-stdout-to %{targets}
5858
(run tools/dune_rule_gen/gen_rules.exe Ltac2 user-contrib/Ltac2 %{env:COQ_DUNE_EXTRA_OPT=}))))

tools/coqdep/lib/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
(rule
99
(targets static_toplevel_libs.ml)
10-
(deps %{project_root}/_build/install/%{context_name}/lib/coq-core/META)
10+
(deps %{workspace_root}/_build/install/%{context_name}/lib/coq-core/META)
1111
(action
1212
(with-stdout-to %{targets}
1313
(run ocamlfind query -recursive -predicates native coq-core.toplevel

tools/dune_rule_gen/coq_rules.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ let path_of_dep ~vo_ext dep =
5151
path to be relative to the .v won't work
5252
5353
(it would be relative to the .v in
54-
project_root/_build/default/theories but dune would read it as
54+
workspace_root/_build/default/theories but dune would read it as
5555
relative to the .v in project_root/theories, the number of .. to
5656
insert to get to project_root doesn't match) *)
5757
let file = if CString.is_prefix ".." file then
58-
(Filename.concat "%{project_root}" "_build")
58+
(Filename.concat "%{workspace_root}" "_build")
5959
^ String.sub file 2 (String.length file - 2)
6060
else file
6161
in

0 commit comments

Comments
 (0)