GHA/linux: build out-of-tree, make autotools tidy target support it
To sync with the rest of core workflows. Also fix the `tidy` (clang-tidy) target in autotools to support out-of-tree builds: ``` clang-tidy slist_wc.c terminal.c tool_bname.c [...] var.c tool_hugehelp.c tool_ca_embed.c -quiet --warnings-as-errors=* -checks=-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-optin.performance.Padding,-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,-clang-analyzer-valist.Uninitialized -- -I../../include -I../lib -I../src -I../../lib -I../../src -DBUILDING_CURL -DUSE_MANUAL -D_GNU_SOURCE -DHAVE_CONFIG_H [1/45] Processing file /home/runner/work/curl/curl/bld/src/slist_wc.c. Error while processing /home/runner/work/curl/curl/bld/src/slist_wc.c. [2/45] Processing file /home/runner/work/curl/curl/bld/src/terminal.c. Error while processing /home/runner/work/curl/curl/bld/src/terminal.c. [3/45] Processing file /home/runner/work/curl/curl/bld/src/tool_bname.c. Error while processing /home/runner/work/curl/curl/bld/src/tool_bname.c. [...] ``` Ref: https://github.com/curl/curl/actions/runs/13525337357/job/37794388404?pr=16480#step:36:561 Closes #16480
This commit is contained in:
parent
200993fccd
commit
37523c91bc
44
.github/workflows/linux.yml
vendored
44
.github/workflows/linux.yml
vendored
@ -593,37 +593,39 @@ jobs:
|
|||||||
export PKG_CONFIG_PATH="${{ matrix.build.PKG_CONFIG_PATH }}"
|
export PKG_CONFIG_PATH="${{ matrix.build.PKG_CONFIG_PATH }}"
|
||||||
fi
|
fi
|
||||||
if [ -n '${{ matrix.build.generate }}' ]; then
|
if [ -n '${{ matrix.build.generate }}' ]; then
|
||||||
cmake -B . -G Ninja \
|
cmake -B bld -G Ninja \
|
||||||
-DCMAKE_INSTALL_PREFIX="$HOME/curl" \
|
-DCMAKE_INSTALL_PREFIX="$HOME/curl" \
|
||||||
-DCMAKE_C_COMPILER_TARGET=$(uname -m)-pc-linux-gnu -DBUILD_STATIC_LIBS=ON \
|
-DCMAKE_C_COMPILER_TARGET=$(uname -m)-pc-linux-gnu -DBUILD_STATIC_LIBS=ON \
|
||||||
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \
|
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \
|
||||||
${{ matrix.build.generate }}
|
${{ matrix.build.generate }}
|
||||||
else
|
else
|
||||||
|
mkdir bld && cd bld && \
|
||||||
${{ matrix.build.configure-prefix }} \
|
${{ matrix.build.configure-prefix }} \
|
||||||
./configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
|
../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
|
||||||
|
--disable-dependency-tracking \
|
||||||
${{ matrix.build.configure }}
|
${{ matrix.build.configure }}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: 'configure log'
|
- name: 'configure log'
|
||||||
if: ${{ !cancelled() }}
|
if: ${{ !cancelled() }}
|
||||||
run: cat config.log CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true
|
run: cat bld/config.log bld/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true
|
||||||
|
|
||||||
- name: 'curl_config.h'
|
- name: 'curl_config.h'
|
||||||
run: |
|
run: |
|
||||||
echo '::group::raw'; cat lib/curl_config.h || true; echo '::endgroup::'
|
echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::'
|
||||||
grep -F '#define' lib/curl_config.h | sort || true
|
grep -F '#define' bld/lib/curl_config.h | sort || true
|
||||||
|
|
||||||
- name: 'test configs'
|
- name: 'test configs'
|
||||||
run: |
|
run: |
|
||||||
cat tests/config || true
|
cat bld/tests/config || true
|
||||||
cat tests/http/config.ini || true
|
cat bld/tests/http/config.ini || true
|
||||||
|
|
||||||
- name: 'build'
|
- name: 'build'
|
||||||
run: |
|
run: |
|
||||||
if [ -n '${{ matrix.build.generate }}' ]; then
|
if [ -n '${{ matrix.build.generate }}' ]; then
|
||||||
${{ matrix.build.make-prefix }} cmake --build . --verbose
|
${{ matrix.build.make-prefix }} cmake --build bld --verbose
|
||||||
else
|
else
|
||||||
${{ matrix.build.make-prefix }} make V=1 ${{ matrix.build.make-custom-target }}
|
${{ matrix.build.make-prefix }} make -C bld V=1 ${{ matrix.build.make-custom-target }}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: 'single-use function check'
|
- name: 'single-use function check'
|
||||||
@ -631,27 +633,27 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git config --global --add safe.directory "*"
|
git config --global --add safe.directory "*"
|
||||||
if [ -n '${{ matrix.build.generate }}' ]; then
|
if [ -n '${{ matrix.build.generate }}' ]; then
|
||||||
libcurla=lib/libcurl.a
|
libcurla=bld/lib/libcurl.a
|
||||||
else
|
else
|
||||||
libcurla=lib/.libs/libcurl.a
|
libcurla=bld/lib/.libs/libcurl.a
|
||||||
fi
|
fi
|
||||||
./scripts/singleuse.pl --unit ${libcurla}
|
./scripts/singleuse.pl --unit ${libcurla}
|
||||||
|
|
||||||
- name: 'check curl -V output'
|
- name: 'check curl -V output'
|
||||||
if: ${{ matrix.build.make-custom-target != 'tidy' }}
|
if: ${{ matrix.build.make-custom-target != 'tidy' }}
|
||||||
run: ./src/curl -V
|
run: bld/src/curl -V
|
||||||
|
|
||||||
- name: 'cmake install'
|
- name: 'cmake install'
|
||||||
if: ${{ matrix.build.generate }}
|
if: ${{ matrix.build.generate }}
|
||||||
run: cmake --install . --strip
|
run: cmake --install bld --strip
|
||||||
|
|
||||||
- name: 'build tests'
|
- name: 'build tests'
|
||||||
if: ${{ matrix.build.install_steps != 'skipall' }}
|
if: ${{ matrix.build.install_steps != 'skipall' }}
|
||||||
run: |
|
run: |
|
||||||
if [ -n '${{ matrix.build.generate }}' ]; then
|
if [ -n '${{ matrix.build.generate }}' ]; then
|
||||||
cmake --build . --verbose --target testdeps
|
cmake --build bld --verbose --target testdeps
|
||||||
else
|
else
|
||||||
make V=1 -C tests
|
make -C bld V=1 -C tests
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: 'install test prereqs'
|
- name: 'install test prereqs'
|
||||||
@ -678,9 +680,9 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
[ -x "$HOME/venv/bin/activate" ] && source $HOME/venv/bin/activate
|
[ -x "$HOME/venv/bin/activate" ] && source $HOME/venv/bin/activate
|
||||||
if [ -n '${{ matrix.build.generate }}' ]; then
|
if [ -n '${{ matrix.build.generate }}' ]; then
|
||||||
cmake --build . --verbose --target ${{ matrix.build.torture && 'test-torture' || 'test-ci' }}
|
cmake --build bld --verbose --target ${{ matrix.build.torture && 'test-torture' || 'test-ci' }}
|
||||||
else
|
else
|
||||||
make V=1 ${{ matrix.build.torture && 'test-torture' || 'test-ci' }}
|
make -C bld V=1 ${{ matrix.build.torture && 'test-torture' || 'test-ci' }}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: 'install pytest prereqs'
|
- name: 'install pytest prereqs'
|
||||||
@ -698,16 +700,16 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
[ -x "$HOME/venv/bin/activate" ] && source $HOME/venv/bin/activate
|
[ -x "$HOME/venv/bin/activate" ] && source $HOME/venv/bin/activate
|
||||||
if [ -n '${{ matrix.build.generate }}' ]; then
|
if [ -n '${{ matrix.build.generate }}' ]; then
|
||||||
cmake --build . --verbose --target curl-pytest-ci
|
cmake --build bld --verbose --target curl-pytest-ci
|
||||||
else
|
else
|
||||||
make V=1 pytest-ci
|
make -C bld V=1 pytest-ci
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: 'build examples'
|
- name: 'build examples'
|
||||||
if: ${{ matrix.build.make-custom-target != 'tidy' }}
|
if: ${{ matrix.build.make-custom-target != 'tidy' }}
|
||||||
run: |
|
run: |
|
||||||
if [ -n '${{ matrix.build.generate }}' ]; then
|
if [ -n '${{ matrix.build.generate }}' ]; then
|
||||||
${{ matrix.build.make-prefix }} cmake --build . --verbose --target curl-examples
|
${{ matrix.build.make-prefix }} cmake --build bld --verbose --target curl-examples
|
||||||
else
|
else
|
||||||
${{ matrix.build.make-prefix }} make V=1 examples
|
${{ matrix.build.make-prefix }} make -C bld V=1 examples
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -162,7 +162,8 @@ endif
|
|||||||
TIDY := clang-tidy
|
TIDY := clang-tidy
|
||||||
|
|
||||||
tidy:
|
tidy:
|
||||||
$(TIDY) $(CSOURCES) $(TIDYFLAGS) $(CURL_CLANG_TIDYFLAGS) -- $(AM_CPPFLAGS) $(CPPFLAGS) -DHAVE_CONFIG_H
|
(_csources=`echo ' $(CSOURCES)' | sed -e 's/ +/ /g' -e 's| | $(srcdir)/|g'`; \
|
||||||
|
$(TIDY) $$_csources $(TIDYFLAGS) $(CURL_CLANG_TIDYFLAGS) -- $(AM_CPPFLAGS) $(CPPFLAGS) -DHAVE_CONFIG_H)
|
||||||
|
|
||||||
optiontable:
|
optiontable:
|
||||||
perl optiontable.pl < $(top_srcdir)/include/curl/curl.h > easyoptions.c
|
perl optiontable.pl < $(top_srcdir)/include/curl/curl.h > easyoptions.c
|
||||||
|
|||||||
@ -206,7 +206,8 @@ endif
|
|||||||
TIDY := clang-tidy
|
TIDY := clang-tidy
|
||||||
|
|
||||||
tidy: $(HUGE) $(CA_EMBED_CSOURCE)
|
tidy: $(HUGE) $(CA_EMBED_CSOURCE)
|
||||||
$(TIDY) $(CURL_CFILES) $(curl_cfiles_gen) $(TIDYFLAGS) $(CURL_CLANG_TIDYFLAGS) -- $(curl_CPPFLAGS) $(CPPFLAGS) $(AM_CPPFLAGS) -DHAVE_CONFIG_H
|
(_curl_cfiles=`echo ' $(CURL_CFILES)' | sed -e 's/ +/ /g' -e 's| | $(srcdir)/|g'`; \
|
||||||
|
$(TIDY) $$_curl_cfiles $(curl_cfiles_gen) $(TIDYFLAGS) $(CURL_CLANG_TIDYFLAGS) -- $(curl_CPPFLAGS) $(CPPFLAGS) $(AM_CPPFLAGS) -DHAVE_CONFIG_H)
|
||||||
|
|
||||||
listhelp:
|
listhelp:
|
||||||
(cd $(top_srcdir)/docs/cmdline-opts && make listhelp)
|
(cd $(top_srcdir)/docs/cmdline-opts && make listhelp)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user