diff --git a/CHANGES b/CHANGES index 83d68149540..df1f07435db 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,25 @@ Changes prefixed with "(*)" are potentially breaking to scripts or existing repositories (changes that are automatically handled by the format upgrade tools are not marked). + +2.0.6: +* Don't remove git cache objects that may be used [#3831 @AltGr] +* Don't include .gitattributes in index.tar.gz [#3873 @dra27] +* Update FAQ uri [#3941 @dra27] +* Lock: add warning in case of missing locked file [#3939 @rjbou] +* Directory tracking: fix cached entries retrieving with precise + tracking [#4038 @hannesm] +* Build: + * Add sanity checks [#3934 @dra27] + * Build man pages using dune [#3902] #dra27] + * Add patch and bunzip check for make cold [#4006 @rjbou - fix #3842] +* Shell: + * fish: add colon for fish manpath [#3886 @rjbou - fix #3878] +* Sandbox: + * Add dune cache as rw [#4019 @rjbou - fix #4012] + * Do not fail if $HOME/.ccache is missing [#3957 @mseri] +* opam-devel file: avoid copying extraneous files in opam-devel example [#3999 @maroneze] + 2.0.5: * Bump src_ext Dune to 1.6.3, allows compilation with OCaml 4.08.0. [#3887 @dra27] * Support Dune 1.7.0 and later [#3888 @dra27 - fix #3870] diff --git a/Makefile b/Makefile index 5574a489862..71b69e4a8da 100644 --- a/Makefile +++ b/Makefile @@ -190,7 +190,7 @@ compiler: env MAKE=$(MAKE) ./shell/bootstrap-ocaml.sh $(OCAML_PORT) cold: compiler - env PATH="`pwd`/bootstrap/ocaml/bin:$$PATH" ./configure $(CONFIGURE_ARGS) + env PATH="`pwd`/bootstrap/ocaml/bin:$$PATH" ./configure --enable-cold-check $(CONFIGURE_ARGS) env PATH="`pwd`/bootstrap/ocaml/bin:$$PATH" $(MAKE) lib-ext env PATH="`pwd`/bootstrap/ocaml/bin:$$PATH" $(MAKE) diff --git a/configure b/configure index 1107e77c464..afe5901002b 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for opam 2.0.5. +# Generated by GNU Autoconf 2.69 for opam 2.0.6. # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -578,8 +578,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='opam' PACKAGE_TARNAME='opam' -PACKAGE_VERSION='2.0.5' -PACKAGE_STRING='opam 2.0.5' +PACKAGE_VERSION='2.0.6' +PACKAGE_STRING='opam 2.0.6' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -701,6 +701,7 @@ enable_checks enable_developer_mode with_mccs with_private_runtime +enable_cold_check enable_certificate_check ' ac_precious_vars='build_alias @@ -1264,7 +1265,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures opam 2.0.5 to adapt to many kinds of systems. +\`configure' configures opam 2.0.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1326,7 +1327,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of opam 2.0.5:";; + short | recursive ) echo "Configuration of opam 2.0.6:";; esac cat <<\_ACEOF @@ -1340,6 +1341,7 @@ Optional Features: --enable-developer-mode Enable developer features + --enable-cold-check Fail on some check necessary for make cold --disable-certificate-check Do not check the certificate of opam's dependency archives @@ -1429,7 +1431,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -opam configure 2.0.5 +opam configure 2.0.6 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1524,7 +1526,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by opam $as_me 2.0.5, which was +It was created by opam $as_me 2.0.6, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3169,6 +3171,12 @@ else fi +# Check whether --enable-cold_check was given. +if test "${enable_cold_check+set}" = set; then : + enableval=$enable_cold_check; COLD_CHECK=yes +fi + + if test "x" != "x$LIB_PREFIX"; then : CPATH=$CPATH:$LIB_PREFIX/include @@ -4817,6 +4825,15 @@ else fi +if test "x${COLD_CHECK}" = "xyes" ; then + if test "x$PATCH" = "x" ; then + as_fn_error $? "You must have patch installed." "$LINENO" 5 + fi + if test "x$BUNZIP2" = "x" ; then + as_fn_error $? "You must have bunzip2 installed." "$LINENO" 5 + fi +fi + if test "${OCAML_OS_TYPE}" = "Win32"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a workable solution for ln -s" >&5 @@ -6068,7 +6085,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by opam $as_me 2.0.5, which was +This file was extended by opam $as_me 2.0.6, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -6121,7 +6138,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -opam config.status 2.0.5 +opam config.status 2.0.6 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 29762b4f1c8..4b66ebbfaa2 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ dnl The line below must be formatted AC_INIT(opam,VERSION) with no extra spaces -AC_INIT(opam,2.0.5) +AC_INIT(opam,2.0.6) AC_COPYRIGHT(Copyright 2012-2017 OcamlPro SAS) AC_CONFIG_MACRO_DIR([m4]) @@ -60,6 +60,11 @@ AC_ARG_WITH([private_runtime], [For a mingw-w64 build, manifest the runtime DLLs locally in Opam.Runtime.arch]),,[with_private_runtime=no] ) +AC_ARG_ENABLE([cold_check], + AC_HELP_STRING([--enable-cold-check], + [Fail on some check necessary for make cold]),[COLD_CHECK=yes],[] +) + AS_IF([test "x" != "x$LIB_PREFIX"], [ CPATH=$CPATH:$LIB_PREFIX/include LIBRARY_PATH=$LIBRARY_PATH:$LIB_PREFIX/lib @@ -219,6 +224,15 @@ AC_CHECK_TOOL(CPPO,cppo) AC_CHECK_TOOL(PATCH,patch) AC_CHECK_TOOL(BUNZIP2,bunzip2) +if test "x${COLD_CHECK}" = "xyes" ; then + if test "x$PATCH" = "x" ; then + AC_MSG_ERROR([You must have patch installed.]) + fi + if test "x$BUNZIP2" = "x" ; then + AC_MSG_ERROR([You must have bunzip2 installed.]) + fi +fi + AS_IF([test "${OCAML_OS_TYPE}" = "Win32"],[ AC_MSG_CHECKING([for a workable solution for ln -s]) ln -s configure conftestLink diff --git a/opam-client.opam b/opam-client.opam index 4954cbe131d..589930595b7 100644 --- a/opam-client.opam +++ b/opam-client.opam @@ -1,5 +1,5 @@ opam-version: "1.2" -version: "2.0.5" +version: "2.0.6" maintainer: "opam-devel@lists.ocaml.org" authors: [ "Vincent Bernardoff " @@ -21,8 +21,8 @@ build: [ [make "%{name}%.install"] ] depends: [ - "opam-state" {= "2.0.5"} - "opam-solver" {= "2.0.5"} + "opam-state" {= "2.0.6"} + "opam-solver" {= "2.0.6"} "re" {>= "1.7.2"} "cmdliner" {>= "0.9.8"} "dune" {build & >= "1.2.1"} diff --git a/opam-core.opam b/opam-core.opam index 8bae34602a0..0692bccba7d 100644 --- a/opam-core.opam +++ b/opam-core.opam @@ -1,5 +1,5 @@ opam-version: "1.2" -version: "2.0.5" +version: "2.0.6" maintainer: "opam-devel@lists.ocaml.org" authors: [ "Vincent Bernardoff " diff --git a/opam-devel.opam b/opam-devel.opam index d6fdd521bbf..9a33941afbc 100644 --- a/opam-devel.opam +++ b/opam-devel.opam @@ -1,5 +1,5 @@ opam-version: "1.2" -version: "2.0.5" +version: "2.0.6" maintainer: "opam-devel@lists.ocaml.org" authors: [ "Vincent Bernardoff " @@ -22,13 +22,13 @@ build: [ ] build-test: [make "tests"] depends: [ - "opam-client" {= "2.0.5"} + "opam-client" {= "2.0.6"} "cmdliner" {>= "0.9.8"} "dune" {build & >= "1.2.1"} ] post-messages: [ "The development version of opam has been successfully compiled into %{lib}%/%{name}%. You should not run it from there, please install the binaries to your PATH, e.g. with - sudo cp %{lib}%/%{name}%/* /usr/local/bin + sudo cp %{lib}%/%{name}%/opam /usr/local/bin If you just want to give it a try without altering your current installation, you could use instead: alias opam2=\"OPAMROOT=~/.opam2 %{lib}%/%{name}%/opam\"" diff --git a/opam-format.opam b/opam-format.opam index 78a58cda881..fd81559556d 100644 --- a/opam-format.opam +++ b/opam-format.opam @@ -1,5 +1,5 @@ opam-version: "1.2" -version: "2.0.5" +version: "2.0.6" maintainer: "opam-devel@lists.ocaml.org" authors: [ "Vincent Bernardoff " @@ -21,7 +21,7 @@ build: [ [make "%{name}%.install"] ] depends: [ - "opam-core" {= "2.0.5"} + "opam-core" {= "2.0.6"} "opam-file-format" {>= "2.0.0~rc2"} "dune" {build & >= "1.2.1"} ] diff --git a/opam-installer.opam b/opam-installer.opam index 80985121471..72ebd300dfc 100644 --- a/opam-installer.opam +++ b/opam-installer.opam @@ -1,5 +1,5 @@ opam-version: "1.2" -version: "2.0.5" +version: "2.0.6" maintainer: "opam-devel@lists.ocaml.org" authors: [ "Vincent Bernardoff " @@ -21,7 +21,7 @@ build: [ [make "DUNE_ARGS=-p %{name}%" "%{name}%.install"] ] depends: [ - "opam-format" {= "2.0.5"} + "opam-format" {= "2.0.6"} "cmdliner" {>= "0.9.8"} "dune" {build & >= "1.2.1"} ] diff --git a/opam-repository.opam b/opam-repository.opam index 459fb04749e..8c05134870a 100644 --- a/opam-repository.opam +++ b/opam-repository.opam @@ -1,5 +1,5 @@ opam-version: "1.2" -version: "2.0.5" +version: "2.0.6" maintainer: "opam-devel@lists.ocaml.org" authors: [ "Vincent Bernardoff " @@ -21,7 +21,7 @@ build: [ [make "%{name}%.install"] ] depends: [ - "opam-format" {= "2.0.5"} + "opam-format" {= "2.0.6"} "dune" {build & >= "1.2.1"} ] available: ocaml-version >= "4.02.3" diff --git a/opam-solver.opam b/opam-solver.opam index 7df9e78bb81..3b590c1a3ce 100644 --- a/opam-solver.opam +++ b/opam-solver.opam @@ -1,5 +1,5 @@ opam-version: "1.2" -version: "2.0.5" +version: "2.0.6" maintainer: "opam-devel@lists.ocaml.org" authors: [ "Vincent Bernardoff " @@ -21,7 +21,7 @@ build: [ [make "%{name}%.install"] ] depends: [ - "opam-format" {= "2.0.5"} + "opam-format" {= "2.0.6"} "mccs" {>= "1.1+9"} "dose3" {>= "5"} "cudf" {>= "0.7"} diff --git a/opam-state.opam b/opam-state.opam index 4a9163a8b71..b1bdc3bbb5f 100644 --- a/opam-state.opam +++ b/opam-state.opam @@ -1,5 +1,5 @@ opam-version: "1.2" -version: "2.0.5" +version: "2.0.6" maintainer: "opam-devel@lists.ocaml.org" authors: [ "Vincent Bernardoff " @@ -21,7 +21,7 @@ build: [ [make "%{name}%.install"] ] depends: [ - "opam-repository" {= "2.0.5"} + "opam-repository" {= "2.0.6"} "dune" {build & >= "1.2.1"} ] available: ocaml-version >= "4.02.3" diff --git a/shell/bundle.sh b/shell/bundle.sh index 48902fb9676..ff0eb52b819 100755 --- a/shell/bundle.sh +++ b/shell/bundle.sh @@ -2,7 +2,7 @@ set -ue OCAMLV=4.04.1 -OPAMV=2.0.5 +OPAMV=2.0.6 OPAM_REPO=https://opam.ocaml.org/2.0 DEBUG= MAKESELF= diff --git a/src/client/opamCommands.ml b/src/client/opamCommands.ml index bce436804bf..a3e3c88693b 100644 --- a/src/client/opamCommands.ml +++ b/src/client/opamCommands.ml @@ -3022,7 +3022,14 @@ let clean = if download_cache then (OpamConsole.msg "Clearing cache of downloaded files\n"; rmdir (OpamPath.archives_dir root); - cleandir (OpamRepositoryPath.download_cache root)); + List.iter (fun dir -> + match OpamFilename.(Base.to_string (basename_dir dir)) with + | "git" -> + (try OpamFilename.exec dir ~name:"git gc" [["git"; "gc"]] + with e -> OpamStd.Exn.fatal e) + | _ -> cleandir dir + ) + (OpamFilename.dirs (OpamRepositoryPath.download_cache root))); if logs then (OpamConsole.msg "Clearing logs\n"; cleandir (OpamPath.log root)) diff --git a/src/client/opamConfigCommand.ml b/src/client/opamConfigCommand.ml index 4cb579c7b94..919011e64cc 100644 --- a/src/client/opamConfigCommand.ml +++ b/src/client/opamConfigCommand.ml @@ -166,7 +166,12 @@ let print_sexp_env env = let rec print_fish_env env = let set_arr_cmd k v = - let v = OpamStd.String.split v ':' in + let v = + OpamStd.String.split v ':' + |> function + | x::v' -> (":"^x)::v' + | v -> v + in OpamConsole.msg "set -gx %s %s;\n" k (OpamStd.List.concat_map " " (fun v -> diff --git a/src/core/opamDirTrack.ml b/src/core/opamDirTrack.ml index 45ed3a0ac88..00428ca2a43 100644 --- a/src/core/opamDirTrack.ml +++ b/src/core/opamDirTrack.ml @@ -60,7 +60,7 @@ let cached_digest = fun f size mtime -> try let csize, cmtime, digest = Hashtbl.find item_cache f in - if csize = size || mtime = cmtime then Digest.to_hex digest + if csize = size && mtime = cmtime then Digest.to_hex digest else raise Not_found with Not_found -> let digest = Digest.file f in diff --git a/src/repository/opamHTTP.ml b/src/repository/opamHTTP.ml index 2807fc60b09..4d1fd91448e 100644 --- a/src/repository/opamHTTP.ml +++ b/src/repository/opamHTTP.ml @@ -100,5 +100,5 @@ let make_index_tar_gz repo_root = let to_include = [ "version"; "packages"; "repo" ] in match List.filter Sys.file_exists to_include with | [] -> () - | d -> OpamSystem.command ("tar" :: "czhf" :: "index.tar.gz" :: d) + | d -> OpamSystem.command ("tar" :: "czhf" :: "index.tar.gz" :: "--exclude=.git*" :: d) ) diff --git a/src/state/shellscripts/bwrap.sh b/src/state/shellscripts/bwrap.sh index ef0c52e84dd..1021d2eb909 100755 --- a/src/state/shellscripts/bwrap.sh +++ b/src/state/shellscripts/bwrap.sh @@ -73,6 +73,12 @@ add_ccache_mount() { fi } +add_dune_cache_mount() { + DUNE_CACHE=${XDG_CACHE_HOME:-$HOME/.cache}/dune + mkdir -p ${DUNE_CACHE} + add_mounts rw $DUNE_CACHE + } + # This case-switch should remain identical between the different sandbox implems COMMAND="$1"; shift case "$COMMAND" in @@ -84,6 +90,7 @@ case "$COMMAND" in add_mounts ro "$OPAM_SWITCH_PREFIX" add_mounts rw "$PWD" add_ccache_mount + add_dune_cache_mount ;; install) # mount unusual path in ro diff --git a/src/state/shellscripts/sandbox_exec.sh b/src/state/shellscripts/sandbox_exec.sh index 4926239a4fd..6019d78f562 100644 --- a/src/state/shellscripts/sandbox_exec.sh +++ b/src/state/shellscripts/sandbox_exec.sh @@ -6,11 +6,13 @@ POL="$POL"'(allow network* (remote unix))' POL="$POL"'(allow file-write* (literal "/dev/null") (literal "/dev/dtracehelper"))' add_mounts() { - local DIR="$(cd "$2" && pwd -P)" - case "$1" in - ro) POL="$POL"'(deny file-write* (subpath "'"$DIR"'"))';; - rw) POL="$POL"'(allow file-write* (subpath "'"$DIR"'"))';; - esac + if [ -d "$2" ]; then + local DIR="$(cd "$2" && pwd -P)" + case "$1" in + ro) POL="$POL"'(deny file-write* (subpath "'"$DIR"'"))';; + rw) POL="$POL"'(allow file-write* (subpath "'"$DIR"'"))';; + esac + fi } if [ -z ${TMPDIR+x} ]; then @@ -44,6 +46,12 @@ add_ccache_mount() { fi } +add_dune_cache_mount() { + DUNE_CACHE=${XDG_CACHE_HOME:-$HOME/.cache}/dune + mkdir -p ${DUNE_CACHE} + add_mounts rw $DUNE_CACHE + } + # This case-switch should remain identical between the different sandbox implems COMMAND="$1"; shift case "$COMMAND" in @@ -51,6 +59,7 @@ case "$COMMAND" in add_mounts ro "$OPAM_SWITCH_PREFIX" add_mounts rw "$PWD" add_ccache_mount + add_dune_cache_mount ;; install) add_mounts rw "$OPAM_SWITCH_PREFIX"