Skip to content

formatjs: initial integration#15471

Open
rootvector2 wants to merge 4 commits into
google:masterfrom
rootvector2:add-formatjs-project
Open

formatjs: initial integration#15471
rootvector2 wants to merge 4 commits into
google:masterfrom
rootvector2:add-formatjs-project

Conversation

@rootvector2
Copy link
Copy Markdown
Contributor

Adds an initial OSS-Fuzz integration for formatjs (https://github.com/formatjs/formatjs).

Three fuzz targets, each covering a separate parser layer:

  • fuzz_icu_messageformat_parser@formatjs/icu-messageformat-parser parse()
  • fuzz_intl_messageformatintl-messageformat IntlMessageFormat constructor + format + formatToParts across 10 locales
  • fuzz_icu_skeleton_parser@formatjs/icu-skeleton-parser number and date-time skeleton parsers

Notes:

  • formatjs is a Bazel + pnpm monorepo, so the fuzz workspace installs the published @formatjs/* packages from npm rather than building from source. main_repo still points at the upstream repo.
  • The published packages are ESM-only, so build.sh runs a targeted Babel ESM→CJS transform on just node_modules/@formatjs/* and node_modules/intl-messageformat (other CJS deps are left alone).
  • @jazzer.js/core is pinned to ^2 because 4.0.0's prebuilt native addon needs GLIBC_2.32; the base images currently ship glibc 2.31. Comment in build.sh explains the pin.

Verified locally:

  • python3 infra/helper.py build_fuzzers --clean formatjs
  • python3 infra/helper.py check_build formatjs
  • Each fuzzer ran 2000 iterations with growing coverage and no spurious crashes.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

rootvector2 is integrating a new project:
- Main repo: https://github.com/formatjs/formatjs
- Criticality score: 0.63782

Copy link
Copy Markdown
Collaborator

@DavidKorczynski DavidKorczynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Project looks good. Can we store harnesses and config in the upstream repo?

Awaiting maintainer approval as well

@longlho
Copy link
Copy Markdown

longlho commented May 12, 2026

I'm formatjs maintainer and I approved

github-merge-queue Bot pushed a commit to formatjs/formatjs that referenced this pull request May 12, 2026
Adds an OSS-Fuzz integration that lives in this repo. Three Jazzer.js
fuzz targets, each covering a separate parser layer:

- fuzz_icu_messageformat_parser.js — @formatjs/icu-messageformat-parser
parse()
- fuzz_intl_messageformat.js — intl-messageformat IntlMessageFormat
constructor + format + formatToParts across 10 locales
- fuzz_icu_skeleton_parser.js — @formatjs/icu-skeleton-parser number and
date-time skeleton parsers

The fuzz workspace is independent of the Bazel/pnpm monorepo — it
installs the published @formatjs/* packages from npm so the OSS-Fuzz
build path doesn't have to reproduce the monorepo toolchain. See
[fuzz/README.md](vscode-webview://0s8u1n493osbs19tnkijf6h16u03ho50ij87rh8d1fa71706a6fb/fuzz/README.md)
for the ESM→CJS notes and the Jazzer.js ^2 pin (current OSS-Fuzz base
images ship glibc 2.31; Jazzer 4's prebuilt addon needs 2.32).

The companion OSS-Fuzz project entry is at google/oss-fuzz#15471 — it
just clones this repo and runs fuzz/build.sh.

#6484
@rootvector2
Copy link
Copy Markdown
Contributor Author

rootvector2 commented May 13, 2026

@DavidKorczynski Can you review it.. we got the approval From upstream maintainer and also added the harnesses in repo

@rootvector2
Copy link
Copy Markdown
Contributor Author

@DavidKorczynski Any Update here

@rootvector2
Copy link
Copy Markdown
Contributor Author

@DavidKorczynski also this Ci is Green Now

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.

3 participants