diff --git a/bin/coq/coqtop.ml b/bin/coq/coqtop.ml index 3db4a312721..71e15abbc3c 100644 --- a/bin/coq/coqtop.ml +++ b/bin/coq/coqtop.ml @@ -18,7 +18,7 @@ let man = let info = Cmd.info "top" ~doc ~man let term = - let+ builder = Common.Builder.term + let+ default_builder = Common.Builder.term and+ context = let doc = "Run the Coq toplevel in this build context." in Common.context_arg ~doc @@ -34,7 +34,12 @@ let term = & flag & info [ "no-build" ] ~doc:"Don't rebuild dependencies before executing.") in - let common, config = Common.init builder in + let common, config = + let builder = + if no_rebuild then Common.Builder.forbid_builds default_builder else default_builder + in + Common.init builder + in let coq_file_arg = Common.prefix_target common coq_file_arg |> Path.Local.of_string in let coqtop, argv, env = Scheduler.go ~common ~config diff --git a/doc/changes/10547.md b/doc/changes/10547.md new file mode 100644 index 00000000000..cb0f035cd8c --- /dev/null +++ b/doc/changes/10547.md @@ -0,0 +1,2 @@ +- Don't try to take build lock when running `coq top --no-build` (#10547, + fixes #7671, @lzy0505)