diff --git a/.github/workflows/native-build.yml b/.github/workflows/native-build.yml new file mode 100644 index 0000000..5be45d3 --- /dev/null +++ b/.github/workflows/native-build.yml @@ -0,0 +1,33 @@ +name: Build javascript-templates Component in Native Environment + +on: + push: + branches: [ main, 'sprint/**', 'release/**', develop ] + pull_request: + branches: [ main, 'sprint/**', 'release/**', topic/RDK*, develop ] + +jobs: + build-jst-on-pr: + name: Build javascript-templates component in github rdkcentral + runs-on: ubuntu-latest + container: + image: ghcr.io/rdkcentral/docker-rdk-ci:latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: native build + run: | + # Trust the workspace + git config --global --add safe.directory '*' + # Pull the latest changes for the native build system + git submodule update --init --recursive --remote + # Build and install dependencies + chmod +x build_tools_workflows/cov_docker_script/setup_dependencies.sh + ./build_tools_workflows/cov_docker_script/setup_dependencies.sh ./cov_docker_script/component_config.json + # Build component + chmod +x build_tools_workflows/cov_docker_script/build_native.sh + ./build_tools_workflows/cov_docker_script/build_native.sh ./cov_docker_script/component_config.json "$(pwd)" + env: + GITHUB_TOKEN: ${{ secrets.RDKCM_RDKE }} diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..0512822 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "build_tools_workflows"] + path = build_tools_workflows + url = https://github.com/rdkcentral/build_tools_workflows + branch = develop diff --git a/build_tools_workflows b/build_tools_workflows new file mode 160000 index 0000000..3d000d7 --- /dev/null +++ b/build_tools_workflows @@ -0,0 +1 @@ +Subproject commit 3d000d7841ff6bf62e3dc9be0c6eb9b9c4875c9c diff --git a/cov_docker_script/README.md b/cov_docker_script/README.md new file mode 100644 index 0000000..e4e293f --- /dev/null +++ b/cov_docker_script/README.md @@ -0,0 +1,3 @@ +# 🔧 Coverity Native Build System for RDK-B Components + +The documentation and source for the RDK-B native build system has been centralized in [rdkcentral/build_tools_workflows](https://github.com/rdkcentral/build_tools_workflows/blob/develop/cov_docker_script/README.md) \ No newline at end of file diff --git a/cov_docker_script/component_config.json b/cov_docker_script/component_config.json new file mode 100644 index 0000000..c4d738f --- /dev/null +++ b/cov_docker_script/component_config.json @@ -0,0 +1,99 @@ +{ + "_comment": "Component Build Configuration for Coverity/Native Builds", + "_version": "2.0", + "_description": "Defines dependencies and build settings for the native component", + + "dependencies": { + "_comment": "External repositories needed by this component", + "repos": [ + { + "name": "rbus", + "repo": "https://github.com/rdkcentral/rbus.git", + "branch": "v2.7.0", + "header_paths": [ + { "source": "include", "destination": "$HOME/usr/include/rdkb/rbus" }, + { "source": "src/rbus", "destination": "$HOME/usr/include/rdkb/rbus" }, + { "source": "src/core", "destination": "$HOME/usr/include/rdkb/rbus" }, + { "source": "src/rtmessage", "destination": "$HOME/usr/include/rdkb/rtmessage" } + ], + "build": { + "type": "cmake", + "build_dir": "build", + "cmake_flags": "-DCMAKE_INSTALL_PREFIX=$HOME/usr -DCMAKE_PREFIX_PATH=/usr -DBUILD_FOR_DESKTOP=ON -DCMAKE_BUILD_TYPE=Debug" + } + }, + { + "name": "trower-base64", + "repo": "https://github.com/xmidt-org/trower-base64.git", + "branch": "v1.2.7", + "header_paths": [ + { "source": "include", "destination": "$HOME/usr/include/rdkb" } + ], + "build": { + "type": "commands", + "commands": [ + "meson setup build --prefix=$HOME/usr", + "meson compile -C build" + ] + } + }, + { + "name": "common-library", + "repo": "https://github.com/rdkcentral/common-library.git", + "branch": "develop", + "header_paths": [ + { "source": "source/ccsp/include", "destination": "$HOME/usr/include/rdkb" }, + { "source": "source/ccsp/components/include", "destination": "$HOME/usr/include/rdkb" }, + { "source": "source/ccsp/custom", "destination": "$HOME/usr/include/rdkb" }, + { "source": "source/cosa/include", "destination": "$HOME/usr/include/rdkb" }, + { "source": "source/cosa/include/linux", "destination": "$HOME/usr/include/rdkb" }, + { "source": "source/cosa/include/linux", "destination": "$HOME/usr/include/rdkb/linux" }, + { "source": "source/cosa/package/slap/include", "destination": "$HOME/usr/include/rdkb" }, + { "source": "source/debug_api/include", "destination": "$HOME/usr/include/rdkb" }, + { "source": "source/util_api/http/include", "destination": "$HOME/usr/include/rdkb" }, + { "source": "source/util_api/ansc/include", "destination": "$HOME/usr/include/rdkb" }, + { "source": "source/ccsp/components/common/MessageBusHelper/include", "destination": "$HOME/usr/include/rdkb" }, + { "source": "source/dm_pack", "destination": "$HOME/usr/include/rdkb" }, + { "source": "source/ccsp/components/common/PoamIrepFolder", "destination": "$HOME/usr/include/rdkb" } + ], + "source_patches": [ + { + "file": "source/ccsp/include/ccsp_message_bus.h", + "search": "typedef struct _CCSP_MESSAGE_BUS_CONNECTION", + "replace": "typedef struct DBusLoop DBusLoop;\n\ntypedef struct _CCSP_MESSAGE_BUS_CONNECTION" + }, + { + "file": "$HOME/usr/include/rdkb/ccsp_message_bus.h", + "search": "typedef struct _CCSP_MESSAGE_BUS_CONNECTION", + "replace": "typedef struct DBusLoop DBusLoop;\n\ntypedef struct _CCSP_MESSAGE_BUS_CONNECTION" + } + ], + "build": { + "type": "script", + "script": "build_tools_workflows/cov_docker_script/common_external_build.sh" + } + }, + { + "name": "dbus", + "repo": "https://github.com/deepin-community/dbus.git", + "branch" : "master", + "build": { + "type": "cmake", + "build_dir": "build", + "cmake_flags": "-DCMAKE_INSTALL_PREFIX=$HOME/usr -DCMAKE_PREFIX_PATH=/usr -DBUILD_FOR_DESKTOP=ON -DCMAKE_BUILD_TYPE=Debug" + } + } + ] + }, + + "native_component": { + "_comment": "Configuration for the main component being built", + "name": "javascript-templates", + "include_path": "$HOME/usr/include/rdkb", + "lib_output_path": "$HOME/usr/local/lib", + "build": { + "type": "cmake", + "configure_options_file": "cov_docker_script/configure_options.conf" + } + } +} diff --git a/cov_docker_script/configure_options.conf b/cov_docker_script/configure_options.conf new file mode 100644 index 0000000..7fafc41 --- /dev/null +++ b/cov_docker_script/configure_options.conf @@ -0,0 +1,43 @@ +# Javascript-templates Configure Options +# This file contains autotools configure options for the javascript-templates component +# Each section can be edited independently for better maintainability + +# ============================================================================ +# CPPFLAGS - Preprocessor flags (includes and defines) +# ============================================================================ +[CPPFLAGS] +# Include paths +-I$HOME/usr/include/rdkb/ +-I/usr/include/dbus-1.0 +-I/usr/lib/x86_64-linux-gnu/dbus-1.0/include + +# ANSC framework defines +-D_ANSC_USER +-D_ANSC_LINUX +-D_ANSC_LITTLE_ENDIAN_ + +# Build system +-DBUILD_RDK=ON + +# Standard defines +-D_GNU_SOURCE +-D__USE_XOPEN + +# ============================================================================ +# CFLAGS - Compiler flags +# ============================================================================ +[CFLAGS] +-ffunction-sections +-fdata-sections +-fomit-frame-pointer +-fno-strict-aliasing + +# ============================================================================ +# LDFLAGS - Linker flags +# ============================================================================ +[LDFLAGS] +-L$HOME/usr/local/lib +-L/usr/lib/x86_64-linux-gnu +-Wl,--allow-shlib-undefined +-Wl,--unresolved-symbols=ignore-all +-Wl,--no-as-needed