From c03c175c12c4ddbc6718499584cf76d6bce3c882 Mon Sep 17 00:00:00 2001 From: code-terror Date: Tue, 13 Sep 2022 15:43:24 -0700 Subject: [PATCH] Initial Integration of rust-lexical (#8469) Rust-lexical is a High-performance numeric conversion routine library for Rust. It has over 25 million downloads from crates.io. With 100,000 downloads every week. Lexical-core is also a part of the repository which is widely used as a dependency for many projects due to its small build time and build size. Co-authored-by: jonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com> --- projects/rust-lexical/Dockerfile | 21 ++++++++++++++ projects/rust-lexical/build.sh | 45 ++++++++++++++++++++++++++++++ projects/rust-lexical/project.yaml | 10 +++++++ 3 files changed, 76 insertions(+) create mode 100644 projects/rust-lexical/Dockerfile create mode 100644 projects/rust-lexical/build.sh create mode 100644 projects/rust-lexical/project.yaml diff --git a/projects/rust-lexical/Dockerfile b/projects/rust-lexical/Dockerfile new file mode 100644 index 000000000..696f6f5d7 --- /dev/null +++ b/projects/rust-lexical/Dockerfile @@ -0,0 +1,21 @@ +# Copyright 2022 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-rust as builder + +## Install build dependencies. +RUN apt-get update +RUN git clone --depth 1 https://github.com/Alexhuszagh/rust-lexical +COPY build.sh $SRC/ \ No newline at end of file diff --git a/projects/rust-lexical/build.sh b/projects/rust-lexical/build.sh new file mode 100644 index 000000000..cc7b4ebfd --- /dev/null +++ b/projects/rust-lexical/build.sh @@ -0,0 +1,45 @@ +# Copyright 2022 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. +# +################################################################################ +cd $SRC/rust-lexical/fuzz +cargo fuzz build -O +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-integer-i8 $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-integer-i16 $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-integer-i32 $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-integer-i64 $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-integer-i128 $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-integer-isize $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-integer-u8 $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-integer-u16 $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-integer-u32 $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-integer-u64 $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-integer-u128 $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-integer-usize $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-float-f32 $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/parse-float-f64 $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-float-f32 $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-float-f64 $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-integer-i8 $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-integer-i16 $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-integer-i32 $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-integer-i64 $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-integer-i128 $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-integer-isize $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-integer-u8 $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-integer-u16 $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-integer-u32 $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-integer-u64 $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-integer-u128 $OUT/ +cp $SRC/rust-lexical/fuzz/target/x86_64-unknown-linux-gnu/release/write-integer-usize $OUT/ \ No newline at end of file diff --git a/projects/rust-lexical/project.yaml b/projects/rust-lexical/project.yaml new file mode 100644 index 000000000..1cbcf598d --- /dev/null +++ b/projects/rust-lexical/project.yaml @@ -0,0 +1,10 @@ +homepage: "https://github.com/Alexhuszagh/rust-lexical" +language: rust +primary_contact: "ahuszagh@gmail.com" +auto_ccs: + - "self@myrrlyn.dev" +sanitizers: + - address +fuzzing_engines: + - libfuzzer +main_repo: 'https://github.com/Alexhuszagh/rust-lexical' \ No newline at end of file