From f48d614380e723b8286b2a1444d662909fd1fa74 Mon Sep 17 00:00:00 2001 From: Kate Date: Thu, 28 Mar 2024 13:08:46 +0000 Subject: [PATCH] Disable Software Heritage fallbacks by default See https://github.com/ocaml/opam/issues/5720 --- master_changes.md | 1 + src/format/opamFile.ml | 2 +- tests/reftests/init.test | 6 +-- tests/reftests/opamroot-versions.test | 60 +++++++++++++-------------- tests/reftests/swhid.unix.test | 2 +- tests/reftests/var-option.test | 6 +-- 6 files changed, 39 insertions(+), 38 deletions(-) diff --git a/master_changes.md b/master_changes.md index 26ecc54741d..95d37bf6d0e 100644 --- a/master_changes.md +++ b/master_changes.md @@ -47,6 +47,7 @@ users) ## Show ## Var/Option + * Disable Software Heritage fallbacks by default [#5899 @kit-ty-kate] ## Update / Upgrade diff --git a/src/format/opamFile.ml b/src/format/opamFile.ml index 947e61d7bf5..ede1bba5211 100644 --- a/src/format/opamFile.ml +++ b/src/format/opamFile.ml @@ -1533,7 +1533,7 @@ module ConfigSyntax = struct depext_bypass = OpamSysPkg.Set.empty; sys_pkg_manager_cmd = OpamStd.String.Map.empty; git_location = None; - swh_fallback = true; + swh_fallback = false; } (* When adding a field, make sure to add it in diff --git a/tests/reftests/init.test b/tests/reftests/init.test index ff1b8c91d05..088b1591fda 100644 --- a/tests/reftests/init.test +++ b/tests/reftests/init.test @@ -117,7 +117,7 @@ eval-variables: [[sys-ocaml-version ["ocamlc" "-vnum"] "OCaml version present on opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false wrap-build-commands: ["%{hooks}%/sandbox.sh" "build"] {os = "linux" | os = "macos"} wrap-install-commands: ["%{hooks}%/sandbox.sh" "install"] {os = "linux" | os = "macos"} wrap-remove-commands: ["%{hooks}%/sandbox.sh" "remove"] {os = "linux" | os = "macos"} @@ -189,7 +189,7 @@ solver: "a-solver" solver-criteria: "solver-criteri" solver-fixup-criteria: "fixup-criteri" solver-upgrade-criteria: "upgrade-criteri" -swh-fallback: true +swh-fallback: false wrap-build-commands: ["%{hooks}%/a-script.sh" "wrap-build"] wrap-install-commands: ["%{hooks}%/a-script.sh" "wrap-install"] wrap-remove-commands: ["%{hooks}%/a-script.sh" "wrap-remove"] @@ -243,7 +243,7 @@ opam-version: "2.0" post-session-commands: ["%{hooks}%/a-script.sh" "post-session"] pre-build-commands: ["%{hooks}%/a-script.sh" "pre-build"] repositories: "norepo" -swh-fallback: true +swh-fallback: false wrap-build-commands: ["%{hooks}%/sandbox.sh" "build"] {os = "linux" | os = "macos"} wrap-install-commands: ["%{hooks}%/a-script.sh" "wrap-install"] wrap-remove-commands: ["%{hooks}%/sandbox.sh" "remove"] {os = "linux" | os = "macos"} diff --git a/tests/reftests/opamroot-versions.test b/tests/reftests/opamroot-versions.test index de7f948675f..712bd6e0f1d 100644 --- a/tests/reftests/opamroot-versions.test +++ b/tests/reftests/opamroot-versions.test @@ -755,7 +755,7 @@ installed-switches: ["sw-comp" "sw-sys-comp" "default"] opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-comp" ### opam-cat $OPAMROOT/repo/repos-config opam-version: "2.0" @@ -835,7 +835,7 @@ jobs: 4 opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" ### opam-cat $OPAMROOT/repo/repos-config opam-version: "2.0" @@ -916,7 +916,7 @@ jobs: 4 opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" ### opam-cat $OPAMROOT/repo/repos-config opam-version: "2.0" @@ -983,7 +983,7 @@ jobs: 4 opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" ### opam-cat $OPAMROOT/repo/repos-config opam-version: "2.0" @@ -1050,7 +1050,7 @@ installed-switches: ["sw-sys-comp" "sw-comp" "default"] opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" wrap-build-commands: ["%{hooks}%/sandbox.sh" "build"] {os = "linux" | os = "macos"} wrap-install-commands: ["%{hooks}%/sandbox.sh" "install"] {os = "linux" | os = "macos"} @@ -1125,7 +1125,7 @@ installed-switches: ["sw-comp" "sw-sys-comp" "default"] opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-comp" wrap-build-commands: ["%{hooks}%/sandbox.sh" "build"] {os = "linux" | os = "macos"} wrap-install-commands: ["%{hooks}%/sandbox.sh" "install"] {os = "linux" | os = "macos"} @@ -1197,7 +1197,7 @@ installed-switches: ["sw-sys-comp" "sw-comp" "${BASEDIR}" "default"] opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" wrap-build-commands: ["%{hooks}%/sandbox.sh" "build"] {os = "linux" | os = "macos"} wrap-install-commands: ["%{hooks}%/sandbox.sh" "install"] {os = "linux" | os = "macos"} @@ -1272,7 +1272,7 @@ installed-switches: ["sw-sys-comp" "sw-comp" "default"] opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" wrap-build-commands: ["%{hooks}%/sandbox.sh" "build"] {os = "linux" | os = "macos"} wrap-install-commands: ["%{hooks}%/sandbox.sh" "install"] {os = "linux" | os = "macos"} @@ -1341,7 +1341,7 @@ jobs: 4 opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" ### opam-cat $OPAMROOT/repo/repos-config opam-version: "2.0" @@ -1411,7 +1411,7 @@ installed-switches: ["sw-sys-comp" "sw-comp" "default"] opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" wrap-build-commands: ["%{hooks}%/sandbox.sh" "build"] {os = "linux" | os = "macos"} wrap-install-commands: ["%{hooks}%/sandbox.sh" "install"] {os = "linux" | os = "macos"} @@ -1489,7 +1489,7 @@ installed-switches: ["sw-comp" "sw-sys-comp" "default"] opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-comp" wrap-build-commands: ["%{hooks}%/sandbox.sh" "build"] {os = "linux" | os = "macos"} wrap-install-commands: ["%{hooks}%/sandbox.sh" "install"] {os = "linux" | os = "macos"} @@ -1563,7 +1563,7 @@ installed-switches: ["sw-sys-comp" "sw-comp" "${BASEDIR}" "default"] opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" wrap-build-commands: ["%{hooks}%/sandbox.sh" "build"] {os = "linux" | os = "macos"} wrap-install-commands: ["%{hooks}%/sandbox.sh" "install"] {os = "linux" | os = "macos"} @@ -1640,7 +1640,7 @@ installed-switches: ["sw-sys-comp" "sw-comp" "default"] opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" wrap-build-commands: ["%{hooks}%/sandbox.sh" "build"] {os = "linux" | os = "macos"} wrap-install-commands: ["%{hooks}%/sandbox.sh" "install"] {os = "linux" | os = "macos"} @@ -1709,7 +1709,7 @@ jobs: 4 opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" ### opam-cat $OPAMROOT/repo/repos-config opam-version: "2.0" @@ -1779,7 +1779,7 @@ installed-switches: ["sw-sys-comp" "sw-comp" "default"] opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" wrap-build-commands: ["%{hooks}%/sandbox.sh" "build"] {os = "linux" | os = "macos"} wrap-install-commands: ["%{hooks}%/sandbox.sh" "install"] {os = "linux" | os = "macos"} @@ -1849,7 +1849,7 @@ jobs: 4 opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" ### opam-cat $OPAMROOT/repo/repos-config opam-version: "2.0" @@ -1920,7 +1920,7 @@ jobs: 4 opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" ### opam-cat $OPAMROOT/repo/repos-config opam-version: "2.0" @@ -1993,7 +1993,7 @@ jobs: 4 opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" ### opam-cat $OPAMROOT/repo/repos-config opam-version: "2.0" @@ -2054,7 +2054,7 @@ jobs: 4 opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" ### opam-cat $OPAMROOT/repo/repos-config opam-version: "2.0" @@ -2115,7 +2115,7 @@ installed-switches: ["sw-sys-comp" "sw-comp" "default"] opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" wrap-build-commands: ["%{hooks}%/sandbox.sh" "build"] {os = "linux" | os = "macos"} wrap-install-commands: ["%{hooks}%/sandbox.sh" "install"] {os = "linux" | os = "macos"} @@ -2196,7 +2196,7 @@ jobs: 4 opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" ### opam-cat $OPAMROOT/repo/repos-config opam-version: "2.0" @@ -2266,7 +2266,7 @@ jobs: 4 opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" ### opam-cat $OPAMROOT/repo/repos-config opam-version: "2.0" @@ -2338,7 +2338,7 @@ jobs: 4 opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" ### opam-cat $OPAMROOT/repo/repos-config opam-version: "2.0" @@ -2410,7 +2410,7 @@ jobs: 4 opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" ### opam-cat $OPAMROOT/repo/repos-config opam-version: "2.0" @@ -2455,7 +2455,7 @@ installed-switches: ["sw-sys-comp" "sw-comp" "default"] opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" wrap-build-commands: ["%{hooks}%/sandbox.sh" "build"] {os = "linux" | os = "macos"} wrap-install-commands: ["%{hooks}%/sandbox.sh" "install"] {os = "linux" | os = "macos"} @@ -2537,7 +2537,7 @@ jobs: 4 opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" ### opam-cat $OPAMROOT/repo/repos-config opam-version: "2.0" @@ -2597,7 +2597,7 @@ jobs: 4 opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" ### opam-cat $OPAMROOT/repo/repos-config opam-version: "2.0" @@ -2657,7 +2657,7 @@ jobs: 4 opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" ### opam-cat $OPAMROOT/repo/repos-config opam-version: "2.0" @@ -2718,7 +2718,7 @@ jobs: 4 opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" ### opam-cat $OPAMROOT/repo/repos-config opam-version: "2.0" @@ -2756,7 +2756,7 @@ installed-switches: ["sw-sys-comp" "sw-comp" "default" "${BASEDIR}/why-did-you-d opam-root-version: current opam-version: "2.0" repositories: "default" -swh-fallback: true +swh-fallback: false switch: "sw-sys-comp" wrap-build-commands: ["%{hooks}%/sandbox.sh" "build"] {os = "linux" | os = "macos"} wrap-install-commands: ["%{hooks}%/sandbox.sh" "install"] {os = "linux" | os = "macos"} diff --git a/tests/reftests/swhid.unix.test b/tests/reftests/swhid.unix.test index 5e33afa0d68..3b0d6ced65b 100644 --- a/tests/reftests/swhid.unix.test +++ b/tests/reftests/swhid.unix.test @@ -58,7 +58,7 @@ url { mirrors: "https://swhid.opam.ocaml.org/swh:1:dir:9f2be900491e1dabfc027848204ae01aa88fc71d" } ### opam option swh-fallback=false -Set to 'false' the field swh-fallback in global configuration +No modification in global configuration ### opam install snappy-swhid-dir -v | '"/.*curl' -> '"curl' | "${OPAMVERSION}" -> "current" The following actions will be performed: === install 1 package diff --git a/tests/reftests/var-option.test b/tests/reftests/var-option.test index 477749e0f60..12fa203a848 100644 --- a/tests/reftests/var-option.test +++ b/tests/reftests/var-option.test @@ -243,7 +243,7 @@ solver {} solver-criteria {} solver-fixup-criteria {} solver-upgrade-criteria {} -swh-fallback true +swh-fallback false sys-pkg-manager-cmd {} wrap-build-commands {} wrap-install-commands {} @@ -627,7 +627,7 @@ solver {} solver-criteria {} solver-fixup-criteria {} solver-upgrade-criteria {} -swh-fallback true +swh-fallback false sys-pkg-manager-cmd {} wrap-build-commands {} wrap-install-commands {} @@ -659,7 +659,7 @@ solver {} solver-criteria {} solver-fixup-criteria {} solver-upgrade-criteria {} -swh-fallback true +swh-fallback false sys-pkg-manager-cmd {} wrap-build-commands {} wrap-install-commands {}