Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[llhttp] Fix Build Issues & Coverage Failure #12933

Conversation

DaveLak
Copy link
Contributor

@DaveLak DaveLak commented Jan 12, 2025

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:

Log excerpt
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

Fixes several issues in the build which have been breaking the runtime code coverage collection.

### Key Changes:
- Upgraded Node.js to the latest LTS release (v22.x) 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.
Copy link

DaveLak is a new contributor to projects/llhttp. The PR must be approved by known contributors before it can be merged. The past contributors are: DonggeLiu

@DaveLak DaveLak force-pushed the projects/llhttp/update-build-script-and-dependencies branch 2 times, most recently from 296933c to d588b5f Compare January 12, 2025 16:42
Replaces the third party JavaScript toolchain install script with
the installation script included in OSS-Fuzz.
@DaveLak DaveLak force-pushed the projects/llhttp/update-build-script-and-dependencies branch from d588b5f to 4504217 Compare January 12, 2025 17:01
@oliverchang oliverchang merged commit fb33e80 into google:master Jan 13, 2025
15 checks passed
@DaveLak DaveLak deleted the projects/llhttp/update-build-script-and-dependencies branch January 13, 2025 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants