aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--appveyor.yml26
-rw-r--r--dev/build/windows/appveyor.sh8
-rw-r--r--lib/control.ml6
-rw-r--r--lib/coqProject_file.ml414
-rw-r--r--lib/minisys.ml6
-rw-r--r--test-suite/Makefile11
-rwxr-xr-xtest-suite/coq-makefile/arg/run.sh4
-rwxr-xr-xtest-suite/coq-makefile/compat-subdirs/run.sh5
-rwxr-xr-xtest-suite/coq-makefile/coqdoc1/run.sh6
-rwxr-xr-xtest-suite/coq-makefile/coqdoc2/run.sh6
-rwxr-xr-xtest-suite/coq-makefile/extend-subdirs/run.sh4
-rwxr-xr-xtest-suite/coq-makefile/latex1/run.sh4
-rwxr-xr-xtest-suite/coq-makefile/merlin1/run.sh4
-rwxr-xr-xtest-suite/coq-makefile/mlpack1/run.sh6
-rwxr-xr-xtest-suite/coq-makefile/mlpack2/run.sh6
-rwxr-xr-xtest-suite/coq-makefile/multiroot/run.sh6
-rwxr-xr-xtest-suite/coq-makefile/native1/run.sh6
-rwxr-xr-xtest-suite/coq-makefile/only/run.sh4
-rwxr-xr-xtest-suite/coq-makefile/plugin-reach-outside-API-and-fail/run.sh1
-rwxr-xr-xtest-suite/coq-makefile/plugin-reach-outside-API-and-succeed-by-bypassing-the-API/run.sh1
-rwxr-xr-xtest-suite/coq-makefile/plugin1/run.sh6
-rwxr-xr-xtest-suite/coq-makefile/plugin2/run.sh6
-rwxr-xr-xtest-suite/coq-makefile/plugin3/run.sh6
-rwxr-xr-xtest-suite/coq-makefile/template/init.sh2
-rwxr-xr-xtest-suite/coq-makefile/uninstall1/run.sh6
-rwxr-xr-xtest-suite/coq-makefile/uninstall2/run.sh6
-rwxr-xr-xtest-suite/coq-makefile/validate1/run.sh4
-rwxr-xr-xtest-suite/misc/deps-order.sh2
-rw-r--r--test-suite/success/Hints.v5
-rw-r--r--tools/CoqMakefile.in61
-rw-r--r--tools/coq_makefile.ml10
-rw-r--r--tools/fake_ide.ml21
32 files changed, 151 insertions, 118 deletions
diff --git a/appveyor.yml b/appveyor.yml
new file mode 100644
index 000000000..ec6ded721
--- /dev/null
+++ b/appveyor.yml
@@ -0,0 +1,26 @@
+version: '{branch}~{build}'
+clone_depth: 10
+
+platform:
+- x64
+
+image:
+- Visual Studio 2017
+
+environment:
+ CYGROOT: C:\cygwin64
+ CYGMIRROR: http://ftp.inf.tu-dresden.de/software/windows/cygwin32
+ CYGCACHE: C:\cygwin64\var\cache\setup
+ opam_url: https://github.com/fdopen/opam-repository-mingw/releases/download/0.0.0.1/opam64.tar.xz
+
+install:
+- cmd: '%CYGROOT%\setup-x86_64.exe -qnNdO -R %CYGROOT% -l %CYGCACHE% -s
+ %CYGMIRROR% -P rsync -P patch -P diffutils -P curl -P make -P unzip -P git -p m4
+ -P perl -P findutils -P time'
+- cmd: '%CYGROOT%/bin/bash -l %APPVEYOR_BUILD_FOLDER%/dev/build/windows/appveyor.sh'
+
+build_script:
+- cmd: '%CYGROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER && ./configure -local && make"'
+
+test_script:
+- cmd: '%CYGROOT%/bin/bash -lc "cd $APPVEYOR_BUILD_FOLDER && make -C test-suite && make validate"'
diff --git a/dev/build/windows/appveyor.sh b/dev/build/windows/appveyor.sh
new file mode 100644
index 000000000..53f7a2346
--- /dev/null
+++ b/dev/build/windows/appveyor.sh
@@ -0,0 +1,8 @@
+#!/bin/bash
+set -e -x
+wget $opam_url
+tar -xf opam64.tar.xz
+bash opam64/install.sh
+opam init -a mingw https://github.com/fdopen/opam-repository-mingw.git --comp 4.02.3+mingw64c --switch 4.02.3+mingw64c
+eval $(opam config env)
+opam install -y ocamlfind camlp5
diff --git a/lib/control.ml b/lib/control.ml
index d9b91be3a..f5d7df204 100644
--- a/lib/control.ml
+++ b/lib/control.ml
@@ -48,7 +48,7 @@ let windows_timeout n f e =
let exited = ref false in
let thread init =
while not !killed do
- let cur = Unix.time () in
+ let cur = Unix.gettimeofday () in
if float_of_int n <= cur -. init then begin
interrupt := true;
exited := true;
@@ -57,12 +57,12 @@ let windows_timeout n f e =
Thread.delay 0.5
done
in
- let init = Unix.time () in
+ let init = Unix.gettimeofday () in
let _id = Thread.create thread init in
try
let res = f () in
let () = killed := true in
- let cur = Unix.time () in
+ let cur = Unix.gettimeofday () in
(** The thread did not interrupt, but the computation took longer than
expected. *)
let () = if float_of_int n <= cur -. init then begin
diff --git a/lib/coqProject_file.ml4 b/lib/coqProject_file.ml4
index bb3cbabbd..13de731f5 100644
--- a/lib/coqProject_file.ml4
+++ b/lib/coqProject_file.ml4
@@ -73,9 +73,6 @@ let rec post_canonize f =
if dir = Filename.current_dir_name then f else post_canonize dir
else f
-(* Avoid Sys.is_directory raise an exception (if the file does not exists) *)
-let is_directory f = Sys.file_exists f && Sys.is_directory f
-
(********************* parser *******************************************)
exception Parsing_error of string
@@ -106,6 +103,15 @@ let parse f =
res
;;
+(* Copy from minisys.ml, since we don't see that file here *)
+let exists_dir dir =
+ let rec strip_trailing_slash dir =
+ let len = String.length dir in
+ if len > 0 && (dir.[len-1] = '/' || dir.[len-1] = '\\')
+ then strip_trailing_slash (String.sub dir 0 (len-1)) else dir in
+ try Sys.is_directory (strip_trailing_slash dir) with Sys_error _ -> false
+
+
let process_cmd_line orig_dir proj args =
let orig_dir = (* avoids turning foo.v in ./foo.v *)
if orig_dir = "." then "" else orig_dir in
@@ -173,7 +179,7 @@ let process_cmd_line orig_dir proj args =
| f :: r ->
let f = CUnix.correct_path f orig_dir in
let proj =
- if is_directory f then { proj with subdirs = proj.subdirs @ [f] }
+ if exists_dir f then { proj with subdirs = proj.subdirs @ [f] }
else match CUnix.get_extension f with
| ".v" -> { proj with v_files = proj.v_files @ [f] }
| ".ml" -> { proj with ml_files = proj.ml_files @ [f] }
diff --git a/lib/minisys.ml b/lib/minisys.ml
index b4382a3fe..1ed017e48 100644
--- a/lib/minisys.ml
+++ b/lib/minisys.ml
@@ -44,7 +44,11 @@ let ok_dirname f =
(* Check directory can be opened *)
let exists_dir dir =
- try Sys.is_directory dir with Sys_error _ -> false
+ let rec strip_trailing_slash dir =
+ let len = String.length dir in
+ if len > 0 && (dir.[len-1] = '/' || dir.[len-1] = '\\')
+ then strip_trailing_slash (String.sub dir 0 (len-1)) else dir in
+ try Sys.is_directory (strip_trailing_slash dir) with Sys_error _ -> false
let apply_subdir f path name =
(* we avoid all files and subdirs starting by '.' (e.g. .svn) *)
diff --git a/test-suite/Makefile b/test-suite/Makefile
index 5ab4cacda..beb80a3df 100644
--- a/test-suite/Makefile
+++ b/test-suite/Makefile
@@ -27,8 +27,8 @@
# Default value when called from a freshly compiled Coq, but can be
# easily overridden
-LIB := $(shell cd ..; pwd)
-BIN := $(LIB)/bin/
+LIB := ..
+BIN := $(shell cd ..; pwd)/bin/
coqtop := $(BIN)coqtop -coqlib $(LIB) -boot -q -batch -test-mode -R prerequisite TestSuite
coqc := $(BIN)coqc -coqlib $(LIB) -R prerequisite TestSuite
@@ -170,6 +170,7 @@ summary.log:
report: summary.log
$(HIDE)./save-logs.sh
$(HIDE)if [ -n "${TRAVIS}" ]; then find logs/ -name '*.log' -not -name 'summary.log' -exec 'bash' '-c' 'echo "travis_fold:start:coq.logs.$$(echo '{}' | sed s,/,.,g)"' ';' -exec cat '{}' ';' -exec 'bash' '-c' 'echo "travis_fold:end:coq.logs.$$(echo '{}' | sed s,/,.,g)"' ';'; fi
+ $(HIDE)if [ -n "${APPVEYOR}" ]; then find logs/ -name '*.log' -not -name 'summary.log' -exec 'bash' '-c' 'echo {}' ';' -exec cat '{}' ';' -exec 'bash' '-c' 'echo' ';'; fi
$(HIDE)if grep -q -F 'Error!' summary.log ; then echo FAILURES; grep -F 'Error!' summary.log; false; else echo NO FAILURES; fi
#######################################################################
@@ -293,7 +294,7 @@ $(addsuffix .log,$(wildcard output/*.v)): %.v.log: %.v %.out $(PREREQUISITELOG)
| grep -v "^<W>" \
| sed 's/File "[^"]*"/File "stdin"/' \
> $$tmpoutput; \
- diff -u $*.out $$tmpoutput 2>&1; R=$$?; times; \
+ diff -u --strip-trailing-cr $*.out $$tmpoutput 2>&1; R=$$?; times; \
if [ $$R = 0 ]; then \
echo $(log_success); \
echo " $<...Ok"; \
@@ -328,7 +329,7 @@ $(addsuffix .log,$(wildcard output-modulo-time/*.v)): %.v.log: %.v %.out
-e 's/\s*[-+]inf\s*//g' \
-e 's/^[^a-zA-Z]*//' \
$*.out | sort > $$tmpexpected; \
- diff -b -u $$tmpexpected $$tmpoutput 2>&1; R=$$?; times; \
+ diff --strip-trailing-cr -b -u $$tmpexpected $$tmpoutput 2>&1; R=$$?; times; \
if [ $$R = 0 ]; then \
echo $(log_success); \
echo " $<...Ok"; \
@@ -445,7 +446,7 @@ ide : $(patsubst %.fake,%.fake.log,$(wildcard ide/*.fake))
@echo "TEST $<"
$(HIDE){ \
echo $(call log_intro,$<); \
- $(BIN)fake_ide $< "$(BIN)coqtop -coqlib $(LIB) -boot -async-proofs on -async-proofs-tactic-error-resilience off -async-proofs-command-error-resilience off" 2>&1; \
+ $(BIN)fake_ide $< "-coqlib $(LIB) -boot -async-proofs on -async-proofs-tactic-error-resilience off -async-proofs-command-error-resilience off" 2>&1; \
if [ $$? = 0 ]; then \
echo $(log_success); \
echo " $<...Ok"; \
diff --git a/test-suite/coq-makefile/arg/run.sh b/test-suite/coq-makefile/arg/run.sh
index e98da17c7..e7de90ff2 100755
--- a/test-suite/coq-makefile/arg/run.sh
+++ b/test-suite/coq-makefile/arg/run.sh
@@ -1,9 +1,7 @@
#!/usr/bin/env bash
-#set -x
-set -e
-
. ../template/init.sh
coq_makefile -f _CoqProject -o Makefile
+cat Makefile.conf
make
diff --git a/test-suite/coq-makefile/compat-subdirs/run.sh b/test-suite/coq-makefile/compat-subdirs/run.sh
index 28d9878f9..221dcd7bf 100755
--- a/test-suite/coq-makefile/compat-subdirs/run.sh
+++ b/test-suite/coq-makefile/compat-subdirs/run.sh
@@ -1,9 +1,8 @@
#!/usr/bin/env bash
-#set -x
-set -e
-
. ../template/init.sh
+
coq_makefile -f _CoqProject -o Makefile
+cat Makefile.conf
make
exec test -f "subdir/done"
diff --git a/test-suite/coq-makefile/coqdoc1/run.sh b/test-suite/coq-makefile/coqdoc1/run.sh
index e8291c89d..1feff7479 100755
--- a/test-suite/coq-makefile/coqdoc1/run.sh
+++ b/test-suite/coq-makefile/coqdoc1/run.sh
@@ -1,17 +1,15 @@
#!/usr/bin/env bash
-#set -x
-set -e
-
. ../template/init.sh
coq_makefile -f _CoqProject -o Makefile
+cat Makefile.conf
make
make html mlihtml
make install DSTROOT="$PWD/tmp"
make install-doc DSTROOT="$PWD/tmp"
#make debug
-(for d in `find tmp -name user-contrib`; do pushd $d >/dev/null; find .; popd >/dev/null; done) | sort -u > actual
+(for d in `find tmp -name user-contrib` ; do pushd $d >/dev/null && find . && popd >/dev/null; done) | sort -u > actual
sort -u > desired <<EOT
.
./test
diff --git a/test-suite/coq-makefile/coqdoc2/run.sh b/test-suite/coq-makefile/coqdoc2/run.sh
index e8291c89d..1feff7479 100755
--- a/test-suite/coq-makefile/coqdoc2/run.sh
+++ b/test-suite/coq-makefile/coqdoc2/run.sh
@@ -1,17 +1,15 @@
#!/usr/bin/env bash
-#set -x
-set -e
-
. ../template/init.sh
coq_makefile -f _CoqProject -o Makefile
+cat Makefile.conf
make
make html mlihtml
make install DSTROOT="$PWD/tmp"
make install-doc DSTROOT="$PWD/tmp"
#make debug
-(for d in `find tmp -name user-contrib`; do pushd $d >/dev/null; find .; popd >/dev/null; done) | sort -u > actual
+(for d in `find tmp -name user-contrib` ; do pushd $d >/dev/null && find . && popd >/dev/null; done) | sort -u > actual
sort -u > desired <<EOT
.
./test
diff --git a/test-suite/coq-makefile/extend-subdirs/run.sh b/test-suite/coq-makefile/extend-subdirs/run.sh
index ea5792a93..221dcd7bf 100755
--- a/test-suite/coq-makefile/extend-subdirs/run.sh
+++ b/test-suite/coq-makefile/extend-subdirs/run.sh
@@ -1,10 +1,8 @@
#!/usr/bin/env bash
-#set -x
-set -e
-
. ../template/init.sh
coq_makefile -f _CoqProject -o Makefile
+cat Makefile.conf
make
exec test -f "subdir/done"
diff --git a/test-suite/coq-makefile/latex1/run.sh b/test-suite/coq-makefile/latex1/run.sh
index 214a9d5b2..b2c5d5669 100755
--- a/test-suite/coq-makefile/latex1/run.sh
+++ b/test-suite/coq-makefile/latex1/run.sh
@@ -1,13 +1,11 @@
#!/usr/bin/env bash
-#set -x
-set -e
-
if which pdflatex; then
. ../template/init.sh
coq_makefile -f _CoqProject -o Makefile
+cat Makefile.conf
make
exec make all.pdf
diff --git a/test-suite/coq-makefile/merlin1/run.sh b/test-suite/coq-makefile/merlin1/run.sh
index 752c0c2ce..1f262a939 100755
--- a/test-suite/coq-makefile/merlin1/run.sh
+++ b/test-suite/coq-makefile/merlin1/run.sh
@@ -1,11 +1,9 @@
#!/usr/bin/env bash
-#set -x
-set -e
-
. ../template/init.sh
coq_makefile -f _CoqProject -o Makefile
+cat Makefile.conf
make .merlin
cat > desired <<EOT
B src
diff --git a/test-suite/coq-makefile/mlpack1/run.sh b/test-suite/coq-makefile/mlpack1/run.sh
index 10a200dde..51669f28f 100755
--- a/test-suite/coq-makefile/mlpack1/run.sh
+++ b/test-suite/coq-makefile/mlpack1/run.sh
@@ -1,16 +1,14 @@
#!/usr/bin/env bash
-#set -x
-set -e
-
. ../template/init.sh
coq_makefile -f _CoqProject -o Makefile
+cat Makefile.conf
make
make html mlihtml
make install DSTROOT="$PWD/tmp"
#make debug
-(cd `find tmp -name user-contrib`; find .) | sort > actual
+(cd `find tmp -name user-contrib` && find .) | sort > actual
sort > desired <<EOT
.
./test
diff --git a/test-suite/coq-makefile/mlpack2/run.sh b/test-suite/coq-makefile/mlpack2/run.sh
index 10a200dde..51669f28f 100755
--- a/test-suite/coq-makefile/mlpack2/run.sh
+++ b/test-suite/coq-makefile/mlpack2/run.sh
@@ -1,16 +1,14 @@
#!/usr/bin/env bash
-#set -x
-set -e
-
. ../template/init.sh
coq_makefile -f _CoqProject -o Makefile
+cat Makefile.conf
make
make html mlihtml
make install DSTROOT="$PWD/tmp"
#make debug
-(cd `find tmp -name user-contrib`; find .) | sort > actual
+(cd `find tmp -name user-contrib` && find .) | sort > actual
sort > desired <<EOT
.
./test
diff --git a/test-suite/coq-makefile/multiroot/run.sh b/test-suite/coq-makefile/multiroot/run.sh
index 3cd1ac305..d3bb53106 100755
--- a/test-suite/coq-makefile/multiroot/run.sh
+++ b/test-suite/coq-makefile/multiroot/run.sh
@@ -1,19 +1,17 @@
#!/usr/bin/env bash
-#set -x
-set -e
-
. ../template/init.sh
cp -r theories theories2
mv src/test_plugin.mlpack src/test_plugin.mllib
coq_makefile -f _CoqProject -o Makefile
+cat Makefile.conf
make
make html mlihtml
make install DSTROOT="$PWD/tmp"
make install-doc DSTROOT="$PWD/tmp"
#make debug
-(for d in `find tmp -name user-contrib`; do pushd $d >/dev/null; find .; popd >/dev/null; done) | sort -u > actual
+(for d in `find tmp -name user-contrib` ; do pushd $d >/dev/null && find . && popd >/dev/null; done) | sort -u > actual
sort > desired <<EOT
.
./test
diff --git a/test-suite/coq-makefile/native1/run.sh b/test-suite/coq-makefile/native1/run.sh
index 9f6295d64..3bec11cb7 100755
--- a/test-suite/coq-makefile/native1/run.sh
+++ b/test-suite/coq-makefile/native1/run.sh
@@ -1,19 +1,17 @@
#!/usr/bin/env bash
-#set -x
-set -e
-
NATIVECOMP=`grep "let no_native_compiler = false" ../../../config/coq_config.ml`||true
if [[ `which ocamlopt` && $NATIVECOMP ]]; then
. ../template/init.sh
coq_makefile -f _CoqProject -o Makefile
+cat Makefile.conf
make
make html mlihtml
make install DSTROOT="$PWD/tmp"
#make debug
-(cd `find tmp -name user-contrib`; find .) | sort > actual
+(cd `find tmp -name user-contrib` && find .) | sort > actual
sort > desired <<EOT
.
./test
diff --git a/test-suite/coq-makefile/only/run.sh b/test-suite/coq-makefile/only/run.sh
index 2ea3deffb..8cf04bf2c 100755
--- a/test-suite/coq-makefile/only/run.sh
+++ b/test-suite/coq-makefile/only/run.sh
@@ -1,11 +1,9 @@
#!/usr/bin/env bash
-#set -x
-set -e
-
. ../template/init.sh
coq_makefile -f _CoqProject -o Makefile
+cat Makefile.conf
make only TGTS="src/test.cmi src/test_aux.cmi" -j2
test -f src/test.cmi
test -f src/test_aux.cmi
diff --git a/test-suite/coq-makefile/plugin-reach-outside-API-and-fail/run.sh b/test-suite/coq-makefile/plugin-reach-outside-API-and-fail/run.sh
index 6301aa03c..88606cd47 100755
--- a/test-suite/coq-makefile/plugin-reach-outside-API-and-fail/run.sh
+++ b/test-suite/coq-makefile/plugin-reach-outside-API-and-fail/run.sh
@@ -27,6 +27,7 @@ let _ = Pre_env.empty_env
EOT
${COQBIN}coq_makefile -f _CoqProject -o Makefile
+cat Makefile.conf
if make VERBOSE=1; then
# make command should have failed (but didn't)
diff --git a/test-suite/coq-makefile/plugin-reach-outside-API-and-succeed-by-bypassing-the-API/run.sh b/test-suite/coq-makefile/plugin-reach-outside-API-and-succeed-by-bypassing-the-API/run.sh
index 991fb4a61..939ef9c7b 100755
--- a/test-suite/coq-makefile/plugin-reach-outside-API-and-succeed-by-bypassing-the-API/run.sh
+++ b/test-suite/coq-makefile/plugin-reach-outside-API-and-succeed-by-bypassing-the-API/run.sh
@@ -28,5 +28,6 @@ let _ = Pre_env.empty_env
EOT
${COQBIN}coq_makefile -f _CoqProject -o Makefile
+cat Makefile.conf
make VERBOSE=1
diff --git a/test-suite/coq-makefile/plugin1/run.sh b/test-suite/coq-makefile/plugin1/run.sh
index c2d47166f..5433d9e92 100755
--- a/test-suite/coq-makefile/plugin1/run.sh
+++ b/test-suite/coq-makefile/plugin1/run.sh
@@ -1,17 +1,15 @@
#!/usr/bin/env bash
-#set -x
-set -e
-
. ../template/init.sh
mv src/test_plugin.mlpack src/test_plugin.mllib
coq_makefile -f _CoqProject -o Makefile
+cat Makefile.conf
make
make html mlihtml
make install DSTROOT="$PWD/tmp"
#make debug
-(cd `find tmp -name user-contrib`; find .) | sort > actual
+(cd `find tmp -name user-contrib` && find .) | sort > actual
sort > desired <<EOT
.
./test
diff --git a/test-suite/coq-makefile/plugin2/run.sh b/test-suite/coq-makefile/plugin2/run.sh
index c2d47166f..5433d9e92 100755
--- a/test-suite/coq-makefile/plugin2/run.sh
+++ b/test-suite/coq-makefile/plugin2/run.sh
@@ -1,17 +1,15 @@
#!/usr/bin/env bash
-#set -x
-set -e
-
. ../template/init.sh
mv src/test_plugin.mlpack src/test_plugin.mllib
coq_makefile -f _CoqProject -o Makefile
+cat Makefile.conf
make
make html mlihtml
make install DSTROOT="$PWD/tmp"
#make debug
-(cd `find tmp -name user-contrib`; find .) | sort > actual
+(cd `find tmp -name user-contrib` && find .) | sort > actual
sort > desired <<EOT
.
./test
diff --git a/test-suite/coq-makefile/plugin3/run.sh b/test-suite/coq-makefile/plugin3/run.sh
index c2d47166f..5433d9e92 100755
--- a/test-suite/coq-makefile/plugin3/run.sh
+++ b/test-suite/coq-makefile/plugin3/run.sh
@@ -1,17 +1,15 @@
#!/usr/bin/env bash
-#set -x
-set -e
-
. ../template/init.sh
mv src/test_plugin.mlpack src/test_plugin.mllib
coq_makefile -f _CoqProject -o Makefile
+cat Makefile.conf
make
make html mlihtml
make install DSTROOT="$PWD/tmp"
#make debug
-(cd `find tmp -name user-contrib`; find .) | sort > actual
+(cd `find tmp -name user-contrib` && find .) | sort > actual
sort > desired <<EOT
.
./test
diff --git a/test-suite/coq-makefile/template/init.sh b/test-suite/coq-makefile/template/init.sh
index c952d41a3..803fe8029 100755
--- a/test-suite/coq-makefile/template/init.sh
+++ b/test-suite/coq-makefile/template/init.sh
@@ -1,3 +1,5 @@
+set -e
+set -o pipefail
export PATH=$COQBIN:$PATH
diff --git a/test-suite/coq-makefile/uninstall1/run.sh b/test-suite/coq-makefile/uninstall1/run.sh
index e525e1208..5354f794f 100755
--- a/test-suite/coq-makefile/uninstall1/run.sh
+++ b/test-suite/coq-makefile/uninstall1/run.sh
@@ -1,11 +1,9 @@
#!/usr/bin/env bash
-#set -x
-set -e
-
. ../template/init.sh
coq_makefile -f _CoqProject -o Makefile
+cat Makefile.conf
make
make html mlihtml
make install DSTROOT="$PWD/tmp"
@@ -13,7 +11,7 @@ make install-doc DSTROOT="$PWD/tmp"
make uninstall DSTROOT="$PWD/tmp"
make uninstall-doc DSTROOT="$PWD/tmp"
#make debug
-(for d in `find tmp -name user-contrib`; do pushd $d >/dev/null; find .; popd >/dev/null; done) | sort -u > actual
+(for d in `find tmp -name user-contrib` ; do pushd $d >/dev/null && find . && popd >/dev/null; done) | sort -u > actual
sort -u > desired <<EOT
.
EOT
diff --git a/test-suite/coq-makefile/uninstall2/run.sh b/test-suite/coq-makefile/uninstall2/run.sh
index e525e1208..5354f794f 100755
--- a/test-suite/coq-makefile/uninstall2/run.sh
+++ b/test-suite/coq-makefile/uninstall2/run.sh
@@ -1,11 +1,9 @@
#!/usr/bin/env bash
-#set -x
-set -e
-
. ../template/init.sh
coq_makefile -f _CoqProject -o Makefile
+cat Makefile.conf
make
make html mlihtml
make install DSTROOT="$PWD/tmp"
@@ -13,7 +11,7 @@ make install-doc DSTROOT="$PWD/tmp"
make uninstall DSTROOT="$PWD/tmp"
make uninstall-doc DSTROOT="$PWD/tmp"
#make debug
-(for d in `find tmp -name user-contrib`; do pushd $d >/dev/null; find .; popd >/dev/null; done) | sort -u > actual
+(for d in `find tmp -name user-contrib` ; do pushd $d >/dev/null && find . && popd >/dev/null; done) | sort -u > actual
sort -u > desired <<EOT
.
EOT
diff --git a/test-suite/coq-makefile/validate1/run.sh b/test-suite/coq-makefile/validate1/run.sh
index aaa4194b3..43bf39de1 100755
--- a/test-suite/coq-makefile/validate1/run.sh
+++ b/test-suite/coq-makefile/validate1/run.sh
@@ -1,10 +1,8 @@
#!/usr/bin/env bash
-#set -x
-set -e
-
. ../template/init.sh
coq_makefile -f _CoqProject -o Makefile
+cat Makefile.conf
make
exec make validate
diff --git a/test-suite/misc/deps-order.sh b/test-suite/misc/deps-order.sh
index 00c5eb1bd..299f49469 100755
--- a/test-suite/misc/deps-order.sh
+++ b/test-suite/misc/deps-order.sh
@@ -4,7 +4,7 @@
rm -f misc/deps/lib/*.vo misc/deps/client/*.vo
tmpoutput=`mktemp /tmp/coqcheck.XXXXXX`
$coqdep -R misc/deps/lib lib -R misc/deps/client client misc/deps/client/bar.v 2>&1 | head -n 1 > $tmpoutput
-diff -u misc/deps/deps.out $tmpoutput 2>&1
+diff -u --strip-trailing-cr misc/deps/deps.out $tmpoutput 2>&1
R=$?
times
$coqc -R misc/deps/lib lib misc/deps/lib/foo.v 2>&1
diff --git a/test-suite/success/Hints.v b/test-suite/success/Hints.v
index 1abe14774..6962e43e7 100644
--- a/test-suite/success/Hints.v
+++ b/test-suite/success/Hints.v
@@ -37,7 +37,6 @@ Hint Resolve predf | 0 : predconv.
Goal exists n, pred n.
eexists.
- Fail Timeout 1 typeclasses eauto with pred.
Set Typeclasses Filtered Unification.
Set Typeclasses Debug Verbosity 2.
(* predf is not tried as it doesn't match the goal *)
@@ -80,8 +79,6 @@ Qed.
(** The other way around: goal contains redexes instead of instances *)
Goal exists n, pred (0 + n).
eexists.
- (* predf is applied indefinitely *)
- Fail Timeout 1 typeclasses eauto with pred.
(* pred0 (pred _) matches the goal *)
typeclasses eauto with predconv.
Qed.
@@ -169,8 +166,6 @@ Instance foo f :
E (id ∘ id ∘ id ∘ id ∘ id ∘ id ∘ id ∘ id ∘ id ∘ id ∘ id ∘ id ∘ id ∘ id ∘ id ∘
id ∘ id ∘ id ∘ id ∘ id ∘ f ∘ id ∘ id ∘ id ∘ id ∘ id ∘ id ∘ id).
Proof.
- Fail Timeout 1 apply _. (* 3.7s *)
-
Hint Cut [_* (a_is_b | b_is_c | c_is_d | d_is_e)
(a_compose | b_compose | c_compose | d_compose | e_compose)] : typeclass_instances.
diff --git a/tools/CoqMakefile.in b/tools/CoqMakefile.in
index 7d281977a..f1e519d03 100644
--- a/tools/CoqMakefile.in
+++ b/tools/CoqMakefile.in
@@ -87,6 +87,9 @@ COQDEP ?= "$(COQBIN)coqdep"
GALLINA ?= "$(COQBIN)gallina"
COQDOC ?= "$(COQBIN)coqdoc"
COQMKTOP ?= "$(COQBIN)coqmktop"
+COQMKFILE ?= "$(COQBIN)coq_makefile"
+
+# Timing scripts
COQMAKE_ONE_TIME_FILE ?= "$(COQLIB)/tools/make-one-time-file.py"
COQMAKE_BOTH_TIME_FILES ?= "$(COQLIB)/tools/make-both-time-files.py"
COQMAKE_BOTH_SINGLE_TIMING_FILES ?= "$(COQLIB)/tools/make-both-single-timing-files.py"
@@ -181,10 +184,6 @@ endif
PP:=-pp '$(CAMLP4O) -I $(CAMLLIB) -I "$(COQLIB)/grammar" compat5.cmo $(CAMLP4EXTEND) $(GRAMMARS) $(CAMLP4OPTIONS) -impl'
-COQLIBINSTALL = $(COQLIB)user-contrib
-COQDOCINSTALL = $(DOCDIR)user-contrib
-COQTOPINSTALL = $(COQLIB)toploop
-
ifneq (,$(TIMING))
TIMING_ARG=-time
ifeq (after,$(TIMING))
@@ -205,6 +204,12 @@ ifneq "$(DSTROOT)" ""
DESTDIR := $(DSTROOT)
endif
+concat_path = $(if $(1),$(1)/$(subst $(COQMF_WINDRIVE),/,$(2)),$(2))
+
+COQLIBINSTALL = $(call concat_path,$(DESTDIR),$(COQLIB)user-contrib)
+COQDOCINSTALL = $(call concat_path,$(DESTDIR),$(DOCDIR)user-contrib)
+COQTOPINSTALL = $(call concat_path,$(DESTDIR),$(COQLIB)toploop)
+
# Files #######################################################################
#
# We here define a bunch of variables about the files being part of the
@@ -437,13 +442,13 @@ beautify: $(BEAUTYFILES)
install: install-extra
$(HIDE)for f in $(FILESTOINSTALL); do\
- df="`$(COQMF_MAKEFILE) -destination-of "$$f" $(COQLIBS)`";\
- if [ -z "$$df" ]; then\
+ df="`$(COQMKFILE) -destination-of "$$f" $(COQLIBS)`";\
+ if [ "$$?" != "0" -o -z "$$df" ]; then\
echo SKIP "$$f" since it has no logical path;\
else\
- install -d "$(DESTDIR)$(COQLIBINSTALL)/$$df"; \
- install -m 0644 "$$f" "$(DESTDIR)$(COQLIBINSTALL)/$$df"; \
- echo INSTALL "$$f" "$(DESTDIR)$(COQLIBINSTALL)/$$df";\
+ install -d "$(COQLIBINSTALL)/$$df" &&\
+ install -m 0644 "$$f" "$(COQLIBINSTALL)/$$df" &&\
+ echo INSTALL "$$f" "$(COQLIBINSTALL)/$$df";\
fi;\
done
install-extra::
@@ -452,28 +457,28 @@ install-extra::
install-byte:
$(HIDE)for f in $(BYTEFILESTOINSTALL); do\
- df="`$(COQMF_MAKEFILE) -destination-of "$$f" $(COQLIBS)`";\
- if [ -z "$$df" ]; then\
+ df="`$(COQMKFILE) -destination-of "$$f" $(COQLIBS)`";\
+ if [ "$$?" != "0" -o -z "$$df" ]; then\
echo SKIP "$$f" since it has no logical path;\
else\
- install -d "$(DESTDIR)$(COQLIBINSTALL)/$$df"; \
- install -m 0644 "$$f" "$(DESTDIR)$(COQLIBINSTALL)/$$df"; \
- echo INSTALL "$$f" "$(DESTDIR)$(COQLIBINSTALL)/$$df";\
+ install -d "$(COQLIBINSTALL)/$$df" &&\
+ install -m 0644 "$$f" "$(COQLIBINSTALL)/$$df" &&\
+ echo INSTALL "$$f" "$(COQLIBINSTALL)/$$df";\
fi;\
done
install-doc:: html mlihtml
@# Extension point
- $(HIDE)install -d "$(DESTDIR)$(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/html"
+ $(HIDE)install -d "$(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/html"
$(HIDE)for i in html/*; do \
- dest="$(DESTDIR)$(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/$$i";\
+ dest="$(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/$$i";\
install -m 0644 "$$i" "$$dest";\
echo INSTALL "$$i" "$$dest";\
done
$(HIDE)install -d \
- "$(DESTDIR)$(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/mlihtml"
+ "$(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/mlihtml"
$(HIDE)for i in mlihtml/*; do \
- dest="$(DESTDIR)$(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/$$i";\
+ dest="$(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/$$i";\
install -m 0644 "$$i" "$$dest";\
echo INSTALL "$$i" "$$dest";\
done
@@ -482,21 +487,21 @@ install-doc:: html mlihtml
uninstall::
@# Extension point
$(HIDE)for f in $(FILESTOINSTALL); do \
- df="`$(COQMF_MAKEFILE) -destination-of "$$f" $(COQLIBS)`";\
- instf="$(DESTDIR)$(COQLIBINSTALL)/$$df/`basename $$f`"; \
- rm -f "$$instf";\
- echo RM "$$instf"; \
- rmdir "$(DESTDIR)$(COQLIBINSTALL)/$$df/" || true; \
+ df="`$(COQMKFILE) -destination-of "$$f" $(COQLIBS)`" &&\
+ instf="$(COQLIBINSTALL)/$$df/`basename $$f`" &&\
+ rm -f "$$instf" &&\
+ echo RM "$$instf" &&\
+ (rmdir "$(call concat_path,,$(COQLIBINSTALL)/$$df/)" || true); \
done
.PHONY: uninstall
uninstall-doc::
@# Extension point
- $(SHOW)'RM $(DESTDIR)$(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/html'
- $(HIDE)rm -rf "$(DESTDIR)$(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/html"
- $(SHOW)'RM $(DESTDIR)$(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/mlihtml'
- $(HIDE)rm -rf "$(DESTDIR)$(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/mlihtml"
- $(HIDE) rmdir "$(DESTDIR)$(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/" || true
+ $(SHOW)'RM $(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/html'
+ $(HIDE)rm -rf "$(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/html"
+ $(SHOW)'RM $(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/mlihtml'
+ $(HIDE)rm -rf "$(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/mlihtml"
+ $(HIDE) rmdir "$(COQDOCINSTALL)/$(INSTALLCOQDOCROOT)/" || true
.PHONY: uninstall-doc
# Cleaning ####################################################################
diff --git a/tools/coq_makefile.ml b/tools/coq_makefile.ml
index c3aedf538..327f53520 100644
--- a/tools/coq_makefile.ml
+++ b/tools/coq_makefile.ml
@@ -118,7 +118,7 @@ let makefile_template =
let template = "/tools/CoqMakefile.in" in
Coq_config.coqlib ^ template
-let quote s = if String.contains s ' ' then "\"" ^ s ^ "\"" else s
+let quote s = if String.contains s ' ' then "'" ^ s ^ "'" else s
let generate_makefile oc conf_file local_file args project =
let s = read_whole_file makefile_template in
@@ -193,13 +193,19 @@ let generate_conf_includes oc { ml_includes; r_includes; q_includes } =
(S.concat " " (map (fun ({ path },l) -> dash2 "R" path l) r_includes))
;;
+let windrive s =
+ if Coq_config.arch_is_win32 && Str.(string_match (regexp "^[a-zA-Z]:") s 0)
+ then Str.matched_string s
+ else s
+;;
+
let generate_conf_coq_config oc args bypass_API =
section oc "Coq configuration.";
let src_dirs = if bypass_API
then Coq_config.all_src_dirs
else Coq_config.api_dirs @ Coq_config.plugins_dirs @ ["-open API"] in
Envars.print_config ~prefix_var_name:"COQMF_" oc src_dirs;
- fprintf oc "COQMF_MAKEFILE=%s\n" (quote (List.hd args));
+ fprintf oc "COQMF_WINDRIVE=%s\n" (windrive Coq_config.coqlib)
;;
let generate_conf_files oc
diff --git a/tools/fake_ide.ml b/tools/fake_ide.ml
index c0d2e4d6b..a9da27ba2 100644
--- a/tools/fake_ide.ml
+++ b/tools/fake_ide.ml
@@ -293,15 +293,28 @@ let usage () =
module Coqide = Spawn.Sync(struct end)
let main =
- Sys.set_signal Sys.sigpipe
+ if Sys.os_type = "Unix" then Sys.set_signal Sys.sigpipe
(Sys.Signal_handle
(fun _ -> prerr_endline "Broken Pipe (coqtop died ?)"; exit 1));
let def_args = ["--xml_format=Ppcmds"; "-ideslave"] in
- let coqtop_name, coqtop_args, input_file = match Sys.argv with
- | [| _; f |] -> "coqtop", Array.of_list def_args, f
+ let coqtop_name = (* from ide/ideutils.ml *)
+ let prog_name = "fake_ide" in
+ let len_prog_name = String.length prog_name in
+ let fake_ide_path = Sys.executable_name in
+ let fake_ide_path_len = String.length fake_ide_path in
+ let pos = fake_ide_path_len - len_prog_name in
+ let rex = Str.regexp_string prog_name in
+ try
+ let i = Str.search_backward rex fake_ide_path pos in
+ String.sub fake_ide_path 0 i ^ "coqtop" ^
+ String.sub fake_ide_path (i + len_prog_name)
+ (fake_ide_path_len - i - len_prog_name)
+ with Not_found -> assert false in
+ let coqtop_args, input_file = match Sys.argv with
+ | [| _; f |] -> Array.of_list def_args, f
| [| _; f; ct |] ->
let ct = Str.split (Str.regexp " ") ct in
- List.hd ct, Array.of_list (def_args @ List.tl ct), f
+ Array.of_list (def_args @ ct), f
| _ -> usage () in
let inc = if input_file = "-" then stdin else open_in input_file in
let coq =