diff --git a/projects/r/Dockerfile b/projects/r/Dockerfile new file mode 100644 index 000000000000..81b187a4a6b0 --- /dev/null +++ b/projects/r/Dockerfile @@ -0,0 +1,38 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +FROM gcr.io/oss-fuzz-base/base-builder + +RUN apt-get update && apt-get install -y \ + gfortran \ + libbz2-dev \ + libcurl4-openssl-dev \ + liblzma-dev \ + libpcre2-dev \ + libreadline-dev \ + subversion \ + texinfo \ + zlib1g-dev + +# R source: the canonical upstream is SVN trunk. +RUN svn checkout --depth=infinity https://svn.r-project.org/R/trunk $SRC/r-source + +# Fuzz harnesses and build logic are maintained separately by R-devel, so +# they can be updated without a google/oss-fuzz PR. +RUN git clone --depth 1 https://github.com/r-devel/r-oss-fuzz.git $SRC/r-oss-fuzz + +COPY build.sh $SRC/ +WORKDIR $SRC/r-source diff --git a/projects/r/build.sh b/projects/r/build.sh new file mode 100644 index 000000000000..79f0e5787648 --- /dev/null +++ b/projects/r/build.sh @@ -0,0 +1,21 @@ +#!/bin/bash -eu +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +################################################################################ + +# The R fuzz targets and their build logic are maintained in a separate +# repository (https://github.com/r-devel/r-oss-fuzz), cloned into +# $SRC/r-oss-fuzz by the Dockerfile. Delegate the build to it. +exec "$SRC/r-oss-fuzz/ossfuzz.sh" diff --git a/projects/r/project.yaml b/projects/r/project.yaml new file mode 100644 index 000000000000..8f6e7a167f2e --- /dev/null +++ b/projects/r/project.yaml @@ -0,0 +1,12 @@ +homepage: "https://www.r-project.org/" +language: c +primary_contact: "simon.urbanek@r-project.org" +auto_ccs: + - "r-oss-fuzz@R-project.org" + - "kevin@posit.co" +main_repo: "https://svn.r-project.org/R/trunk" +sanitizers: + - address +fuzzing_engines: + - libfuzzer + - afl