From f51b60b6d5de8cc1a370ed633df3352d6129ef3e Mon Sep 17 00:00:00 2001 From: Suganya-Sugumar <222150366+Suganya-Sugumar@users.noreply.github.com> Date: Wed, 28 Jan 2026 06:20:31 +0000 Subject: [PATCH 01/10] RDKB-63013 coverity native build --- .gitignore | 2 + cov_docker_script/README.md | 402 ++++++++++++++++++++ cov_docker_script/component_config.json | 98 +++++ cov_docker_script/configure_options.conf | 73 ++++ cov_docker_script/run_native_build.sh | 51 +++ cov_docker_script/run_setup_dependencies.sh | 67 ++++ 6 files changed, 693 insertions(+) create mode 100644 .gitignore create mode 100644 cov_docker_script/README.md create mode 100644 cov_docker_script/component_config.json create mode 100644 cov_docker_script/configure_options.conf create mode 100755 cov_docker_script/run_native_build.sh create mode 100755 cov_docker_script/run_setup_dependencies.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c555e03 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +build_tools_workflows/ +build/ diff --git a/cov_docker_script/README.md b/cov_docker_script/README.md new file mode 100644 index 0000000..a078813 --- /dev/null +++ b/cov_docker_script/README.md @@ -0,0 +1,402 @@ +# Component Native Build Configuration + +**Coverity/Native build configuration for RDK-B components.** + +--- + +## 📋 Overview + +This directory contains the configuration and wrapper scripts necessary for building RDK-B components in a native (non-Yocto) environment. This setup enables Coverity static analysis and validates that components can be built with explicitly declared dependencies. + +### Directory Contents + +``` +/cov_docker_script/ +├── README.md # This file +├── component_config.json # Dependency & build configuration +├── configure_options.conf # Autotools configure flags (optional) +├── run_setup_dependencies.sh # Wrapper: Setup build tools & dependencies +└── run_native_build.sh # Wrapper: Setup build tools & build component +``` + +### Important: Add to .gitignore + +Add the following to your component's `.gitignore` to exclude temporary build artifacts: + +```gitignore +# Build tools (downloaded by wrapper scripts) +build_tools_workflows/ + +# Dependency build artifacts +build/ +``` + +--- + +## 🚀 Quick Start + +### Prerequisites + +- Docker container with [docker-rdk-ci](https://github.com/rdkcentral/docker-rdk-ci) image +- All wrapper scripts have execute permissions + +### Build Commands + +#### Complete Build Pipeline + +```bash +# From your component root directory +cd /path/to/your-component + +# Run complete build pipeline +./cov_docker_script/run_setup_dependencies.sh +./cov_docker_script/run_native_build.sh + +# Clean build (removes previous artifacts) +CLEAN_BUILD=true ./cov_docker_script/run_setup_dependencies.sh +./cov_docker_script/run_native_build.sh +``` + +#### Individual Steps + +```bash +# Step 1: Setup dependencies only +./cov_docker_script/run_setup_dependencies.sh + +# Step 2: Build component only (requires Step 1 completed) +./cov_docker_script/run_native_build.sh +``` + +--- + +## 📖 Scripts Reference + +### 1. run_setup_dependencies.sh + +**Purpose:** Sets up build tools and runs dependency setup. + +**What it does:** +1. Clones `build_tools_workflows` repository (develop branch) +2. Verifies required scripts are present +3. Runs `setup_dependencies.sh` from build_tools_workflows with config path to: + - Clone all dependency repositories + - Copy headers to `$HOME/usr/include/rdkb/` + - Build and install dependency libraries +4. Leaves build_tools_workflows in place for run_native_build.sh + +**Usage:** +```bash +./run_setup_dependencies.sh + +# Clean build +CLEAN_BUILD=true ./run_setup_dependencies.sh +``` + +**Required files:** +- `component_config.json` (defines dependencies) + +**Outputs:** +- Downloads: `$HOME/build/` (dependency repositories) +- Headers: `$HOME/usr/include/rdkb/` +- Libraries: `$HOME/usr/local/lib/`, `$HOME/usr/lib/` +- build_tools_workflows: Remains in place for run_native_build.sh + +**Environment Variables:** +- `BUILD_DIR` - Override build directory (default: `$HOME/build`) +- `USR_DIR` - Override install directory (default: `$HOME/usr`) +- `CLEAN_BUILD` - Set to `true` to remove previous builds + +--- + +### 2. run_native_build.sh + +**Purpose:** Verifies build tools and builds the component. + +**What it does:** +1. Verifies `build_tools_workflows` directory exists (cloned by `run_setup_dependencies.sh`) +2. Verifies `build_native.sh` is present +3. Runs `build_native.sh` from build_tools_workflows with config and component paths to: + - Apply patches to source code + - Configure build environment + - Build component + - Install libraries +4. Cleans up build_tools_workflows directory + +**Usage:** +```bash +./run_native_build.sh +``` + +**Prerequisites:** +- `run_setup_dependencies.sh` must be run first (to clone build_tools_workflows) +- All dependency headers/libraries must be available + +**Required files:** +- `component_config.json` (defines component build settings) +- `configure_options.conf` (autotools configuration) + +**Outputs:** +- Component libraries in `$HOME/usr/local/lib/` +- Build artifacts in component root directory + +--- + +## 📝 Configuration Files + +### component_config.json + +**JSON configuration defining all dependencies and build settings.** + +**Key Sections:** + +1. **dependencies.repos[]** - External dependencies required by your component + ```json + { + "name": "rbus", + "repo": "https://github.com/rdkcentral/rbus.git", + "branch": "v2.7.0", + "header_paths": [...], + "build": {...} + } + ``` + +2. **native_component** - Component build configuration + ```json + { + "name": "your-component", + "build": { + "type": "autotools", + "configure_options_file": "cov_docker_script/configure_options.conf" + } + } + ``` + +**Example Dependencies:** +Your component may require dependencies such as: +- rbus +- rdk_logger +- safec +- common-library +- halinterface +- And other component-specific dependencies + +See [component_config.json](component_config.json) for your component's specific dependency configuration. + +--- + +### configure_options.conf + +**Autotools configuration file with preprocessor, compiler, and linker flags.** + +**Format:** +```properties +[CPPFLAGS] +-I$HOME/usr/include/rdkb/ +-DFEATURE_FLAG + +[CFLAGS] +-Wall -Wextra + +[LDFLAGS] +-L$HOME/usr/local/lib/ +``` + +**Sections:** +- `[CPPFLAGS]` - Preprocessor flags (includes `-I`, defines `-D`) +- `[CFLAGS]` - C compiler flags +- `[CXXFLAGS]` - C++ compiler flags +- `[LDFLAGS]` - Linker flags (library paths `-L`, linker options `-Wl`) + +**Component-Specific Flags:** +Customize flags based on your component's requirements: +- Platform defines: `_COSA_INTEL_USG_ARM_`, `_COSA_BCM_ARM_`, etc. +- Product defines: `_XB6_PRODUCT_REQ_`, `_XB7_PRODUCT_REQ_`, etc. +- Feature flags: `FEATURE_SUPPORT_RDKLOG`, component-specific features, etc. + +See [configure_options.conf](configure_options.conf) for your component's complete flag list. + +--- + +## 🔧 Build System Architecture + +``` +┌─────────────────────────────────────────────────────┐ +│ run_setup_dependencies.sh │ +│ ┌──────────────────────────────────────────────┐ │ +│ │ 1. Clone build_tools_workflows │ │ +│ │ (develop branch) │ │ +│ │ │ │ +│ │ 2. Verify required scripts present │ │ +│ │ │ │ +│ │ 3. Run setup_dependencies.sh from │ │ +│ │ build_tools_workflows with config path │ │ +│ │ - Read component_config.json │ │ +│ │ - Clone dependency repos │ │ +│ │ - Copy headers │ │ +│ │ - Build & install libraries │ │ +│ └──────────────────────────────────────────────┘ │ +└─────────────────────────────────────────────────────┘ + │ + ▼ +┌─────────────────────────────────────────────────────┐ +│ run_native_build.sh │ +│ ┌──────────────────────────────────────────────┐ │ +│ │ 1. Verify build_tools_workflows exists │ │ +│ │ (cloned by run_setup_dependencies.sh) │ │ +│ │ │ │ +│ │ 2. Run build_native.sh from │ │ +│ │ build_tools_workflows with config and │ │ +│ │ component directory paths │ │ +│ │ - Process component headers │ │ +│ │ - Apply source patches (if configured) │ │ +│ │ - Read configure_options.conf │ │ +│ │ - Configure build (autogen/configure) │ │ +│ │ - Build component (make/cmake/meson) │ │ +│ │ - Install libraries │ │ +│ │ │ │ +│ │ 3. Cleanup build_tools_workflows directory │ │ +│ └──────────────────────────────────────────────┘ │ +└─────────────────────────────────────────────────────┘ +``` + +--- + +## 🐛 Troubleshooting + +### Build Failures + +**Problem:** Missing headers + +```bash +# Solution: Check if dependencies were installed +ls -la $HOME/usr/include/rdkb/ + +# Verify component_config.json has correct header_paths +cat component_config.json | jq '.dependencies.repos[].header_paths' + +# Re-run dependency setup +CLEAN_BUILD=true ./cov_docker_script/run_setup_dependencies.sh +``` + +**Problem:** Missing libraries + +```bash +# Solution: Check library installation +ls -la $HOME/usr/local/lib/ +ls -la $HOME/usr/lib/ + +# Verify PKG_CONFIG_PATH +echo $PKG_CONFIG_PATH + +# Check if dependency build failed +cd $HOME/build/ +cat config.log # For autotools +cat build/meson-log.txt # For meson +``` + +**Problem:** Configure errors + +```bash +# Solution: Check configure_options.conf syntax +cat cov_docker_script/configure_options.conf + +# Verify flags are valid +./configure --help +``` + +### Script Errors + +**Problem:** Script not found + +```bash +# Solution: Ensure scripts are executable +chmod +x cov_docker_script/*.sh + +# Check if build_tools_workflows was cloned +ls -la ../build_tools_workflows/ +``` + +**Problem:** Permission denied + +```bash +# Solution: Fix container permissions +# (Run on host, not in container) +sudo docker exec rdkb-builder groupadd $USER --gid=$(id -g $USER) +sudo docker exec rdkb-builder useradd -m $USER -G users \ + --uid=$(id -u $USER) --gid=$(id -g $USER) +``` + +--- + +## 📚 Related Documentation + +- **Build Tools Repository:** [build_tools_workflows](https://github.com/rdkcentral/build_tools_workflows/tree/develop) +- **Docker Environment:** [docker-rdk-ci](https://github.com/rdkcentral/docker-rdk-ci) +- **Example Component:** [moca-agent](https://github.com/rdkcentral/moca-agent) (reference implementation) +- **Detailed Build Guide:** See `build_tools_workflows/cov_docker_script/README.md` + +--- + +## ⚠️ Important Notes + +### DO NOT Modify + +The following scripts are automatically copied from `build_tools_workflows` and **must not be modified locally**: + +- ❌ `build_native.sh` +- ❌ `common_build_utils.sh` +- ❌ `common_external_build.sh` +- ❌ `setup_dependencies.sh` + +Any changes will be overwritten when wrapper scripts run. + +### DO Modify + +The following files are component-specific and **should be customized**: + +- ✅ `component_config.json` - Dependency and build configuration +- ✅ `configure_options.conf` - Autotools flags +- ✅ `run_setup_dependencies.sh` - Wrapper script (if needed) +- ✅ `run_native_build.sh` - Wrapper script (if needed) + +--- + +## 🔄 Workflow Integration + +### Local Development + +```bash +# Make changes to source code +vim source/your_component.c + +# Rebuild component +CLEAN_BUILD=true ./cov_docker_script/run_native_build.sh +``` + +### CI/CD Integration + +This configuration is used by GitHub Actions to validate builds: + +```yaml +- name: Setup Dependencies + run: ./cov_docker_script/run_setup_dependencies.sh + +- name: Build Component + run: ./cov_docker_script/run_native_build.sh +``` + +See `.github/workflows/` for complete CI configuration. + +--- + +## 📞 Support + +For issues or questions: + +1. Check [Troubleshooting](#troubleshooting) section +2. Review [build_tools_workflows README](https://github.com/rdkcentral/build_tools_workflows/blob/develop/cov_docker_script/README.md) +3. Raise issue in your component repository or [build_tools_workflows](https://github.com/rdkcentral/build_tools_workflows/issues) + +--- + +**Last Updated:** January 2026 diff --git a/cov_docker_script/component_config.json b/cov_docker_script/component_config.json new file mode 100644 index 0000000..4e976c0 --- /dev/null +++ b/cov_docker_script/component_config.json @@ -0,0 +1,98 @@ +{ + "_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": "rdk_logger", + "repo": "https://github.com/rdkcentral/rdk_logger.git", + "branch": "main", + "header_paths": [ + { "source": "include", "destination": "$HOME/usr/include/rdkb" } + ], + "build": { + "type": "autotools" + } + }, + { + "name": "gmock-broadband", + "repo": "https://github.com/rdkcentral/gmock-broadband.git", + "branch": "develop", + "header_paths": [ + { "source": "docker_scripts/common_headers", "destination": "$HOME/usr/include/rdkb" } + ] + }, + { + "name": "libSyscallWrapper", + "repo": "https://github.com/rdkcentral/libSyscallWrapper.git", + "branch": "develop", + "header_paths": [ + { "source": "source", "destination": "$HOME/usr/include/rdkb" } + ], + "build": { + "type": "autotools", + "configure_flags": "CPPFLAGS=\"-I$HOME/usr/include/rdkb\" LDFLAGS=\"-L$HOME/usr/local/lib\"" + } + }, + { + "name": "common-library", + "repo": "https://github.com/rdkcentral/common-library.git", + "branch": "feature/native_build_for_coverity", + "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_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": "cov_docker_script/common_external_build.sh" + } + }, + { + "name": "breakpad_wrapper", + "repo": "https://github.com/rdkcentral/breakpad_wrapper.git", + "branch": "main", + "header_paths": [ + { "source": ".", "destination": "$HOME/usr/include/rdkb" } + ] + } + ] + }, + + "native_component": { + "_comment": "Configuration for the main component being built", + "name": "javascript-template", + "include_path": "$HOME/usr/include/rdkb/", + "lib_output_path": "$HOME/usr/local/lib/", + "pre_build_commands": [ + ], + "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..a9a7c69 --- /dev/null +++ b/cov_docker_script/configure_options.conf @@ -0,0 +1,73 @@ +# MoCA Agent Configure Options +# This file contains autotools configure options for the moca-agent component +# Each section can be edited independently for better maintainability + +# ============================================================================ +# CPPFLAGS - Preprocessor flags (includes and defines) +# ============================================================================ +[CPPFLAGS] +# Autotools configuration +-DHAVE_CONFIG_H + +# Include paths +-I/usr/include/dbus-1.0 +-I/usr/lib/dbus-1.0/include +-I/usr/include/ccsp + +# Core system defines +-DDUK_USE_PROMISE_BUILTIN +-DDUK_CMDLINE_PRINTALERT_SUPPORT +-DDUK_CMDLINE_CONSOLE_SUPPORT +-DDUK_CMDLINE_LOGGING_SUPPORT +-DDUK_CMDLINE_MODULE_SUPPORT + +# ANSC framework defines +-D_ANSC_USER +-D_ANSC_LINUX +-D_ANSC_LITTLE_ENDIAN_ + +# Product/Platform defines +-DBUILD_RDK + +# Security and debugging +-DENABLE_SA_KEY +-D_NO_EXECINFO_H_ +-D_DEBUG +-DINCLUDE_BREAKPAD + +# System features +-DFEATURE_SUPPORT_RDKLOG +-DFEATURE_SUPPORT_SYSLOG +-DBUILD_WEB +-DUSE_NOTIFY_COMPONENT +-DNTPD_ENABLE +-DUTC_ENABLE +-DUTC_ENABLE_ATOM +-DXDNS_ENABLE + +# Test/Development +-DCOLUMBO_HWTEST + +# Build system +-DRBUS_BUILD_FLAG_ENABLE + +# 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/ +-Wl,--allow-shlib-undefined +-Wl,--unresolved-symbols=ignore-all diff --git a/cov_docker_script/run_native_build.sh b/cov_docker_script/run_native_build.sh new file mode 100755 index 0000000..9d3aea3 --- /dev/null +++ b/cov_docker_script/run_native_build.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +set -e + +################################################################################ +# Native Build Wrapper Script +# Verifies build tools and runs build_native.sh +# Usage: ./run_native_build.sh +# Note: run_setup_dependencies.sh should be executed first +################################################################################ + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +NATIVE_COMPONENT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" +BUILD_TOOLS_DIR="$NATIVE_COMPONENT_DIR/build_tools_workflows" + +# Basic logging functions +log() { echo "[INFO] $*"; } +ok() { echo "[OK] $*"; } +err() { echo "[ERROR] $*" >&2; } + +echo "" +echo "===== Native Build Pipeline =====" +echo "" + +# Verify build_tools_workflows exists (should be cloned by run_setup_dependencies.sh) +if [[ ! -d "$BUILD_TOOLS_DIR" ]]; then + err "build_tools_workflows directory not found. Please run run_setup_dependencies.sh first." + exit 1 +fi + +if [[ ! -f "$BUILD_TOOLS_DIR/cov_docker_script/build_native.sh" ]]; then + err "build_native.sh not found in build_tools_workflows. Please run run_setup_dependencies.sh first." + exit 1 +fi + +log "Build script found, proceeding with build..." + +# Run build_native.sh from build_tools_workflows +echo "" +log "Running build_native.sh from build_tools_workflows..." +cd "$NATIVE_COMPONENT_DIR" +"$BUILD_TOOLS_DIR/cov_docker_script/build_native.sh" "$SCRIPT_DIR/component_config.json" "$NATIVE_COMPONENT_DIR" + +echo "" +ok "Native build completed successfully!" + +# Cleanup build_tools_workflows directory +log "Cleaning up build_tools_workflows directory..." +rm -rf "$BUILD_TOOLS_DIR" +ok "Cleanup completed" + +echo "" diff --git a/cov_docker_script/run_setup_dependencies.sh b/cov_docker_script/run_setup_dependencies.sh new file mode 100755 index 0000000..5223c84 --- /dev/null +++ b/cov_docker_script/run_setup_dependencies.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash +set -e + +################################################################################ +# Setup Dependencies Wrapper Script +# Sets up build tools and runs setup_dependencies.sh +# Usage: ./run_setup_dependencies.sh +################################################################################ + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +NATIVE_COMPONENT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" +BUILD_TOOLS_REPO_URL="https://github.com/rdkcentral/build_tools_workflows" +BUILD_TOOLS_DIR="$NATIVE_COMPONENT_DIR/build_tools_workflows" +REQUIRED_SCRIPTS=("build_native.sh" "common_build_utils.sh" "common_external_build.sh" "setup_dependencies.sh") + +# Basic logging functions +log() { echo "[INFO] $*"; } +ok() { echo "[OK] $*"; } +err() { echo "[ERROR] $*" >&2; } + +echo "" +echo "===== Setup Dependencies Pipeline =====" +echo "" + +# Setup build tools +log "Setting up build tools..." + +# Clone build_tools_workflows +if [[ -d "$BUILD_TOOLS_DIR" ]]; then + log "build_tools_workflows already exists, skipping clone" +else + log "Cloning build_tools_workflows (develop)" + cd "$NATIVE_COMPONENT_DIR" + git clone -b develop "$BUILD_TOOLS_REPO_URL" || { err "Clone failed"; exit 1; } + ok "Repository cloned" +fi + +# Verify required scripts +[[ ! -d "$BUILD_TOOLS_DIR/cov_docker_script" ]] && { err "cov_docker_script not found"; exit 1; } + +log "Verifying required scripts..." +MISSING=() +for script in "${REQUIRED_SCRIPTS[@]}"; do + [[ -f "$BUILD_TOOLS_DIR/cov_docker_script/$script" ]] || MISSING+=("$script") +done + +if [[ ${#MISSING[@]} -gt 0 ]]; then + err "Missing scripts: ${MISSING[*]}" + exit 1 +fi +ok "All required scripts found" + +# Verify setup_dependencies.sh exists before running +if [[ ! -f "$BUILD_TOOLS_DIR/cov_docker_script/setup_dependencies.sh" ]]; then + err "setup_dependencies.sh not found in build_tools_workflows" + exit 1 +fi + +# Run setup_dependencies.sh from build_tools_workflows +echo "" +log "Running setup_dependencies.sh from build_tools_workflows..." +cd "$NATIVE_COMPONENT_DIR" +"$BUILD_TOOLS_DIR/cov_docker_script/setup_dependencies.sh" "$SCRIPT_DIR/component_config.json" + +echo "" +echo "[OK] Dependencies setup completed successfully!" +echo "" From 3a5b82a7abe936f55abe30b7a3ffae548042337a Mon Sep 17 00:00:00 2001 From: Suganya-Sugumar <222150366+Suganya-Sugumar@users.noreply.github.com> Date: Wed, 28 Jan 2026 06:22:56 +0000 Subject: [PATCH 02/10] RDKB-63013 coverity native build --- cov_docker_script/component_config.json | 74 ------------------------- 1 file changed, 74 deletions(-) diff --git a/cov_docker_script/component_config.json b/cov_docker_script/component_config.json index 4e976c0..f813de6 100644 --- a/cov_docker_script/component_config.json +++ b/cov_docker_script/component_config.json @@ -6,80 +6,6 @@ "dependencies": { "_comment": "External repositories needed by this component", "repos": [ - { - "name": "rdk_logger", - "repo": "https://github.com/rdkcentral/rdk_logger.git", - "branch": "main", - "header_paths": [ - { "source": "include", "destination": "$HOME/usr/include/rdkb" } - ], - "build": { - "type": "autotools" - } - }, - { - "name": "gmock-broadband", - "repo": "https://github.com/rdkcentral/gmock-broadband.git", - "branch": "develop", - "header_paths": [ - { "source": "docker_scripts/common_headers", "destination": "$HOME/usr/include/rdkb" } - ] - }, - { - "name": "libSyscallWrapper", - "repo": "https://github.com/rdkcentral/libSyscallWrapper.git", - "branch": "develop", - "header_paths": [ - { "source": "source", "destination": "$HOME/usr/include/rdkb" } - ], - "build": { - "type": "autotools", - "configure_flags": "CPPFLAGS=\"-I$HOME/usr/include/rdkb\" LDFLAGS=\"-L$HOME/usr/local/lib\"" - } - }, - { - "name": "common-library", - "repo": "https://github.com/rdkcentral/common-library.git", - "branch": "feature/native_build_for_coverity", - "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_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": "cov_docker_script/common_external_build.sh" - } - }, - { - "name": "breakpad_wrapper", - "repo": "https://github.com/rdkcentral/breakpad_wrapper.git", - "branch": "main", - "header_paths": [ - { "source": ".", "destination": "$HOME/usr/include/rdkb" } - ] - } ] }, From e63168435f97f25046682685ef6fb780bac34faa Mon Sep 17 00:00:00 2001 From: Suganya-Sugumar <222150366+Suganya-Sugumar@users.noreply.github.com> Date: Fri, 30 Jan 2026 10:42:09 +0000 Subject: [PATCH 03/10] RDKB-63154 RDKB-63013 native build integ --- cov_docker_script/component_config.json | 84 ++++++++++++++++++++-- cov_docker_script/configure_options.conf | 91 +++++++++++++++++++++--- 2 files changed, 162 insertions(+), 13 deletions(-) diff --git a/cov_docker_script/component_config.json b/cov_docker_script/component_config.json index f813de6..99893d6 100644 --- a/cov_docker_script/component_config.json +++ b/cov_docker_script/component_config.json @@ -6,18 +6,94 @@ "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": "feature/native_build_for_coverity", + "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": "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-template", - "include_path": "$HOME/usr/include/rdkb/", - "lib_output_path": "$HOME/usr/local/lib/", - "pre_build_commands": [ - ], + "include_path": "$HOME/usr/include/rdkb:usr/include:$HOME/usr/include/rdkb/rbus:/usr/include/dbus-1.0:/usr/lib/x86_64-linux-gnu/dbus-1.0/include:$HOME/usr/include/rdkb/dbus:/usr/include/ccsp", + "lib_output_path": "$HOME/usr/local/lib", "build": { "type": "cmake", + "cmake_flags": "-DBUILD_RDK=ON -DCMAKE_C_FLAGS=\"-I$HOME/usr/include/rdkb -I$HOME/usr/include/rdkb/dbus -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/ccsp -I$HOME/usr/include/rdkb/dbus -DBUILD_RBUS\" -DCMAKE_EXE_LINKER_FLAGS='-Wl,--allow-shlib-undefined -Wl,--unresolved-symbols=ignore-all' -DCMAKE_C_STANDARD_LIBRARIES=\"-L$HOME/usr/local/lib\"", "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 index a9a7c69..887f4ef 100644 --- a/cov_docker_script/configure_options.conf +++ b/cov_docker_script/configure_options.conf @@ -10,24 +10,43 @@ -DHAVE_CONFIG_H # Include paths +-I$HOME/usr/include/rdkb/ -I/usr/include/dbus-1.0 --I/usr/lib/dbus-1.0/include --I/usr/include/ccsp +-I/usr/lib/x86_64-linux-gnu/dbus-1.0/include # Core system defines --DDUK_USE_PROMISE_BUILTIN --DDUK_CMDLINE_PRINTALERT_SUPPORT --DDUK_CMDLINE_CONSOLE_SUPPORT --DDUK_CMDLINE_LOGGING_SUPPORT --DDUK_CMDLINE_MODULE_SUPPORT +-DSAFEC_DUMMY_API +-D_COSA_HAL_ +-U_COSA_SIM_ +-DCONFIG_SYSTEM_MOCA # ANSC framework defines -D_ANSC_USER -D_ANSC_LINUX -D_ANSC_LITTLE_ENDIAN_ +-D_ANSC_USE_OPENSSL_ +-D_ANSC_AES_USED_ +-D_NO_ANSC_ZLIB_ +-U_ANSC_IPV6_COMPATIBLE_ + +# CCSP/Component defines +-D_CCSP_CWMP_TCP_CONNREQ_HANDLER +-D_DSLH_STUN_ +-D_NO_PKI_KB5_SUPPORT +-D_BBHM_SSE_FILE_IO +-DCCSP_SUPPORT_ENABLED # Product/Platform defines --DBUILD_RDK +-D_COSA_INTEL_USG_ARM_ +-D_COSA_FOR_COMCAST_ +-D_COSA_BCM_ARM_ +-D_XB6_PRODUCT_REQ_ +-D_XB7_PRODUCT_REQ_ +-D_XB8_PRODUCT_REQ_ + +# Vendor/Customer configuration +-DCONFIG_VENDOR_CUSTOMER_COMCAST +-DCONFIG_CISCO_HOTSPOT # Security and debugging -DENABLE_SA_KEY @@ -45,10 +64,62 @@ -DUTC_ENABLE_ATOM -DXDNS_ENABLE +# Core system defines +-DDUK_USE_PROMISE_BUILTIN +-DDUK_CMDLINE_PRINTALERT_SUPPORT +-DDUK_CMDLINE_CONSOLE_SUPPORT +-DDUK_CMDLINE_LOGGING_SUPPORT +-DDUK_CMDLINE_MODULE_SUPPORT + +# Network features +-DENABLE_ETH_WAN +-DEROUTER_DHCP_OPTION_MTA +-DETH_4_PORTS +-D_2_5G_ETHERNET_SUPPORT_ +-D_MACSEC_SUPPORT_ +-D_BRIDGE_UTILS_BIN_ +-DAUTOWAN_ENABLE +-DENABLE_WANMODECHANGE_NOREBOOT +-DFEATURE_RDKB_WAN_MANAGER +-DFEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE +-DWAN_MANAGER_UNIFICATION_ENABLED +-DWAN_FAILOVER_SUPPORTED +-DGATEWAY_FAILOVER_SUPPORTED + +# WiFi features +-D_ENABLE_BAND_STEERING_ +-D_BEACONRATE_SUPPORT +-D_TRI_BAND_WIFI_ +-D_WIFI_AX_SUPPORT_ +-D_WIFI_CONSOLIDATED_STANDARDS_ +-DWIFI_HAL_VERSION_3 +-DFEATURE_SUPPORT_MESH +-DFEATURE_SUPPORT_WEBCONFIG +-DFEATURE_SUPPORT_INTERWORKING +-DFEATURE_SUPPORT_PASSPOINT +-DWIFI_STATS_DISABLE_SPEEDTEST_RUNNING +-DFEATURE_SUPPORT_RADIUSGREYLIST +-DFEATURE_SUPPORT_ACL_SELFHEAL +-DFEATURE_CSI +-DFEATURE_SUPPORT_ONBOARD_LOGGING +-DFEATURE_OFF_CHANNEL_SCAN_5G +-DRDK_ONEWIFI +-DWIFI_MANAGE_SUPPORTED + +# Advanced features +-D_PSM_TRANS_RDK_TRIGG_ +-D_CM_HIGHSPLIT_SUPPORTED_ +-DFEATURE_RDKB_INTER_DEVICE_MANAGER +-DFEATURE_SUPPORT_MAPT_NAT46 +-DMAPT_UNIFICATION_ENABLED +-DSPEED_BOOST_SUPPORTED +-DAMENITIES_NETWORK_ENABLED + # Test/Development -DCOLUMBO_HWTEST # Build system +-DBUILD_RDK=ON -DRBUS_BUILD_FLAG_ENABLE # Standard defines @@ -68,6 +139,8 @@ # LDFLAGS - Linker flags # ============================================================================ [LDFLAGS] --L$HOME/usr/local/lib/ +-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 From a753489c1f39b7059d6a6ae24db7f351c06e48f1 Mon Sep 17 00:00:00 2001 From: Suganya-Sugumar <222150366+Suganya-Sugumar@users.noreply.github.com> Date: Fri, 30 Jan 2026 12:48:13 +0000 Subject: [PATCH 04/10] RDKB-63154 RDKB-63013 cmake corrections --- cov_docker_script/component_config.json | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cov_docker_script/component_config.json b/cov_docker_script/component_config.json index 99893d6..583b5c3 100644 --- a/cov_docker_script/component_config.json +++ b/cov_docker_script/component_config.json @@ -3,7 +3,7 @@ "_version": "2.0", "_description": "Defines dependencies and build settings for the native component", -"dependencies": { + "dependencies": { "_comment": "External repositories needed by this component", "repos": [ { @@ -88,13 +88,12 @@ "native_component": { "_comment": "Configuration for the main component being built", - "name": "javascript-template", - "include_path": "$HOME/usr/include/rdkb:usr/include:$HOME/usr/include/rdkb/rbus:/usr/include/dbus-1.0:/usr/lib/x86_64-linux-gnu/dbus-1.0/include:$HOME/usr/include/rdkb/dbus:/usr/include/ccsp", + "name": "javascript-templates", + "include_path": "$HOME/usr/include/rdkb:/usr/include/dbus-1.0:/usr/lib/x86_64-linux-gnu/dbus-1.0/include", "lib_output_path": "$HOME/usr/local/lib", "build": { "type": "cmake", - "cmake_flags": "-DBUILD_RDK=ON -DCMAKE_C_FLAGS=\"-I$HOME/usr/include/rdkb -I$HOME/usr/include/rdkb/dbus -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/ccsp -I$HOME/usr/include/rdkb/dbus -DBUILD_RBUS\" -DCMAKE_EXE_LINKER_FLAGS='-Wl,--allow-shlib-undefined -Wl,--unresolved-symbols=ignore-all' -DCMAKE_C_STANDARD_LIBRARIES=\"-L$HOME/usr/local/lib\"", - "configure_options_file": "cov_docker_script/configure_options.conf" + "cmake_flags": "-DBUILD_RDK=ON -DCMAKE_C_FLAGS=\"-I$HOME/usr/include/rdkb -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -DBUILD_RBUS\" -DCMAKE_EXE_LINKER_FLAGS='-Wl,--allow-shlib-undefined -Wl,--unresolved-symbols=ignore-all' -DCMAKE_C_STANDARD_LIBRARIES=\"-L$HOME/usr/local/lib\"" } } } From e78a8471c607a1f91335701b55b0fc33e7cf4456 Mon Sep 17 00:00:00 2001 From: Suganya-Sugumar <222150366+Suganya-Sugumar@users.noreply.github.com> Date: Thu, 5 Feb 2026 11:53:04 +0000 Subject: [PATCH 05/10] RDKB-63154 RDKB-63013 update coverity scripts --- cov_docker_script/README.md | 89 +++++++++++++++++++++++- cov_docker_script/configure_options.conf | 4 +- cov_docker_script/run_external_build.sh | 51 ++++++++++++++ 3 files changed, 140 insertions(+), 4 deletions(-) create mode 100644 cov_docker_script/run_external_build.sh diff --git a/cov_docker_script/README.md b/cov_docker_script/README.md index a078813..e06d1a2 100644 --- a/cov_docker_script/README.md +++ b/cov_docker_script/README.md @@ -16,7 +16,8 @@ This directory contains the configuration and wrapper scripts necessary for buil ├── component_config.json # Dependency & build configuration ├── configure_options.conf # Autotools configure flags (optional) ├── run_setup_dependencies.sh # Wrapper: Setup build tools & dependencies -└── run_native_build.sh # Wrapper: Setup build tools & build component +├── run_native_build.sh # Wrapper: Build main component +└── run_external_build.sh # Wrapper: For dependency builds (used in component_config.json) ``` ### Important: Add to .gitignore @@ -48,7 +49,7 @@ build/ # From your component root directory cd /path/to/your-component -# Run complete build pipeline +# Standard build pipeline for main component ./cov_docker_script/run_setup_dependencies.sh ./cov_docker_script/run_native_build.sh @@ -57,6 +58,20 @@ CLEAN_BUILD=true ./cov_docker_script/run_setup_dependencies.sh ./cov_docker_script/run_native_build.sh ``` +#### Alternative: Single-Script Build (All-in-One) + +If you prefer to run everything in a single command: + +```bash +# Run setup dependencies + native build in one script +./cov_docker_script/run_external_build.sh + +# Clean build +CLEAN_BUILD=true ./cov_docker_script/run_external_build.sh +``` + +**Note:** `run_external_build.sh` performs both dependency setup and component build in one execution. While primarily designed to be invoked by the dependency setup process when specified in `component_config.json` (see [run_external_build.sh](#3-run_external_buildsh) section), it can also be used directly for the main component as a convenience script that handles the complete build pipeline. + #### Individual Steps ```bash @@ -141,6 +156,76 @@ CLEAN_BUILD=true ./run_setup_dependencies.sh --- +### 3. run_external_build.sh + +**Purpose:** Builds dependencies with complex build requirements (invoked from component_config.json). + +**Key Differences from run_native_build.sh:** +- Designed for **dependency repositories**, not the main component +- Invokes `common_external_build.sh` without arguments (dependencies manage their own configuration) +- Does **NOT** clean up `build_tools_workflows` (may be used by multiple dependencies) +- Typically called automatically during dependency setup, not manually + +**What it does:** +1. Clones `build_tools_workflows` if not present (or verifies it exists) +2. Verifies `common_external_build.sh` is present +3. Runs `common_external_build.sh` from build_tools_workflows +4. Preserves `build_tools_workflows` directory for subsequent use + +**Usage:** +```bash +./run_external_build.sh +``` + +**Prerequisites:** +- `run_setup_dependencies.sh` must be run first (to clone build_tools_workflows) +- All dependency headers/libraries must be available + +**Outputs:** +- Build artifacts based on common_external_build.sh implementation +- build_tools_workflows remains in place (not cleaned up) + +**Primary Use Case - Dependency Builds in component_config.json:** + +This script is primarily used to build **dependency repositories** that have complex build requirements. When a dependency has its own `cov_docker_script/run_external_build.sh`, it can be invoked from the parent component's `component_config.json`. + +**Example configuration in component_config.json:** + +```json +{ + "name": "Utopia", + "repo": "https://github.com/rdkcentral/utopia.git", + "branch": "feature/cov_native_build", + "header_paths": [ + { "source": "source/include", "destination": "$HOME/usr/include/rdkb" } + ], + "build": { + "type": "script", + "script": "cov_docker_script/run_external_build.sh" + } +} +``` + +**How it works for dependencies:** +1. The parent component's `setup_dependencies.sh` clones the dependency repository (e.g., Utopia) +2. The dependency's `run_external_build.sh` is executed from the dependency's directory +3. This script internally: + - Sets up the dependency's own build tools and dependencies + - Runs the dependency's native build process + - Produces shared libraries (`.so` files) +4. The generated shared libraries are installed to `$HOME/usr/local/lib/` or `$HOME/usr/lib/` +5. These libraries are then available for the parent component's native build + +**When to use this approach:** +- Dependency has complex multi-step build requirements +- Dependency has its own sub-dependencies that need to be built +- Dependency requires custom build logic beyond standard autotools/cmake/meson +- Dependency repository already has a `cov_docker_script/run_external_build.sh` script + +**Note:** This approach allows dependencies to manage their own complete build pipeline, producing the necessary shared libraries that the parent component links against during its native compilation. + +--- + ## 📝 Configuration Files ### component_config.json diff --git a/cov_docker_script/configure_options.conf b/cov_docker_script/configure_options.conf index 887f4ef..d75e3e4 100644 --- a/cov_docker_script/configure_options.conf +++ b/cov_docker_script/configure_options.conf @@ -1,5 +1,5 @@ -# MoCA Agent Configure Options -# This file contains autotools configure options for the moca-agent component +# javascript-templates Configure Options +# This file contains autotools configure options for the component # Each section can be edited independently for better maintainability # ============================================================================ diff --git a/cov_docker_script/run_external_build.sh b/cov_docker_script/run_external_build.sh new file mode 100644 index 0000000..d6e9a21 --- /dev/null +++ b/cov_docker_script/run_external_build.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +set -e + +################################################################################ +# External Build Wrapper Script +# Verifies build tools and runs common_external_build.sh +# Usage: ./run_external_build.sh +# Note: run_setup_dependencies.sh should be executed first +################################################################################ + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +NATIVE_COMPONENT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" +BUILD_TOOLS_REPO_URL="https://github.com/rdkcentral/build_tools_workflows" +BUILD_TOOLS_DIR="$NATIVE_COMPONENT_DIR/build_tools_workflows" + +# Basic logging functions +log() { echo "[INFO] $*"; } +ok() { echo "[OK] $*"; } +err() { echo "[ERROR] $*" >&2; } + +echo "" +echo "===== External Build Pipeline =====" +echo "" + +# Clone build_tools_workflows if it doesn't exist +if [[ ! -d "$BUILD_TOOLS_DIR" ]]; then + log "build_tools_workflows not found, cloning repository..." + cd "$NATIVE_COMPONENT_DIR" + git clone -b develop "$BUILD_TOOLS_REPO_URL" || { err "Clone failed"; exit 1; } + ok "Repository cloned successfully" +else + log "build_tools_workflows already exists" +fi + +if [[ ! -f "$BUILD_TOOLS_DIR/cov_docker_script/common_external_build.sh" ]]; then + err "common_external_build.sh not found in build_tools_workflows. Please run run_setup_dependencies.sh first." + exit 1 +fi + +log "Build script found, proceeding with build..." + +# Run common_external_build.sh from build_tools_workflows +echo "" +log "Running common_external_build.sh from build_tools_workflows..." +cd "$NATIVE_COMPONENT_DIR" +"$BUILD_TOOLS_DIR/cov_docker_script/common_external_build.sh" "$SCRIPT_DIR/component_config.json" "$NATIVE_COMPONENT_DIR" + +echo "" +ok "External build completed successfully!" + +echo "" From d8f0eae351f4b28b451fe435738c3f64a356d93c Mon Sep 17 00:00:00 2001 From: Suganya-Sugumar <222150366+Suganya-Sugumar@users.noreply.github.com> Date: Tue, 10 Feb 2026 06:24:53 +0000 Subject: [PATCH 06/10] RDKB-63154 RDKB-63013 native build integ --- .gitignore | 1 - .gitmodules | 4 + build_tools_workflows | 1 + cov_docker_script/component_config.json | 4 +- cov_docker_script/configure_options.conf | 103 ++--------------------- 5 files changed, 15 insertions(+), 98 deletions(-) create mode 100644 .gitmodules create mode 160000 build_tools_workflows diff --git a/.gitignore b/.gitignore index c555e03..567609b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ -build_tools_workflows/ build/ 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..b7c9625 --- /dev/null +++ b/build_tools_workflows @@ -0,0 +1 @@ +Subproject commit b7c962552e1b7e0467b1b766d263194e7b5e57bf diff --git a/cov_docker_script/component_config.json b/cov_docker_script/component_config.json index 583b5c3..cbb83a4 100644 --- a/cov_docker_script/component_config.json +++ b/cov_docker_script/component_config.json @@ -40,7 +40,7 @@ { "name": "common-library", "repo": "https://github.com/rdkcentral/common-library.git", - "branch": "feature/native_build_for_coverity", + "branch": "develop", "header_paths": [ { "source": "source/ccsp/include", "destination": "$HOME/usr/include/rdkb" }, { "source": "source/ccsp/components/include", "destination": "$HOME/usr/include/rdkb" }, @@ -70,7 +70,7 @@ ], "build": { "type": "script", - "script": "cov_docker_script/common_external_build.sh" + "script": "build_tools_workflows/cov_docker_script/common_external_build.sh" } }, { diff --git a/cov_docker_script/configure_options.conf b/cov_docker_script/configure_options.conf index d75e3e4..909ed99 100644 --- a/cov_docker_script/configure_options.conf +++ b/cov_docker_script/configure_options.conf @@ -1,5 +1,5 @@ -# javascript-templates Configure Options -# This file contains autotools configure options for the component +# MoCA Agent Configure Options +# This file contains autotools configure options for the moca-agent component # Each section can be edited independently for better maintainability # ============================================================================ @@ -14,55 +14,10 @@ -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -# Core system defines --DSAFEC_DUMMY_API --D_COSA_HAL_ --U_COSA_SIM_ --DCONFIG_SYSTEM_MOCA - # ANSC framework defines -D_ANSC_USER -D_ANSC_LINUX -D_ANSC_LITTLE_ENDIAN_ --D_ANSC_USE_OPENSSL_ --D_ANSC_AES_USED_ --D_NO_ANSC_ZLIB_ --U_ANSC_IPV6_COMPATIBLE_ - -# CCSP/Component defines --D_CCSP_CWMP_TCP_CONNREQ_HANDLER --D_DSLH_STUN_ --D_NO_PKI_KB5_SUPPORT --D_BBHM_SSE_FILE_IO --DCCSP_SUPPORT_ENABLED - -# Product/Platform defines --D_COSA_INTEL_USG_ARM_ --D_COSA_FOR_COMCAST_ --D_COSA_BCM_ARM_ --D_XB6_PRODUCT_REQ_ --D_XB7_PRODUCT_REQ_ --D_XB8_PRODUCT_REQ_ - -# Vendor/Customer configuration --DCONFIG_VENDOR_CUSTOMER_COMCAST --DCONFIG_CISCO_HOTSPOT - -# Security and debugging --DENABLE_SA_KEY --D_NO_EXECINFO_H_ --D_DEBUG --DINCLUDE_BREAKPAD - -# System features --DFEATURE_SUPPORT_RDKLOG --DFEATURE_SUPPORT_SYSLOG --DBUILD_WEB --DUSE_NOTIFY_COMPONENT --DNTPD_ENABLE --DUTC_ENABLE --DUTC_ENABLE_ATOM --DXDNS_ENABLE # Core system defines -DDUK_USE_PROMISE_BUILTIN @@ -71,56 +26,14 @@ -DDUK_CMDLINE_LOGGING_SUPPORT -DDUK_CMDLINE_MODULE_SUPPORT -# Network features --DENABLE_ETH_WAN --DEROUTER_DHCP_OPTION_MTA --DETH_4_PORTS --D_2_5G_ETHERNET_SUPPORT_ --D_MACSEC_SUPPORT_ --D_BRIDGE_UTILS_BIN_ --DAUTOWAN_ENABLE --DENABLE_WANMODECHANGE_NOREBOOT --DFEATURE_RDKB_WAN_MANAGER --DFEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE --DWAN_MANAGER_UNIFICATION_ENABLED --DWAN_FAILOVER_SUPPORTED --DGATEWAY_FAILOVER_SUPPORTED - -# WiFi features --D_ENABLE_BAND_STEERING_ --D_BEACONRATE_SUPPORT --D_TRI_BAND_WIFI_ --D_WIFI_AX_SUPPORT_ --D_WIFI_CONSOLIDATED_STANDARDS_ --DWIFI_HAL_VERSION_3 --DFEATURE_SUPPORT_MESH --DFEATURE_SUPPORT_WEBCONFIG --DFEATURE_SUPPORT_INTERWORKING --DFEATURE_SUPPORT_PASSPOINT --DWIFI_STATS_DISABLE_SPEEDTEST_RUNNING --DFEATURE_SUPPORT_RADIUSGREYLIST --DFEATURE_SUPPORT_ACL_SELFHEAL --DFEATURE_CSI --DFEATURE_SUPPORT_ONBOARD_LOGGING --DFEATURE_OFF_CHANNEL_SCAN_5G --DRDK_ONEWIFI --DWIFI_MANAGE_SUPPORTED - -# Advanced features --D_PSM_TRANS_RDK_TRIGG_ --D_CM_HIGHSPLIT_SUPPORTED_ --DFEATURE_RDKB_INTER_DEVICE_MANAGER --DFEATURE_SUPPORT_MAPT_NAT46 --DMAPT_UNIFICATION_ENABLED --DSPEED_BOOST_SUPPORTED --DAMENITIES_NETWORK_ENABLED - -# Test/Development --DCOLUMBO_HWTEST - # Build system -DBUILD_RDK=ON --DRBUS_BUILD_FLAG_ENABLE + +# Security and debugging +-DENABLE_SA_KEY +-D_NO_EXECINFO_H_ +-D_DEBUG +-DINCLUDE_BREAKPAD # Standard defines -D_GNU_SOURCE From dab446a565b5e71e0c7dd82a02a11b0515d5500e Mon Sep 17 00:00:00 2001 From: Suganya-Sugumar <222150366+Suganya-Sugumar@users.noreply.github.com> Date: Thu, 19 Feb 2026 10:47:40 +0000 Subject: [PATCH 07/10] RDKB-63154 RDKB-63013 update to build_native for cmake conf --- build_tools_workflows | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_tools_workflows b/build_tools_workflows index b7c9625..3d000d7 160000 --- a/build_tools_workflows +++ b/build_tools_workflows @@ -1 +1 @@ -Subproject commit b7c962552e1b7e0467b1b766d263194e7b5e57bf +Subproject commit 3d000d7841ff6bf62e3dc9be0c6eb9b9c4875c9c From eeab16e8b8d3aef6e7e900fddb4c6fd76e1574ef Mon Sep 17 00:00:00 2001 From: Suganya-Sugumar <222150366+Suganya-Sugumar@users.noreply.github.com> Date: Thu, 19 Feb 2026 10:57:45 +0000 Subject: [PATCH 08/10] RDKB-63154 RDKB-63013 Native Build Integration conf update --- cov_docker_script/component_config.json | 4 ++-- cov_docker_script/configure_options.conf | 16 ---------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/cov_docker_script/component_config.json b/cov_docker_script/component_config.json index cbb83a4..c4d738f 100644 --- a/cov_docker_script/component_config.json +++ b/cov_docker_script/component_config.json @@ -89,11 +89,11 @@ "native_component": { "_comment": "Configuration for the main component being built", "name": "javascript-templates", - "include_path": "$HOME/usr/include/rdkb:/usr/include/dbus-1.0:/usr/lib/x86_64-linux-gnu/dbus-1.0/include", + "include_path": "$HOME/usr/include/rdkb", "lib_output_path": "$HOME/usr/local/lib", "build": { "type": "cmake", - "cmake_flags": "-DBUILD_RDK=ON -DCMAKE_C_FLAGS=\"-I$HOME/usr/include/rdkb -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -DBUILD_RBUS\" -DCMAKE_EXE_LINKER_FLAGS='-Wl,--allow-shlib-undefined -Wl,--unresolved-symbols=ignore-all' -DCMAKE_C_STANDARD_LIBRARIES=\"-L$HOME/usr/local/lib\"" + "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 index 909ed99..6001c93 100644 --- a/cov_docker_script/configure_options.conf +++ b/cov_docker_script/configure_options.conf @@ -6,9 +6,6 @@ # CPPFLAGS - Preprocessor flags (includes and defines) # ============================================================================ [CPPFLAGS] -# Autotools configuration --DHAVE_CONFIG_H - # Include paths -I$HOME/usr/include/rdkb/ -I/usr/include/dbus-1.0 @@ -19,22 +16,9 @@ -D_ANSC_LINUX -D_ANSC_LITTLE_ENDIAN_ -# Core system defines --DDUK_USE_PROMISE_BUILTIN --DDUK_CMDLINE_PRINTALERT_SUPPORT --DDUK_CMDLINE_CONSOLE_SUPPORT --DDUK_CMDLINE_LOGGING_SUPPORT --DDUK_CMDLINE_MODULE_SUPPORT - # Build system -DBUILD_RDK=ON -# Security and debugging --DENABLE_SA_KEY --D_NO_EXECINFO_H_ --D_DEBUG --DINCLUDE_BREAKPAD - # Standard defines -D_GNU_SOURCE -D__USE_XOPEN From c8e65cc9aef013ae37ee70ac632fdb92e9ed30f2 Mon Sep 17 00:00:00 2001 From: Suganya-Sugumar <222150366+Suganya-Sugumar@users.noreply.github.com> Date: Fri, 20 Feb 2026 03:15:48 +0000 Subject: [PATCH 09/10] RDKB-63154 RDKB-63013 Native Build Integration --- cov_docker_script/configure_options.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cov_docker_script/configure_options.conf b/cov_docker_script/configure_options.conf index 6001c93..7fafc41 100644 --- a/cov_docker_script/configure_options.conf +++ b/cov_docker_script/configure_options.conf @@ -1,5 +1,5 @@ -# MoCA Agent Configure Options -# This file contains autotools configure options for the moca-agent component +# Javascript-templates Configure Options +# This file contains autotools configure options for the javascript-templates component # Each section can be edited independently for better maintainability # ============================================================================ From 48f1d83b2f81798ebbd3ba6e703db372a8e11ba0 Mon Sep 17 00:00:00 2001 From: Suganya-Sugumar <222150366+Suganya-Sugumar@users.noreply.github.com> Date: Mon, 23 Feb 2026 07:17:46 +0000 Subject: [PATCH 10/10] RDKB-63154 RDKB-63013 Native Build Integration --- .github/workflows/native-build.yml | 33 ++ .gitignore | 1 - cov_docker_script/README.md | 488 +------------------- cov_docker_script/run_external_build.sh | 51 -- cov_docker_script/run_native_build.sh | 51 -- cov_docker_script/run_setup_dependencies.sh | 67 --- 6 files changed, 35 insertions(+), 656 deletions(-) create mode 100644 .github/workflows/native-build.yml delete mode 100644 .gitignore delete mode 100644 cov_docker_script/run_external_build.sh delete mode 100755 cov_docker_script/run_native_build.sh delete mode 100755 cov_docker_script/run_setup_dependencies.sh 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/.gitignore b/.gitignore deleted file mode 100644 index 567609b..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -build/ diff --git a/cov_docker_script/README.md b/cov_docker_script/README.md index e06d1a2..e4e293f 100644 --- a/cov_docker_script/README.md +++ b/cov_docker_script/README.md @@ -1,487 +1,3 @@ -# Component Native Build Configuration +# 🔧 Coverity Native Build System for RDK-B Components -**Coverity/Native build configuration for RDK-B components.** - ---- - -## 📋 Overview - -This directory contains the configuration and wrapper scripts necessary for building RDK-B components in a native (non-Yocto) environment. This setup enables Coverity static analysis and validates that components can be built with explicitly declared dependencies. - -### Directory Contents - -``` -/cov_docker_script/ -├── README.md # This file -├── component_config.json # Dependency & build configuration -├── configure_options.conf # Autotools configure flags (optional) -├── run_setup_dependencies.sh # Wrapper: Setup build tools & dependencies -├── run_native_build.sh # Wrapper: Build main component -└── run_external_build.sh # Wrapper: For dependency builds (used in component_config.json) -``` - -### Important: Add to .gitignore - -Add the following to your component's `.gitignore` to exclude temporary build artifacts: - -```gitignore -# Build tools (downloaded by wrapper scripts) -build_tools_workflows/ - -# Dependency build artifacts -build/ -``` - ---- - -## 🚀 Quick Start - -### Prerequisites - -- Docker container with [docker-rdk-ci](https://github.com/rdkcentral/docker-rdk-ci) image -- All wrapper scripts have execute permissions - -### Build Commands - -#### Complete Build Pipeline - -```bash -# From your component root directory -cd /path/to/your-component - -# Standard build pipeline for main component -./cov_docker_script/run_setup_dependencies.sh -./cov_docker_script/run_native_build.sh - -# Clean build (removes previous artifacts) -CLEAN_BUILD=true ./cov_docker_script/run_setup_dependencies.sh -./cov_docker_script/run_native_build.sh -``` - -#### Alternative: Single-Script Build (All-in-One) - -If you prefer to run everything in a single command: - -```bash -# Run setup dependencies + native build in one script -./cov_docker_script/run_external_build.sh - -# Clean build -CLEAN_BUILD=true ./cov_docker_script/run_external_build.sh -``` - -**Note:** `run_external_build.sh` performs both dependency setup and component build in one execution. While primarily designed to be invoked by the dependency setup process when specified in `component_config.json` (see [run_external_build.sh](#3-run_external_buildsh) section), it can also be used directly for the main component as a convenience script that handles the complete build pipeline. - -#### Individual Steps - -```bash -# Step 1: Setup dependencies only -./cov_docker_script/run_setup_dependencies.sh - -# Step 2: Build component only (requires Step 1 completed) -./cov_docker_script/run_native_build.sh -``` - ---- - -## 📖 Scripts Reference - -### 1. run_setup_dependencies.sh - -**Purpose:** Sets up build tools and runs dependency setup. - -**What it does:** -1. Clones `build_tools_workflows` repository (develop branch) -2. Verifies required scripts are present -3. Runs `setup_dependencies.sh` from build_tools_workflows with config path to: - - Clone all dependency repositories - - Copy headers to `$HOME/usr/include/rdkb/` - - Build and install dependency libraries -4. Leaves build_tools_workflows in place for run_native_build.sh - -**Usage:** -```bash -./run_setup_dependencies.sh - -# Clean build -CLEAN_BUILD=true ./run_setup_dependencies.sh -``` - -**Required files:** -- `component_config.json` (defines dependencies) - -**Outputs:** -- Downloads: `$HOME/build/` (dependency repositories) -- Headers: `$HOME/usr/include/rdkb/` -- Libraries: `$HOME/usr/local/lib/`, `$HOME/usr/lib/` -- build_tools_workflows: Remains in place for run_native_build.sh - -**Environment Variables:** -- `BUILD_DIR` - Override build directory (default: `$HOME/build`) -- `USR_DIR` - Override install directory (default: `$HOME/usr`) -- `CLEAN_BUILD` - Set to `true` to remove previous builds - ---- - -### 2. run_native_build.sh - -**Purpose:** Verifies build tools and builds the component. - -**What it does:** -1. Verifies `build_tools_workflows` directory exists (cloned by `run_setup_dependencies.sh`) -2. Verifies `build_native.sh` is present -3. Runs `build_native.sh` from build_tools_workflows with config and component paths to: - - Apply patches to source code - - Configure build environment - - Build component - - Install libraries -4. Cleans up build_tools_workflows directory - -**Usage:** -```bash -./run_native_build.sh -``` - -**Prerequisites:** -- `run_setup_dependencies.sh` must be run first (to clone build_tools_workflows) -- All dependency headers/libraries must be available - -**Required files:** -- `component_config.json` (defines component build settings) -- `configure_options.conf` (autotools configuration) - -**Outputs:** -- Component libraries in `$HOME/usr/local/lib/` -- Build artifacts in component root directory - ---- - -### 3. run_external_build.sh - -**Purpose:** Builds dependencies with complex build requirements (invoked from component_config.json). - -**Key Differences from run_native_build.sh:** -- Designed for **dependency repositories**, not the main component -- Invokes `common_external_build.sh` without arguments (dependencies manage their own configuration) -- Does **NOT** clean up `build_tools_workflows` (may be used by multiple dependencies) -- Typically called automatically during dependency setup, not manually - -**What it does:** -1. Clones `build_tools_workflows` if not present (or verifies it exists) -2. Verifies `common_external_build.sh` is present -3. Runs `common_external_build.sh` from build_tools_workflows -4. Preserves `build_tools_workflows` directory for subsequent use - -**Usage:** -```bash -./run_external_build.sh -``` - -**Prerequisites:** -- `run_setup_dependencies.sh` must be run first (to clone build_tools_workflows) -- All dependency headers/libraries must be available - -**Outputs:** -- Build artifacts based on common_external_build.sh implementation -- build_tools_workflows remains in place (not cleaned up) - -**Primary Use Case - Dependency Builds in component_config.json:** - -This script is primarily used to build **dependency repositories** that have complex build requirements. When a dependency has its own `cov_docker_script/run_external_build.sh`, it can be invoked from the parent component's `component_config.json`. - -**Example configuration in component_config.json:** - -```json -{ - "name": "Utopia", - "repo": "https://github.com/rdkcentral/utopia.git", - "branch": "feature/cov_native_build", - "header_paths": [ - { "source": "source/include", "destination": "$HOME/usr/include/rdkb" } - ], - "build": { - "type": "script", - "script": "cov_docker_script/run_external_build.sh" - } -} -``` - -**How it works for dependencies:** -1. The parent component's `setup_dependencies.sh` clones the dependency repository (e.g., Utopia) -2. The dependency's `run_external_build.sh` is executed from the dependency's directory -3. This script internally: - - Sets up the dependency's own build tools and dependencies - - Runs the dependency's native build process - - Produces shared libraries (`.so` files) -4. The generated shared libraries are installed to `$HOME/usr/local/lib/` or `$HOME/usr/lib/` -5. These libraries are then available for the parent component's native build - -**When to use this approach:** -- Dependency has complex multi-step build requirements -- Dependency has its own sub-dependencies that need to be built -- Dependency requires custom build logic beyond standard autotools/cmake/meson -- Dependency repository already has a `cov_docker_script/run_external_build.sh` script - -**Note:** This approach allows dependencies to manage their own complete build pipeline, producing the necessary shared libraries that the parent component links against during its native compilation. - ---- - -## 📝 Configuration Files - -### component_config.json - -**JSON configuration defining all dependencies and build settings.** - -**Key Sections:** - -1. **dependencies.repos[]** - External dependencies required by your component - ```json - { - "name": "rbus", - "repo": "https://github.com/rdkcentral/rbus.git", - "branch": "v2.7.0", - "header_paths": [...], - "build": {...} - } - ``` - -2. **native_component** - Component build configuration - ```json - { - "name": "your-component", - "build": { - "type": "autotools", - "configure_options_file": "cov_docker_script/configure_options.conf" - } - } - ``` - -**Example Dependencies:** -Your component may require dependencies such as: -- rbus -- rdk_logger -- safec -- common-library -- halinterface -- And other component-specific dependencies - -See [component_config.json](component_config.json) for your component's specific dependency configuration. - ---- - -### configure_options.conf - -**Autotools configuration file with preprocessor, compiler, and linker flags.** - -**Format:** -```properties -[CPPFLAGS] --I$HOME/usr/include/rdkb/ --DFEATURE_FLAG - -[CFLAGS] --Wall -Wextra - -[LDFLAGS] --L$HOME/usr/local/lib/ -``` - -**Sections:** -- `[CPPFLAGS]` - Preprocessor flags (includes `-I`, defines `-D`) -- `[CFLAGS]` - C compiler flags -- `[CXXFLAGS]` - C++ compiler flags -- `[LDFLAGS]` - Linker flags (library paths `-L`, linker options `-Wl`) - -**Component-Specific Flags:** -Customize flags based on your component's requirements: -- Platform defines: `_COSA_INTEL_USG_ARM_`, `_COSA_BCM_ARM_`, etc. -- Product defines: `_XB6_PRODUCT_REQ_`, `_XB7_PRODUCT_REQ_`, etc. -- Feature flags: `FEATURE_SUPPORT_RDKLOG`, component-specific features, etc. - -See [configure_options.conf](configure_options.conf) for your component's complete flag list. - ---- - -## 🔧 Build System Architecture - -``` -┌─────────────────────────────────────────────────────┐ -│ run_setup_dependencies.sh │ -│ ┌──────────────────────────────────────────────┐ │ -│ │ 1. Clone build_tools_workflows │ │ -│ │ (develop branch) │ │ -│ │ │ │ -│ │ 2. Verify required scripts present │ │ -│ │ │ │ -│ │ 3. Run setup_dependencies.sh from │ │ -│ │ build_tools_workflows with config path │ │ -│ │ - Read component_config.json │ │ -│ │ - Clone dependency repos │ │ -│ │ - Copy headers │ │ -│ │ - Build & install libraries │ │ -│ └──────────────────────────────────────────────┘ │ -└─────────────────────────────────────────────────────┘ - │ - ▼ -┌─────────────────────────────────────────────────────┐ -│ run_native_build.sh │ -│ ┌──────────────────────────────────────────────┐ │ -│ │ 1. Verify build_tools_workflows exists │ │ -│ │ (cloned by run_setup_dependencies.sh) │ │ -│ │ │ │ -│ │ 2. Run build_native.sh from │ │ -│ │ build_tools_workflows with config and │ │ -│ │ component directory paths │ │ -│ │ - Process component headers │ │ -│ │ - Apply source patches (if configured) │ │ -│ │ - Read configure_options.conf │ │ -│ │ - Configure build (autogen/configure) │ │ -│ │ - Build component (make/cmake/meson) │ │ -│ │ - Install libraries │ │ -│ │ │ │ -│ │ 3. Cleanup build_tools_workflows directory │ │ -│ └──────────────────────────────────────────────┘ │ -└─────────────────────────────────────────────────────┘ -``` - ---- - -## 🐛 Troubleshooting - -### Build Failures - -**Problem:** Missing headers - -```bash -# Solution: Check if dependencies were installed -ls -la $HOME/usr/include/rdkb/ - -# Verify component_config.json has correct header_paths -cat component_config.json | jq '.dependencies.repos[].header_paths' - -# Re-run dependency setup -CLEAN_BUILD=true ./cov_docker_script/run_setup_dependencies.sh -``` - -**Problem:** Missing libraries - -```bash -# Solution: Check library installation -ls -la $HOME/usr/local/lib/ -ls -la $HOME/usr/lib/ - -# Verify PKG_CONFIG_PATH -echo $PKG_CONFIG_PATH - -# Check if dependency build failed -cd $HOME/build/ -cat config.log # For autotools -cat build/meson-log.txt # For meson -``` - -**Problem:** Configure errors - -```bash -# Solution: Check configure_options.conf syntax -cat cov_docker_script/configure_options.conf - -# Verify flags are valid -./configure --help -``` - -### Script Errors - -**Problem:** Script not found - -```bash -# Solution: Ensure scripts are executable -chmod +x cov_docker_script/*.sh - -# Check if build_tools_workflows was cloned -ls -la ../build_tools_workflows/ -``` - -**Problem:** Permission denied - -```bash -# Solution: Fix container permissions -# (Run on host, not in container) -sudo docker exec rdkb-builder groupadd $USER --gid=$(id -g $USER) -sudo docker exec rdkb-builder useradd -m $USER -G users \ - --uid=$(id -u $USER) --gid=$(id -g $USER) -``` - ---- - -## 📚 Related Documentation - -- **Build Tools Repository:** [build_tools_workflows](https://github.com/rdkcentral/build_tools_workflows/tree/develop) -- **Docker Environment:** [docker-rdk-ci](https://github.com/rdkcentral/docker-rdk-ci) -- **Example Component:** [moca-agent](https://github.com/rdkcentral/moca-agent) (reference implementation) -- **Detailed Build Guide:** See `build_tools_workflows/cov_docker_script/README.md` - ---- - -## ⚠️ Important Notes - -### DO NOT Modify - -The following scripts are automatically copied from `build_tools_workflows` and **must not be modified locally**: - -- ❌ `build_native.sh` -- ❌ `common_build_utils.sh` -- ❌ `common_external_build.sh` -- ❌ `setup_dependencies.sh` - -Any changes will be overwritten when wrapper scripts run. - -### DO Modify - -The following files are component-specific and **should be customized**: - -- ✅ `component_config.json` - Dependency and build configuration -- ✅ `configure_options.conf` - Autotools flags -- ✅ `run_setup_dependencies.sh` - Wrapper script (if needed) -- ✅ `run_native_build.sh` - Wrapper script (if needed) - ---- - -## 🔄 Workflow Integration - -### Local Development - -```bash -# Make changes to source code -vim source/your_component.c - -# Rebuild component -CLEAN_BUILD=true ./cov_docker_script/run_native_build.sh -``` - -### CI/CD Integration - -This configuration is used by GitHub Actions to validate builds: - -```yaml -- name: Setup Dependencies - run: ./cov_docker_script/run_setup_dependencies.sh - -- name: Build Component - run: ./cov_docker_script/run_native_build.sh -``` - -See `.github/workflows/` for complete CI configuration. - ---- - -## 📞 Support - -For issues or questions: - -1. Check [Troubleshooting](#troubleshooting) section -2. Review [build_tools_workflows README](https://github.com/rdkcentral/build_tools_workflows/blob/develop/cov_docker_script/README.md) -3. Raise issue in your component repository or [build_tools_workflows](https://github.com/rdkcentral/build_tools_workflows/issues) - ---- - -**Last Updated:** January 2026 +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/run_external_build.sh b/cov_docker_script/run_external_build.sh deleted file mode 100644 index d6e9a21..0000000 --- a/cov_docker_script/run_external_build.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env bash -set -e - -################################################################################ -# External Build Wrapper Script -# Verifies build tools and runs common_external_build.sh -# Usage: ./run_external_build.sh -# Note: run_setup_dependencies.sh should be executed first -################################################################################ - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -NATIVE_COMPONENT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" -BUILD_TOOLS_REPO_URL="https://github.com/rdkcentral/build_tools_workflows" -BUILD_TOOLS_DIR="$NATIVE_COMPONENT_DIR/build_tools_workflows" - -# Basic logging functions -log() { echo "[INFO] $*"; } -ok() { echo "[OK] $*"; } -err() { echo "[ERROR] $*" >&2; } - -echo "" -echo "===== External Build Pipeline =====" -echo "" - -# Clone build_tools_workflows if it doesn't exist -if [[ ! -d "$BUILD_TOOLS_DIR" ]]; then - log "build_tools_workflows not found, cloning repository..." - cd "$NATIVE_COMPONENT_DIR" - git clone -b develop "$BUILD_TOOLS_REPO_URL" || { err "Clone failed"; exit 1; } - ok "Repository cloned successfully" -else - log "build_tools_workflows already exists" -fi - -if [[ ! -f "$BUILD_TOOLS_DIR/cov_docker_script/common_external_build.sh" ]]; then - err "common_external_build.sh not found in build_tools_workflows. Please run run_setup_dependencies.sh first." - exit 1 -fi - -log "Build script found, proceeding with build..." - -# Run common_external_build.sh from build_tools_workflows -echo "" -log "Running common_external_build.sh from build_tools_workflows..." -cd "$NATIVE_COMPONENT_DIR" -"$BUILD_TOOLS_DIR/cov_docker_script/common_external_build.sh" "$SCRIPT_DIR/component_config.json" "$NATIVE_COMPONENT_DIR" - -echo "" -ok "External build completed successfully!" - -echo "" diff --git a/cov_docker_script/run_native_build.sh b/cov_docker_script/run_native_build.sh deleted file mode 100755 index 9d3aea3..0000000 --- a/cov_docker_script/run_native_build.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env bash -set -e - -################################################################################ -# Native Build Wrapper Script -# Verifies build tools and runs build_native.sh -# Usage: ./run_native_build.sh -# Note: run_setup_dependencies.sh should be executed first -################################################################################ - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -NATIVE_COMPONENT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" -BUILD_TOOLS_DIR="$NATIVE_COMPONENT_DIR/build_tools_workflows" - -# Basic logging functions -log() { echo "[INFO] $*"; } -ok() { echo "[OK] $*"; } -err() { echo "[ERROR] $*" >&2; } - -echo "" -echo "===== Native Build Pipeline =====" -echo "" - -# Verify build_tools_workflows exists (should be cloned by run_setup_dependencies.sh) -if [[ ! -d "$BUILD_TOOLS_DIR" ]]; then - err "build_tools_workflows directory not found. Please run run_setup_dependencies.sh first." - exit 1 -fi - -if [[ ! -f "$BUILD_TOOLS_DIR/cov_docker_script/build_native.sh" ]]; then - err "build_native.sh not found in build_tools_workflows. Please run run_setup_dependencies.sh first." - exit 1 -fi - -log "Build script found, proceeding with build..." - -# Run build_native.sh from build_tools_workflows -echo "" -log "Running build_native.sh from build_tools_workflows..." -cd "$NATIVE_COMPONENT_DIR" -"$BUILD_TOOLS_DIR/cov_docker_script/build_native.sh" "$SCRIPT_DIR/component_config.json" "$NATIVE_COMPONENT_DIR" - -echo "" -ok "Native build completed successfully!" - -# Cleanup build_tools_workflows directory -log "Cleaning up build_tools_workflows directory..." -rm -rf "$BUILD_TOOLS_DIR" -ok "Cleanup completed" - -echo "" diff --git a/cov_docker_script/run_setup_dependencies.sh b/cov_docker_script/run_setup_dependencies.sh deleted file mode 100755 index 5223c84..0000000 --- a/cov_docker_script/run_setup_dependencies.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env bash -set -e - -################################################################################ -# Setup Dependencies Wrapper Script -# Sets up build tools and runs setup_dependencies.sh -# Usage: ./run_setup_dependencies.sh -################################################################################ - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -NATIVE_COMPONENT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" -BUILD_TOOLS_REPO_URL="https://github.com/rdkcentral/build_tools_workflows" -BUILD_TOOLS_DIR="$NATIVE_COMPONENT_DIR/build_tools_workflows" -REQUIRED_SCRIPTS=("build_native.sh" "common_build_utils.sh" "common_external_build.sh" "setup_dependencies.sh") - -# Basic logging functions -log() { echo "[INFO] $*"; } -ok() { echo "[OK] $*"; } -err() { echo "[ERROR] $*" >&2; } - -echo "" -echo "===== Setup Dependencies Pipeline =====" -echo "" - -# Setup build tools -log "Setting up build tools..." - -# Clone build_tools_workflows -if [[ -d "$BUILD_TOOLS_DIR" ]]; then - log "build_tools_workflows already exists, skipping clone" -else - log "Cloning build_tools_workflows (develop)" - cd "$NATIVE_COMPONENT_DIR" - git clone -b develop "$BUILD_TOOLS_REPO_URL" || { err "Clone failed"; exit 1; } - ok "Repository cloned" -fi - -# Verify required scripts -[[ ! -d "$BUILD_TOOLS_DIR/cov_docker_script" ]] && { err "cov_docker_script not found"; exit 1; } - -log "Verifying required scripts..." -MISSING=() -for script in "${REQUIRED_SCRIPTS[@]}"; do - [[ -f "$BUILD_TOOLS_DIR/cov_docker_script/$script" ]] || MISSING+=("$script") -done - -if [[ ${#MISSING[@]} -gt 0 ]]; then - err "Missing scripts: ${MISSING[*]}" - exit 1 -fi -ok "All required scripts found" - -# Verify setup_dependencies.sh exists before running -if [[ ! -f "$BUILD_TOOLS_DIR/cov_docker_script/setup_dependencies.sh" ]]; then - err "setup_dependencies.sh not found in build_tools_workflows" - exit 1 -fi - -# Run setup_dependencies.sh from build_tools_workflows -echo "" -log "Running setup_dependencies.sh from build_tools_workflows..." -cd "$NATIVE_COMPONENT_DIR" -"$BUILD_TOOLS_DIR/cov_docker_script/setup_dependencies.sh" "$SCRIPT_DIR/component_config.json" - -echo "" -echo "[OK] Dependencies setup completed successfully!" -echo ""