diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 286479465..f91bd749a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,6 +124,19 @@ jobs: contents: write steps: + - name: Install Git + uses: alandefreitas/cpp-actions/package-install@v1.8.8 + if: matrix.container != '' + env: + DEBIAN_FRONTEND: 'noninteractive' + TZ: 'Etc/UTC' + with: + apt-get: git + + - name: Configure Git Safe Directory + if: matrix.container != '' + run: git config --global --add safe.directory "$(pwd)" + - name: Clone MrDocs uses: actions/checkout@v4 diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e79897db..6a628b7e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,7 @@ option(MRDOCS_INSTALL "Configure install target" ON) option(MRDOCS_PACKAGE "Build install package" ON) option(MRDOCS_BUILD_SHARED "Link shared" ${BUILD_SHARED_LIBS}) option(MRDOCS_BUILD_TESTS "Build tests" ${BUILD_TESTING}) +option(MRDOCS_REQUIRE_GIT "Git is required: not being able to extract version build is an error" ON) if (MRDOCS_BUILD_TESTS OR MRDOCS_INSTALL) option(MRDOCS_BUILD_DOCS "Build documentation" ON) else() @@ -151,8 +152,15 @@ if (GIT_FOUND) OUTPUT_VARIABLE PROJECT_VERSION_BUILD OUTPUT_STRIP_TRAILING_WHITESPACE ) + # Check if PROJECT_VERSION_BUILD is populated + if (NOT PROJECT_VERSION_BUILD AND MRDOCS_REQUIRE_GIT) + message(FATAL_ERROR "Git was found but could not extract the version build") + endif() set(PROJECT_VERSION_BUILD "${PROJECT_VERSION_BUILD}") else() + if (MRDOCS_REQUIRE_GIT) + message(FATAL_ERROR "Git is required to extract the version build") + endif() set(PROJECT_VERSION_BUILD "") endif() configure_file( diff --git a/src/lib/Support/Error.cpp b/src/lib/Support/Error.cpp index 7a0c3dc59..70a3fb2c3 100644 --- a/src/lib/Support/Error.cpp +++ b/src/lib/Support/Error.cpp @@ -279,9 +279,13 @@ call_impl( } os << '\n'; } + + // Update counters std::lock_guard lock(mutex_); - if(! s.empty()) + if (!s.empty()) + { llvm::errs() << s; + } switch(level) { case Level::debug: