Skip to content

Commit fb33e80

Browse files
authored
[llhttp] Fix Build Issues & Coverage Failure (google#12933)
Fixes several issues in the build which have been breaking the runtime code coverage collection since at least 2024-11-24. ### Key Changes: - Upgraded Node.js to the latest LTS release via the base image `install_javascriot.sh` script for compatibility with the upstream project's requirements. - Refined the build commands to prefer the upstream project's documentation. - Adjusted compiler flags to ensure only the executable fuzzing harness is placed in the `$OUT` directory so unnecessary build artifacts can't break anything in unexpected ways. ### Impact: - Resolves the broken coverage collection. - Marginally improves overall build times (see note below.) --- #### Note Nodejs Install Script Slowdowns The Dockerfile, both before and after this PR, uses a script hosted by https://deb.nodesource\.com to install a more recent version of Nodejs than the (extremely) old version available in the container by default. That has been working just fine, however while I was reviewing the build logs I noticed the install script prints a warning about the deprecation of this node 14 version, but more importantly: It deliberately sleeps for 80 seconds after printing the warnings, halting the build before continuing. Unfortunately this is not easy to spot when reviewing the raw log directly: https://oss-fuzz-build-logs.storage.googleapis.com/log-fdce3d72-fe01-4a10-9f84-98617dc5110b.txt It is a bit easier in the build status dashboard though: https://oss-fuzz-build-logs.storage.googleapis.com/index.html#llhttp See below: <details><summary>Log excerpt</summary> ```sh Step #1: ---> 92c0ffa5f35b Step #1: Step 3/8 : RUN curl -sL https://deb.nodesource.com/setup_14.x -o nodesource_setup.sh Step #1: ---> Running in 2337f2ad0189 Step #1: Removing intermediate container 2337f2ad0189 Step #1: ---> 4612ae8ce782 Step #1: Step 4/8 : RUN bash nodesource_setup.sh Step #1: ---> Running in e7a6477832e8 Step #1: Step #1: ================================================================================ Step #1: ================================================================================ Step #1: Step #1: DEPRECATION WARNING Step #1: Step #1: Node.js 14.x is no longer actively supported! Step #1: Step #1: You will not receive security or critical stability updates for this version. Step #1: Step #1: You should migrate to a supported version of Node.js as soon as possible. Step #1: Use the installation script that corresponds to the version of Node.js you Step #1: wish to install. e.g. Step #1: Step #1: * https://deb.nodesource.com/setup_16.x — Node.js 16 "Gallium" Step #1: * https://deb.nodesource.com/setup_18.x — Node.js 18 LTS "Hydrogen" (recommended) Step #1: * https://deb.nodesource.com/setup_19.x — Node.js 19 "Nineteen" Step #1: * https://deb.nodesource.com/setup_20.x — Node.js 20 "Iron" (current) Step #1: Step #1: Please see https://github.com/nodejs/Release for details about which Step #1: version may be appropriate for you. Step #1: Step #1: The NodeSource Node.js distributions repository contains Step #1: information both about supported versions of Node.js and supported Linux Step #1: distributions. To learn more about usage, see the repository: Step #1: https://github.com/nodesource/distributions Step #1: Step #1: ================================================================================ Step #1: ================================================================================ Step #1: Step #1: Continuing in 20 seconds ... Step #1: Step #1: Step #1: ================================================================================ Step #1: ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ Step #1: ================================================================================ Step #1: Step #1: SCRIPT DEPRECATION WARNING Step #1: Step #1: Step #1: This script, located at https://deb.nodesource.com/setup_X, used to Step #1: install Node.js is deprecated now and will eventually be made inactive. Step #1: Step #1: Please visit the NodeSource distributions Github and follow the Step #1: instructions to migrate your repo. Step #1: https://github.com/nodesource/distributions Step #1: Step #1: The NodeSource Node.js Linux distributions GitHub repository contains Step #1: information about which versions of Node.js and which Linux distributions Step #1: are supported and how to install it. Step #1: https://github.com/nodesource/distributions Step #1: Step #1: Step #1: SCRIPT DEPRECATION WARNING Step #1: Step #1: ================================================================================ Step #1: ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ Step #1: ================================================================================ Step #1: Step #1: TO AVOID THIS WAIT MIGRATE THE SCRIPT Step #1: Continuing in 60 seconds (press Ctrl-C to abort) ... Step #1: Step #1: Step #1: ## Installing the NodeSource Node.js 14.x repo... Step #1: Step #1: Step #1: ## Populating apt-get cache... Step #1: Step #1: + apt-get update Step #1: Hit:1 http://securi ``` </details>
1 parent 37c1c88 commit fb33e80

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

projects/llhttp/Dockerfile

+5-6
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@
1515
################################################################################
1616

1717
FROM gcr.io/oss-fuzz-base/base-builder
18-
RUN apt-get update && apt-get install -y make autoconf automake libtool
19-
RUN curl -sL https://deb.nodesource.com/setup_14.x -o nodesource_setup.sh
20-
RUN bash nodesource_setup.sh
21-
RUN apt install -y nodejs
22-
RUN git clone --depth 1 https://github.com/nodejs/llhttp llhttp
23-
WORKDIR llhttp
18+
RUN apt-get update \
19+
&& apt-get install -y make autoconf automake libtool
20+
RUN install_javascript.sh
21+
RUN git clone --depth 1 https://github.com/nodejs/llhttp $SRC/llhttp
2422
COPY build.sh $SRC/
23+
WORKDIR $SRC/llhttp

projects/llhttp/build.sh

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/bash -eu
1+
#!/bin/bash -euo
22
# Copyright 2021 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,10 +15,11 @@
1515
#
1616
################################################################################
1717

18-
npm install -g typescript
19-
npm link typescript
20-
npm install .
18+
rm -rf "${WORK:?}/"*
19+
make clean
20+
21+
npm ci
2122
make build/libllhttp.a
2223

23-
$CC $CFLAGS -c ./test/fuzzers/fuzz_parser.c -I./build/ ./build/libllhttp.a -o $OUT/fuzz_parser.o
24-
$CXX $CXXFLAGS $LIB_FUZZING_ENGINE -fuse-ld=lld -I./build/ ./build/libllhttp.a $OUT/fuzz_parser.o -o $OUT/fuzz_parser
24+
$CC $CFLAGS -c ./test/fuzzers/fuzz_parser.c -I./build/ ./build/libllhttp.a -o $WORK/fuzz_parser.o
25+
$CXX $CXXFLAGS $LIB_FUZZING_ENGINE -fuse-ld=lld -I./build/ ./build/libllhttp.a $WORK/fuzz_parser.o -o $OUT/fuzz_parser

0 commit comments

Comments
 (0)