diff --git a/master_changes.md b/master_changes.md index 79db7ae198b..27cd0a7c8f7 100644 --- a/master_changes.md +++ b/master_changes.md @@ -89,6 +89,7 @@ users) ## Sandbox ## VCS + * Fail when git submodule fails to update instead of showing a warning and ignoring the error [#6132 @kit-ty-kate - fix #6131] ## Build * Synchronise opam-core.opam with opam-repository changes [#6043 @dra27] diff --git a/src/repository/opamGit.ml b/src/repository/opamGit.ml index 49980641c77..1b2f4c565df 100644 --- a/src/repository/opamGit.ml +++ b/src/repository/opamGit.ml @@ -179,9 +179,7 @@ module VCS : OpamVCS.VCS = struct if OpamFilename.exists (repo_root // ".gitmodules") then git repo_root [ "submodule"; "update"; "--init"; "--recursive" ] @@> fun r -> - if OpamProcess.is_failure r then - OpamConsole.warning "Git submodule update failed in %s" - (OpamFilename.Dir.to_string repo_root); + OpamSystem.raise_on_process_error r; Done () else Done () diff --git a/tests/reftests/git.test b/tests/reftests/git.test index 187baa24096..5f7d54346a6 100644 --- a/tests/reftests/git.test +++ b/tests/reftests/git.test @@ -51,24 +51,22 @@ The following actions will be performed: <><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> -> removed submodule.1 Done. -### opam install submodule +### opam install submodule | '".+[/\\]git(\.exe)? ' -> '"git ' The following actions will be performed: === install 1 package - install submodule 1 <><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> -[WARNING] Git submodule update failed in ${BASEDIR}/OPAM/submodule/.opam-switch/sources/submodule.1 --> retrieved submodule.1 (git+file://${BASEDIR}/use-submodule) -[ERROR] The compilation of submodule.1 failed at "ls vendor/some-file". - -##% output ### -# ls: cannot access 'vendor/some-file': No such file or directory +[ERROR] Could not synchronize ${BASEDIR}/OPAM/submodule/.opam-switch/sources/submodule.1 from "git+file://${BASEDIR}/use-submodule": + "git submodule update --init --recursive" exited with code 1 +[ERROR] Failed to get sources of submodule.1: git+file://${BASEDIR}/use-submodule +OpamSolution.Fetch_fail("git+file://${BASEDIR}/use-submodule") <><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> +- The following actions failed -| - build submodule 1 +| - fetch submodule 1 +- - No changes have been performed -# Return code 31 # +# Return code 40 #