From 5bf25dfce23da1cee04b1c886e026f0dbc902c9c Mon Sep 17 00:00:00 2001 From: charguer Date: Fri, 8 Nov 2019 11:06:10 +0100 Subject: From CoqIDE or -vos or -vok compilation, load .vo when .vos is missing (fixing bug #11057). With this new behavior, it is not needed to .vos files in user contribs. Also, this commit adds a feature: upon creation of a .vo file, an empty .vok file is touched. --- doc/sphinx/practical-tools/coq-commands.rst | 10 +++++----- test-suite/coq-makefile/coqdoc1/run.sh | 2 -- test-suite/coq-makefile/coqdoc2/run.sh | 2 -- test-suite/coq-makefile/mlpack1/run.sh | 1 - test-suite/coq-makefile/mlpack2/run.sh | 1 - test-suite/coq-makefile/multiroot/run.sh | 2 -- test-suite/coq-makefile/native1/run.sh | 1 - test-suite/coq-makefile/plugin1/run.sh | 1 - test-suite/coq-makefile/plugin2/run.sh | 1 - test-suite/coq-makefile/plugin3/run.sh | 1 - tools/CoqMakefile.in | 2 -- toplevel/ccompile.ml | 7 +++++-- toplevel/coqcargs.mli | 2 +- vernac/loadpath.ml | 8 +++----- 14 files changed, 14 insertions(+), 27 deletions(-) diff --git a/doc/sphinx/practical-tools/coq-commands.rst b/doc/sphinx/practical-tools/coq-commands.rst index 70259ff565..a68078ecd4 100644 --- a/doc/sphinx/practical-tools/coq-commands.rst +++ b/doc/sphinx/practical-tools/coq-commands.rst @@ -354,11 +354,11 @@ within a section. **Interaction with standard compilation** When compiling a file ``foo.v`` using ``coqc`` in the standard way (i.e., without -``-vos`` nor ``-vok``), an empty file ``foo.vos`` is created in addition to the -regular output file ``foo.vo``. If ``coqc`` is subsequently invoked on some other -file ``bar.v`` using option ``-vos`` or ``-vok``, and that ``bar.v`` requires -``foo.v``, if |Coq| finds an empty file ``foo.vos``, then it will load -``foo.vo`` instead of ``foo.vos``. +``-vos`` nor ``-vok``), an empty file ``foo.vos`` and an empty file ``foo.vok`` +are created in addition to the regular output file ``foo.vo``. +If ``coqc`` is subsequently invoked on some other file ``bar.v`` using option +``-vos`` or ``-vok``, and that ``bar.v`` requires ``foo.v``, if |Coq| finds an +empty file ``foo.vos``, then it will load ``foo.vo`` instead of ``foo.vos``. The purpose of this feature is to allow users to benefit from the ``-vos`` option even if they depend on libraries that were compiled in the traditional diff --git a/test-suite/coq-makefile/coqdoc1/run.sh b/test-suite/coq-makefile/coqdoc1/run.sh index 0d9b9ea867..88237815b1 100755 --- a/test-suite/coq-makefile/coqdoc1/run.sh +++ b/test-suite/coq-makefile/coqdoc1/run.sh @@ -28,12 +28,10 @@ sort -u > desired < desired < desired < desired < desired < desired < desired < desired < desired < None in if !Flags.load_vos_libraries then begin (* If the .vos file exists and is not empty, it describes the library. - If the .vos file exists and is empty, then load the .vo file. - If the .vos file is missing, then fail. *) + Otherwise, load the .vo file, or fail if is missing. *) match find ".vos" with - | None -> Error LibNotFound - | Some (_, vos as resvos) -> - if (Unix.stat vos).Unix.st_size > 0 then Ok resvos else + | Some (_, vos as resvos) when (Unix.stat vos).Unix.st_size > 0 -> Ok resvos + | _ -> match find ".vo" with | None -> Error LibNotFound | Some resvo -> Ok resvo -- cgit v1.2.3