Skip to content

Commit c65120f

Browse files
committed
ci(coverity): fix building on Windows
When I added the Coverity workflow in a56b623 (ci: add a GitHub workflow to submit Coverity scans, 2023-09-25), I merely converted an Azure Pipeline definition that had been running successfully for ages. In the meantime, the current Coverity documentation describes a very different way to install the analysis tool, recommending to add the `bin/` directory to the _end_ of `PATH` (when originally, IIRC, it was recommended to add it to the _beginning_ of the `PATH`). This is crucial! The reason is that the current incarnation of the Windows variant of Coverity's analysis tools come with a _lot_ of DLL files in their `bin/` directory, some of them interferring rather badly with the `gcc.exe` in Git for Windows' SDK that we use to run the Coverity build. The symptom is a cryptic error message: make: *** [Makefile:2960: headless-git.o] Error 1 make: *** Waiting for unfinished jobs.... D:\git-sdk-64-minimal\mingw64\bin\windres.exe: preprocessing failed. make: *** [Makefile:2679: git.res] Error 1 make: *** [Makefile:2893: git.o] Error 1 make: *** [Makefile:2893: builtin/add.o] Error 1 Attempting to detect unconfigured compilers in build |0----------25-----------50----------75---------100| **************************************************** Warning: Build command make.exe exited with code 2. Please verify that the build completed successfully. Warning: Emitted 0 C/C++ compilation units (0%) successfully 0 C/C++ compilation units (0%) are ready for analysis For more details, please look at: D:/a/git/git/cov-int/build-log.txt The log (which the workflow is currently not configured to reveal) then points out that the `windows.h` header cannot be found, which is _still_ not very helpful. The underlying root cause is that the `gcc.exe` in Git for Windows' SDK determines the location of the header files via the location of certain DLL files, and finding the "wrong" ones first on the `PATH` misleads that logic. Let's fix this problem by following Coverity's current recommendation and append the `bin/` directory in which `cov-int` can be found to the _end_ of `PATH`. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 683c54c commit c65120f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/coverity.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ jobs:
147147
key: cov-build-${{ env.COVERITY_LANGUAGE }}-${{ env.COVERITY_PLATFORM }}-${{ steps.lookup.outputs.hash }}
148148
- name: build with cov-build
149149
run: |
150-
export PATH="$RUNNER_TEMP/cov-analysis/bin:$PATH" &&
150+
export PATH="$PATH:$(cygpath -au "$RUNNER_TEMP")/cov-analysis/bin" &&
151151
cov-configure --gcc &&
152152
cov-build --dir cov-int make
153153
- name: package the build

0 commit comments

Comments
 (0)