From 8b60e320760fae4859c269e543dadd41c875e8ec Mon Sep 17 00:00:00 2001 From: Vincent Fu Date: Wed, 26 Apr 2023 22:04:34 +0000 Subject: [PATCH] ci: work around for GitHub Actions Cygwin sed issue gcc and other compilers create dependency files that are included in the Makefile for builds subsequent to the first build after a clean checkout. Dependency files produced by gcc look like this: parse.o: parse.c config-host.h compiler/compiler.h parse.h flist.h \ debug.h lib/types.h log.h lib/output_buffer.h options.h optgroup.h \ minmax.h lib/ieee754.h lib/pow2.h lib/types.h The Makefile rule for .o files manipulates the gcc dependencies file to look like this: parse.o: parse.c config-host.h compiler/compiler.h parse.h flist.h \ debug.h lib/types.h log.h lib/output_buffer.h options.h optgroup.h \ minmax.h lib/ieee754.h lib/pow2.h lib/types.h parse.c: config-host.h: compiler/compiler.h: parse.h: flist.h: debug.h: lib/types.h: log.h: lib/output_buffer.h: options.h: optgroup.h: minmax.h: lib/ieee754.h: lib/pow2.h: lib/types.h: For some reason the GitHub Actions Windows Cygwin sed does not execute -e 's/\\$$//' properly to remove the backslashes at the end of each line. On this platform the dependencies file after processing looks like: parse.o: parse.c config-host.h compiler/compiler.h parse.h flist.h \ debug.h lib/types.h log.h lib/output_buffer.h options.h optgroup.h \ minmax.h lib/ieee754.h lib/pow2.h lib/types.h parse.c: config-host.h: compiler/compiler.h: parse.h: flist.h: \: debug.h: lib/types.h: log.h: lib/output_buffer.h: options.h: optgroup.h: \: minmax.h: lib/ieee754.h: lib/pow2.h: lib/types.h: Once these dependency files are created subsequent invocations of make (i.e., 'make test') produce Makefile parsing errors like: parse.d:9: *** missing separator. Stop. All of this works fine on GitHub Actions msys2 and AppVeyor's Cygwin and msys2. Work around this problem by deleting the dependencies files before running the tests. For more details describing the processing of dependency files see https://scottmcpeak.com/autodepend/autodepend.html Signed-off-by: Vincent Fu --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ebe7b58a..06e03ce3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -111,6 +111,10 @@ jobs: with: name: ${{ matrix.build }}-installer path: os\windows\*.msi + - name: Remove dependency files to resolve Makefile Cygwin sed issue (Windows) + if: ${{ startsWith(matrix.build, 'windows-cygwin') }} + run: rm *.d */*.d */*/*.d + shell: bash - name: Smoke test run: ${{matrix.shell}} ./ci/actions-smoke-test.sh - name: Full test -- 2.25.1