Skip to content

Commit 2000455

Browse files
committed
make CI jobs faster, and other improvements
After this patch BuildFuzzers and Testi386 jobs need about 7.5 minutes per job, down from 15-16m, for a >2x speed-up. There should noticeable improvements in the other jobs, too: - Mainline (address): 4m45s -> 3m30s (gain: 1m15s) - Mainline (memory): 2m45s -> 2m0s (gain: 45s) - JustDependencies: 2m -> 1m50s (gain: 10s) Before: https://github.com/curl/curl/actions/runs/16769657727 After: https://github.com/curl/curl-fuzzer/actions/runs/16775268062?pr=181 Also reduce log noise and fix minor issues found along the way. Add Ninja support. Details: - drop progress bar in `apt` commands. - CI: move `env:` before `run:` to match control flow. (style) - CI and scripts/ossfuzzdeps.sh: install ninja. For more robust build performance across platforms, and more readable logs. - cmake: drop `BUILD_COMMAND $(MAKE)` and `INSTALL_COMMAND $(MAKE) install` and use the cmake defaults. The defaults work with both GNU Make and Ninja generators. This also avoids passing a GNU Make macro to the generator, which broke with and error when used with Ninja. Ref: https://cmake.org/cmake/help/latest/module/ExternalProject.html - replace one remaining `$(MAKE)` use with `${MAKE}`, and initialize the latter from the calling env. This is necessary to keep avoiding the super lengthy OpenSSL manual install phase, which needs a custom install target (`install_sw`) unfortunately. - cmake: hide download progress lines to reduce log noise. - cmake: specify build byproducts in `ExternalProject_Add()` commands. Necessary for Ninja to figure out what output is generated, to resolve them as dependencies. - replace gzip packages with `.tar.xz` where available, for smaller downloads. - switch nghttp2 build from autotools to cmake for better performance. (esp. better configure performance.) - drop redundant zlib dependency for nghttp2. (lib-only builds don't use it). - disable unnecessary components in dependencies to save build time. In openssl, zstd, nghttp2, libidn2. (e.g. tools, docs, examples, tests.) - drop redundant option `--enable-websockets` when building curl. It became the default after leaving the experimental status. - disable dependency tracking in autotools builds for better performance. - fix `MAKEFLAGS`, which became `-j4-j4` during ossfuzz builds. This made all builds run without parallelism. Also show this env in the log, for visibility. - switch curl build from autotools to cmake for better performance. - stop building the unused curl tool to finish builds faster. - curl: drop redundant `DOWNLOAD_EXTRACT_TIMESTAMP` option for Git. - cmake: drop redundant `BUILD_IN_SOURCE` and `SOURCE_SUBDIR` options. - restore `groff-base`. Turns out to be a tiny patch; it's not worth the manual workaround. Follow-up to d0bf19b - remove exec attribute from a C++ source. - ossfuzz: drop redundant `MAKEFLAGS` settings and env dumps. - CI: skip updating man-db for faster package installs. (Ubuntu) - use `-s` in `MAKEFLAGS` to keep the low verbosity of sub-builds as before this patch. Without it, CMake seems to add `-w` when using Ninja. Due to the way ossfuzz works (?), these changes cannot be tested within this PR, because part of the repo is pulled from curl/curl-fuzzer master while testing changes pushed in this PR. This makes the scripts miss to install Ninja. This setup surprised me. Also not fully from curl upstream, because some of the parts seem to always come from master. Helper patch: d0bf19b Partial test from curl: curl/curl#18202 Bug: curl/curl#18140 (comment) Closes #181
1 parent d0bf19b commit 2000455

File tree

7 files changed

+82
-103
lines changed

7 files changed

+82
-103
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,15 @@ jobs:
9797
repository: curl/curl-fuzzer
9898
- name: Install Dependencies
9999
run: |
100-
sudo apt-get update
101-
sudo apt-get install -y cmake clang
100+
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
101+
sudo apt-get -o Dpkg::Use-Pty=0 update
102+
sudo rm -f /var/lib/man-db/auto-update
103+
sudo apt-get -o Dpkg::Use-Pty=0 install -y cmake clang ninja-build
102104
- name: Compile mainline
103-
run: |
104-
./mainline.sh
105105
env:
106106
# test with different "sanitizers"
107107
SANITIZER: ${{ matrix.sanitizer }}
108+
run: ./mainline.sh
108109

109110
just_dependencies:
110111
runs-on: ubuntu-latest
@@ -115,8 +116,10 @@ jobs:
115116
repository: curl/curl-fuzzer
116117
- name: Install Dependencies
117118
run: |
118-
sudo apt-get update
119-
sudo apt-get install -y cmake clang
119+
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
120+
sudo apt-get -o Dpkg::Use-Pty=0 update
121+
sudo rm -f /var/lib/man-db/auto-update
122+
sudo apt-get -o Dpkg::Use-Pty=0 install -y cmake clang ninja-build
120123
- name: Compile deps target
121124
run: ./scripts/compile_target.sh deps
122125

CMakeLists.txt

Lines changed: 64 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,51 @@
11
cmake_minimum_required(VERSION 3.11)
22
project(curl_fuzzer_deps)
33

4+
if(NOT "$ENV{MAKE}" STREQUAL "")
5+
set(MAKE "$ENV{MAKE}")
6+
else()
7+
set(MAKE "make")
8+
endif()
9+
410
include(ExternalProject)
511

612
# Install zlib
713
#
814
# renovate: datasource=github-tags depName=madler/zlib
915
set(ZLIB_VERSION 1.3.1)
10-
set(ZLIB_URL https://zlib.net/zlib-${ZLIB_VERSION}.tar.gz)
16+
set(ZLIB_URL https://zlib.net/zlib-${ZLIB_VERSION}.tar.xz)
1117
set(ZLIB_INSTALL_DIR ${CMAKE_BINARY_DIR}/zlib-install)
18+
set(ZLIB_STATIC_LIB ${ZLIB_INSTALL_DIR}/lib/libz.a)
1219

1320
ExternalProject_Add(
1421
zlib_external
1522
URL ${ZLIB_URL}
1623
PREFIX ${CMAKE_BINARY_DIR}/zlib
17-
SOURCE_SUBDIR .
1824
CONFIGURE_COMMAND <SOURCE_DIR>/configure --static --prefix=${ZLIB_INSTALL_DIR}
19-
BUILD_COMMAND $(MAKE)
20-
INSTALL_COMMAND $(MAKE) install
2125
BUILD_IN_SOURCE 1
26+
BUILD_BYPRODUCTS ${ZLIB_STATIC_LIB}
2227
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
28+
DOWNLOAD_NO_PROGRESS 1
2329
)
24-
set(ZLIB_STATIC_LIB ${ZLIB_INSTALL_DIR}/lib/libz.a)
2530

2631
# Install zstd
2732
#
2833
# renovate: datasource=github-tags depName=facebook/zstd
2934
set(ZSTD_VERSION 1.5.7)
3035
set(ZSTD_URL https://github.com/facebook/zstd/releases/download/v${ZSTD_VERSION}/zstd-${ZSTD_VERSION}.tar.gz)
3136
set(ZSTD_INSTALL_DIR ${CMAKE_BINARY_DIR}/zstd-install)
37+
set(ZSTD_STATIC_LIB ${ZSTD_INSTALL_DIR}/lib/libzstd.a)
3238

3339
ExternalProject_Add(
3440
zstd_external
3541
URL ${ZSTD_URL}
3642
PREFIX ${CMAKE_BINARY_DIR}/zstd
3743
SOURCE_SUBDIR build/cmake
38-
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${ZSTD_INSTALL_DIR} -DZSTD_BUILD_PROGRAMS=OFF -DZSTD_BUILD_SHARED=OFF -DZSTD_BUILD_STATIC=ON
39-
BUILD_COMMAND $(MAKE)
40-
INSTALL_COMMAND $(MAKE) install
41-
BUILD_IN_SOURCE 0
44+
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${ZSTD_INSTALL_DIR} -DZSTD_BUILD_PROGRAMS=OFF -DZSTD_BUILD_SHARED=OFF -DZSTD_BUILD_STATIC=ON -DZSTD_BUILD_CONTRIB=OFF -DZSTD_BUILD_TESTS=OFF
45+
BUILD_BYPRODUCTS ${ZSTD_STATIC_LIB}
4246
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
47+
DOWNLOAD_NO_PROGRESS 1
4348
)
44-
set(ZSTD_STATIC_LIB ${ZSTD_INSTALL_DIR}/lib/libzstd.a)
4549

4650
# For the memory sanitizer build, turn off OpenSSL as it causes bugs we can't
4751
# affect (see 16697, 17624)
@@ -54,6 +58,7 @@ if(NOT (DEFINED ENV{SANITIZER} AND "$ENV{SANITIZER}" STREQUAL "memory"))
5458
set(OPENSSL_URL https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz)
5559
set(OPENSSL_INSTALL_DIR ${CMAKE_BINARY_DIR}/openssl-install)
5660
set(OPENSSL_SRC_DIR ${CMAKE_BINARY_DIR}/openssl/src/openssl_external)
61+
set(OPENSSL_STATIC_LIB ${OPENSSL_INSTALL_DIR}/lib/libssl.a ${OPENSSL_INSTALL_DIR}/lib/libcrypto.a)
5762

5863
# Architecture and sanitizer logic
5964
set(OPENSSL_ARCH_TARGET "")
@@ -81,6 +86,8 @@ if(NOT (DEFINED ENV{SANITIZER} AND "$ENV{SANITIZER}" STREQUAL "memory"))
8186
-DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
8287
no-shared
8388
no-tests
89+
no-apps
90+
no-makedepend
8491
${OPENSSL_ASM_FLAG}
8592
${OPENSSL_ARCH_FLAG}
8693
enable-tls1_3
@@ -100,26 +107,25 @@ if(NOT (DEFINED ENV{SANITIZER} AND "$ENV{SANITIZER}" STREQUAL "memory"))
100107
openssl_external
101108
URL ${OPENSSL_URL}
102109
PREFIX ${CMAKE_BINARY_DIR}/openssl
103-
SOURCE_SUBDIR .
104110
CONFIGURE_COMMAND ${OPENSSL_CONFIGURE_COMMAND}
105-
BUILD_COMMAND $(MAKE)
106-
INSTALL_COMMAND $(MAKE) install_sw
111+
INSTALL_COMMAND ${MAKE} install_sw
107112
BUILD_IN_SOURCE 1
113+
BUILD_BYPRODUCTS ${OPENSSL_STATIC_LIB}
108114
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
115+
DOWNLOAD_NO_PROGRESS 1
109116
)
110117

111118
# Build zlib before openssl
112119
add_dependencies(openssl_external zlib_external)
113120

114121
# Set the OpenSSL option for nghttp2
115-
set(NGHTTP2_OPENSSL_OPTION --with-openssl=${OPENSSL_INSTALL_DIR})
122+
set(NGHTTP2_OPENSSL_OPTION -DOPENSSL_ROOT_DIR=${OPENSSL_INSTALL_DIR})
116123

117124
# Set the dependency option for openssl
118125
set(OPENSSL_DEP openssl_external)
119-
set(OPENSSL_STATIC_LIB ${OPENSSL_INSTALL_DIR}/lib/libssl.a ${OPENSSL_INSTALL_DIR}/lib/libcrypto.a)
120126
else()
121127
message(STATUS "Not building OpenSSL")
122-
set(NGHTTP2_OPENSSL_OPTION --without-openssl)
128+
set(NGHTTP2_OPENSSL_OPTION -DOPENSSL_INCLUDE_DIR=)
123129
set(OPENSSL_DEP "")
124130
set(OPENSSL_STATIC_LIB "")
125131
endif()
@@ -128,32 +134,20 @@ endif()
128134
#
129135
# renovate: datasource=github-tags depName=nghttp2/nghttp2
130136
set(NGHTTP2_VERSION 1.66.0)
131-
set(NGHTTP2_URL https://github.com/nghttp2/nghttp2/releases/download/v${NGHTTP2_VERSION}/nghttp2-${NGHTTP2_VERSION}.tar.gz)
137+
set(NGHTTP2_URL https://github.com/nghttp2/nghttp2/releases/download/v${NGHTTP2_VERSION}/nghttp2-${NGHTTP2_VERSION}.tar.xz)
132138
set(NGHTTP2_INSTALL_DIR ${CMAKE_BINARY_DIR}/nghttp2-install)
133-
134-
set(NGHTTP2_CONFIGURE_COMMAND
135-
autoreconf -i &&
136-
./configure --prefix=${NGHTTP2_INSTALL_DIR}
137-
--disable-shared
138-
--enable-static
139-
--disable-threads
140-
--enable-lib-only
141-
--with-zlib=${ZLIB_INSTALL_DIR}
142-
${NGHTTP2_OPENSSL_OPTION}
143-
)
139+
set(NGHTTP2_STATIC_LIB ${NGHTTP2_INSTALL_DIR}/lib/libnghttp2.a)
144140

145141
ExternalProject_Add(
146142
nghttp2_external
147143
URL ${NGHTTP2_URL}
148144
PREFIX ${CMAKE_BINARY_DIR}/nghttp2
149-
SOURCE_SUBDIR .
150-
CONFIGURE_COMMAND ${NGHTTP2_CONFIGURE_COMMAND}
151-
BUILD_COMMAND $(MAKE)
152-
INSTALL_COMMAND $(MAKE) install
153-
BUILD_IN_SOURCE 1
145+
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${NGHTTP2_INSTALL_DIR} -DENABLE_LIB_ONLY=ON -DENABLE_THREADS=OFF -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=OFF
146+
-DBUILD_TESTING=OFF -DENABLE_DOC=OFF ${NGHTTP2_OPENSSL_OPTION}
147+
BUILD_BYPRODUCTS ${NGHTTP2_STATIC_LIB}
154148
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
149+
DOWNLOAD_NO_PROGRESS 1
155150
)
156-
set(NGHTTP2_STATIC_LIB ${NGHTTP2_INSTALL_DIR}/lib/libnghttp2.a)
157151

158152
# Ensure zlib and openssl are built before nghttp2
159153
add_dependencies(nghttp2_external ${OPENSSL_DEP} zlib_external)
@@ -164,19 +158,18 @@ add_dependencies(nghttp2_external ${OPENSSL_DEP} zlib_external)
164158
set(LIBIDN2_VERSION 2.3.8)
165159
set(LIBIDN2_URL https://ftp.gnu.org/gnu/libidn/libidn2-${LIBIDN2_VERSION}.tar.gz)
166160
set(LIBIDN2_INSTALL_DIR ${CMAKE_BINARY_DIR}/libidn2-install)
161+
set(LIBIDN2_STATIC_LIB ${LIBIDN2_INSTALL_DIR}/lib/libidn2.a)
167162

168163
ExternalProject_Add(
169164
libidn2_external
170165
URL ${LIBIDN2_URL}
171166
PREFIX ${CMAKE_BINARY_DIR}/libidn2
172-
SOURCE_SUBDIR .
173-
CONFIGURE_COMMAND ./configure --prefix=${LIBIDN2_INSTALL_DIR} --disable-shared --enable-static
174-
BUILD_COMMAND $(MAKE)
175-
INSTALL_COMMAND $(MAKE) install
167+
CONFIGURE_COMMAND ./configure --disable-dependency-tracking --prefix=${LIBIDN2_INSTALL_DIR} --disable-shared --enable-static --disable-doc
176168
BUILD_IN_SOURCE 1
169+
BUILD_BYPRODUCTS ${LIBIDN2_STATIC_LIB}
177170
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
171+
DOWNLOAD_NO_PROGRESS 1
178172
)
179-
set(LIBIDN2_STATIC_LIB ${LIBIDN2_INSTALL_DIR}/lib/libidn2.a)
180173

181174
# Install GDB if GDBMODE is set
182175
set(GDB_VERSION 13.2)
@@ -189,10 +182,7 @@ if(BUILD_GDB)
189182
gdb_external
190183
URL ${GDB_URL}
191184
PREFIX ${CMAKE_BINARY_DIR}/gdb
192-
SOURCE_SUBDIR .
193-
CONFIGURE_COMMAND ./configure --prefix=${GDB_INSTALL_DIR}
194-
BUILD_COMMAND $(MAKE)
195-
INSTALL_COMMAND $(MAKE) install
185+
CONFIGURE_COMMAND ./configure --disable-dependency-tracking --prefix=${GDB_INSTALL_DIR}
196186
BUILD_IN_SOURCE 1
197187
)
198188
set(GDB_DEP gdb_external)
@@ -204,20 +194,19 @@ endif()
204194
set(OPENLDAP_VERSION 2.6.10)
205195
set(OPENLDAP_URL https://www.openldap.org/software/download/OpenLDAP/openldap-release/openldap-${OPENLDAP_VERSION}.tgz)
206196
set(OPENLDAP_INSTALL_DIR ${CMAKE_BINARY_DIR}/openldap-install)
197+
set(OPENLDAP_STATIC_LIB_LDAP ${OPENLDAP_INSTALL_DIR}/lib/libldap.a)
198+
set(OPENLDAP_STATIC_LIB_LBER ${OPENLDAP_INSTALL_DIR}/lib/liblber.a)
207199

208200
ExternalProject_Add(
209201
openldap_external
210202
URL ${OPENLDAP_URL}
211203
PREFIX ${CMAKE_BINARY_DIR}/openldap
212-
SOURCE_SUBDIR .
213204
CONFIGURE_COMMAND ./configure --prefix=${OPENLDAP_INSTALL_DIR} --disable-shared --enable-static --without-tls
214-
BUILD_COMMAND $(MAKE)
215-
INSTALL_COMMAND $(MAKE) install
216205
BUILD_IN_SOURCE 1
206+
BUILD_BYPRODUCTS ${OPENLDAP_STATIC_LIB_LDAP} ${OPENLDAP_STATIC_LIB_LBER}
217207
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
208+
DOWNLOAD_NO_PROGRESS 1
218209
)
219-
set(OPENLDAP_STATIC_LIB_LDAP ${OPENLDAP_INSTALL_DIR}/lib/libldap.a)
220-
set(OPENLDAP_STATIC_LIB_LBER ${OPENLDAP_INSTALL_DIR}/lib/liblber.a)
221210

222211
if (TARGET openssl_external)
223212
add_dependencies(openldap_external openssl_external)
@@ -244,32 +233,30 @@ set(CURL_INSTALL_DIR ${CMAKE_BINARY_DIR}/curl-install)
244233

245234
# Determine SSL and nghttp2 options
246235
if(TARGET openssl_external)
247-
set(CURL_SSL_OPTION "--with-ssl=${OPENSSL_INSTALL_DIR}")
236+
set(CURL_SSL_OPTION -DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR=${OPENSSL_INSTALL_DIR})
248237
else()
249-
set(CURL_SSL_OPTION "--without-ssl")
238+
set(CURL_SSL_OPTION -DCURL_USE_OPENSSL=OFF)
250239
endif()
251240

252-
set(CURL_CONFIGURE_COMMAND
253-
autoreconf -fi &&
254-
./configure
255-
--prefix=${CURL_INSTALL_DIR}
256-
--disable-shared
257-
--enable-debug
258-
--enable-maintainer-mode
259-
--disable-symbol-hiding
260-
--disable-docs
261-
--enable-ipv6
262-
--enable-websockets
263-
--without-libpsl
264-
--with-random=/dev/null
265-
${CURL_SSL_OPTION}
266-
--with-zlib=${ZLIB_INSTALL_DIR}
267-
--with-nghttp2=${NGHTTP2_INSTALL_DIR}
268-
--with-zstd=${ZSTD_INSTALL_DIR}
269-
--with-libidn2=${LIBIDN2_INSTALL_DIR}
270-
--with-ldap=${OPENLDAP_INSTALL_DIR}
271-
--with-ldap-lib=ldap
272-
--with-lber-lib=lber
241+
set(CURL_CMAKE_ARGS
242+
-DCMAKE_INSTALL_PREFIX=${CURL_INSTALL_DIR}
243+
-DBUILD_SHARED_LIBS=OFF
244+
-DENABLE_DEBUG=ON
245+
-DCURL_HIDDEN_SYMBOLS=OFF
246+
-DBUILD_CURL_EXE=OFF -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF
247+
-DCURL_USE_LIBPSL=OFF
248+
${CURL_SSL_OPTION}
249+
-DZLIB_INCLUDE_DIR=${ZLIB_INSTALL_DIR}/include
250+
-DZLIB_LIBRARY=${ZLIB_STATIC_LIB}
251+
-DNGHTTP2_INCLUDE_DIR=${NGHTTP2_INSTALL_DIR}/include
252+
-DNGHTTP2_LIBRARY=${NGHTTP2_STATIC_LIB}
253+
-DZSTD_INCLUDE_DIR=${ZSTD_INSTALL_DIR}/include
254+
-DZSTD_LIBRARY=${ZSTD_STATIC_LIB}
255+
-DLIBIDN2_INCLUDE_DIR=${LIBIDN2_INSTALL_DIR}/include
256+
-DLIBIDN2_LIBRARY=${LIBIDN2_STATIC_LIB}
257+
-DLDAP_INCLUDE_DIR=${OPENLDAP_INSTALL_DIR}/include
258+
-DLDAP_LIBRARY=${OPENLDAP_STATIC_LIB_LDAP}
259+
-DLDAP_LBER_LIBRARY=${OPENLDAP_STATIC_LIB_LBER}
273260
)
274261

275262
set(CURL_POST_INSTALL_COMMAND
@@ -287,11 +274,10 @@ if (DEFINED ENV{CURL_SOURCE_DIR})
287274
ExternalProject_Add(
288275
curl_external
289276
SOURCE_DIR $ENV{CURL_SOURCE_DIR}
290-
CONFIGURE_COMMAND ${CURL_CONFIGURE_COMMAND}
291-
BUILD_COMMAND $(MAKE)
292-
INSTALL_COMMAND $(MAKE) install
277+
PATCH_COMMAND ${CMAKE_COMMAND} -E echo "pre-build commands"
293278
${CURL_POST_INSTALL_COMMAND}
294-
BUILD_IN_SOURCE 1
279+
CMAKE_ARGS ${CURL_CMAKE_ARGS}
280+
BUILD_BYPRODUCTS ${CURL_INSTALL_DIR}/lib/libcurl.a
295281
)
296282
else()
297283
message(STATUS "Building curl from git master")
@@ -301,12 +287,10 @@ else()
301287
GIT_REPOSITORY ${CURL_URL}
302288
GIT_SHALLOW 1
303289
PREFIX ${CMAKE_BINARY_DIR}/curl
304-
CONFIGURE_COMMAND ${CURL_CONFIGURE_COMMAND}
305-
BUILD_COMMAND $(MAKE)
306-
INSTALL_COMMAND $(MAKE) install
290+
PATCH_COMMAND ${CMAKE_COMMAND} -E echo "pre-build commands"
307291
${CURL_POST_INSTALL_COMMAND}
308-
BUILD_IN_SOURCE 1
309-
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
292+
CMAKE_ARGS ${CURL_CMAKE_ARGS}
293+
BUILD_BYPRODUCTS ${CURL_INSTALL_DIR}/lib/libcurl.a
310294
)
311295
endif()
312296

fuzz_fnmatch.cc

100755100644
File mode changed.

generate_fnmatch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22

33
# Redirect the output of this script to a test file.
4-
printf "$1\0$2\0"
4+
printf "$1\0$2\0"

ossfuzz.sh

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,8 @@ SCRIPTDIR=${BUILD_ROOT}/scripts
3030
GDBDIR=/src/gdb
3131

3232
echo "BUILD_ROOT: $BUILD_ROOT"
33-
echo "SRC: ${SRC:-undefined}"
34-
echo "CC: $CC"
35-
echo "CXX: $CXX"
36-
echo "LIB_FUZZING_ENGINE: $LIB_FUZZING_ENGINE"
37-
echo "CFLAGS: $CFLAGS"
38-
echo "CXXFLAGS: $CXXFLAGS"
39-
echo "ARCHITECTURE: $ARCHITECTURE"
4033
echo "FUZZ_TARGETS: $FUZZ_TARGETS"
4134

42-
export MAKEFLAGS+="-j$(nproc)"
43-
4435
# Set the CURL_SOURCE_DIR for the build.
4536
export CURL_SOURCE_DIR=/src/curl
4637

scripts/compile_target.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,18 @@ else
5353
CMAKE_VERBOSE_FLAG=""
5454
fi
5555

56-
export MAKEFLAGS+="-j$(nproc)"
56+
export MAKEFLAGS; MAKEFLAGS+=" -s -j$(($(nproc) + 0))"
57+
echo "MAKEFLAGS: ${MAKEFLAGS}"
5758

5859
# Create a build directory for the dependencies.
5960
BUILD_DIR=${BUILD_ROOT}/build
6061
mkdir -p ${BUILD_DIR}
6162

63+
options=''
64+
command -v ninja >/dev/null 2>&1 && options+=' -G Ninja'
65+
6266
# Compile the dependencies.
6367
pushd ${BUILD_DIR}
64-
cmake ${CMAKE_GDB_FLAG} ..
68+
cmake ${CMAKE_GDB_FLAG} .. ${options}
6569
cmake --build . --target ${TARGET} ${CMAKE_VERBOSE_FLAG}
6670
popd

scripts/ossfuzzdeps.sh

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,5 @@ $SUDO apt-get -o Dpkg::Use-Pty=0 install -y \
3333
pkg-config \
3434
wget \
3535
cmake \
36-
ninja-build
37-
38-
# for openldap to avoid installing groff-base
39-
$SUDO touch /usr/bin/soelim
40-
$SUDO chmod +x /usr/bin/soelim
36+
ninja-build \
37+
groff-base

0 commit comments

Comments
 (0)