From dc6523a957f0e37665399239b298e27cdb37a8e2 Mon Sep 17 00:00:00 2001 From: cktii Date: Tue, 4 Feb 2025 11:28:38 +0400 Subject: [PATCH] feat: initial integration behaviortreecpp --- projects/behaviortreecpp/Dockerfile | 23 +++++++++++ projects/behaviortreecpp/build.sh | 56 +++++++++++++++++++++++++++ projects/behaviortreecpp/project.yaml | 7 ++++ 3 files changed, 86 insertions(+) create mode 100644 projects/behaviortreecpp/Dockerfile create mode 100755 projects/behaviortreecpp/build.sh create mode 100644 projects/behaviortreecpp/project.yaml diff --git a/projects/behaviortreecpp/Dockerfile b/projects/behaviortreecpp/Dockerfile new file mode 100644 index 000000000000..69053044bc29 --- /dev/null +++ b/projects/behaviortreecpp/Dockerfile @@ -0,0 +1,23 @@ +# Copyright 2025 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 make autoconf automake libtool cmake pkg-config wget libsodium-dev +# RUN git clone --depth 1 https://github.com/BehaviorTree/BehaviorTree.CPP.git behaviortreecpp +RUN git clone https://github.com/cktii/BehaviorTree.CPP.git behaviortreecpp +WORKDIR behaviortreecpp +RUN git checkout fuzzing +COPY build.sh $SRC/ diff --git a/projects/behaviortreecpp/build.sh b/projects/behaviortreecpp/build.sh new file mode 100755 index 000000000000..e115124c02f4 --- /dev/null +++ b/projects/behaviortreecpp/build.sh @@ -0,0 +1,56 @@ +#!/bin/bash -eu +# Copyright 2025 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. +# +################################################################################ + +# ===== BUILD Sqlite ===== +SQLITE_VER=sqlite-autoconf-3480000 + +wget https://www.sqlite.org/2025/${SQLITE_VER}.tar.gz +tar xzf ${SQLITE_VER}.tar.gz +cd ${SQLITE_VER} +./configure --enable-static --disable-shared +make -j"$(nproc)" +make install +cd .. + +# ===== BUILD zeroMQ ===== +git clone https://github.com/zeromq/libzmq.git +cd libzmq +mkdir build && cd build +cmake .. -DBUILD_SHARED=OFF -DBUILD_STATIC=ON -DZMQ_BUILD_TESTS=OFF +make -j"$(nproc)" +make install +cd ../.. + +# ===== Build BehaviorTree.CPP ===== +mkdir build && cd build + +CMAKE_FLAGS=( + "-DCMAKE_BUILD_TYPE=Release" + "-DENABLE_FUZZING=ON" + "-DFORCE_STATIC_LINKING=ON" +) + +cmake .. "${CMAKE_FLAGS[@]}" +make -j"$(nproc)" + +for fuzzer in bt_fuzzer script_fuzzer bb_fuzzer; do + cp $fuzzer "$OUT/" + + if [ -d ../fuzzing/corpus/${fuzzer} ]; then + zip -j "$OUT/${fuzzer}_seed_corpus.zip" ../fuzzing/corpus/${fuzzer}/* + fi +done diff --git a/projects/behaviortreecpp/project.yaml b/projects/behaviortreecpp/project.yaml new file mode 100644 index 000000000000..a9610c56ee83 --- /dev/null +++ b/projects/behaviortreecpp/project.yaml @@ -0,0 +1,7 @@ +homepage: "https://www.behaviortree.dev/" +language: c++ +primary_contact: "christopher.krah@unikie.com" +main_repo: "https://github.com/BehaviorTree/BehaviorTree.CPP" +file_github_issue: true +vendor_ccs: + - "dfaconti@aurynrobotics.com"