From 5a1c1281511c0a7ea087d124b4c40113ebae52bc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexander=20K=C3=B6plinger?= Date: Wed, 10 Apr 2019 15:26:28 +0200 Subject: [PATCH] [configure] Add failsafe for missing submodules (#13957) GitHub provides a way to download a .zip/.tar.gz of the repository content in their UI, however the archive doesn't contain git submodules. The mono build then fails with confusing "missing file" errors. Since GitHub doesn't let us disable the archive download we should at least add some logic to detect this broken case and bail out. (cherry picked from commit e8caaa1dbd880767bcf07ccfa8b9f695377ddd8d) --- Makefile.am | 3 +-- scripts/update_submodules.sh | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 9faaeccd639..a16d2304529 100644 --- a/Makefile.am +++ b/Makefile.am @@ -25,9 +25,8 @@ DIST_SUBDIRS = $(build_with_msvc) m4 mk po $(libgc_dir) llvm mono ikvm-native su all: update_submodules -SUBMODULE_ERROR='Could not recursively update all git submodules. You may experience compilation problems if some submodules are out of date' update_submodules: - @$(srcdir)/scripts/update_submodules.sh + @cd $(srcdir) && scripts/update_submodules.sh .PHONY: update_submodules diff --git a/scripts/update_submodules.sh b/scripts/update_submodules.sh index bd5d7fc487f..db456bdf4d9 100755 --- a/scripts/update_submodules.sh +++ b/scripts/update_submodules.sh @@ -8,3 +8,7 @@ if test -e .git; then \ || (echo 'Git submodules could not be updated. Compilation will fail') \ fi +if ! test -e external/corefx/README.md; then + echo "Error: Couldn't find the required submodules. This usually happens when using an archive from GitHub instead of https://download.mono-project.com/sources/mono/, or something went wrong while updating submodules." + exit 1 +fi -- 2.11.4.GIT