From c585582f9467a81dc188fea646396469fc007c04 Mon Sep 17 00:00:00 2001 From: Mohammed Idris Abdul Shukkur Date: Tue, 24 Feb 2026 08:12:39 +0000 Subject: [PATCH] Enable Coverity DM CLI --- .github/workflows/native-build.yml | 34 ++++ .gitmodules | 4 + build_tools_workflows | 1 + cov_docker_script/README.md | 5 + cov_docker_script/component_config.json | 94 +++++++++++ cov_docker_script/configure_options.conf | 197 +++++++++++++++++++++++ 6 files changed, 335 insertions(+) create mode 100644 .github/workflows/native-build.yml create mode 100644 .gitmodules create mode 160000 build_tools_workflows create mode 100644 cov_docker_script/README.md create mode 100755 cov_docker_script/component_config.json create mode 100755 cov_docker_script/configure_options.conf diff --git a/.github/workflows/native-build.yml b/.github/workflows/native-build.yml new file mode 100644 index 0000000..9a0e294 --- /dev/null +++ b/.github/workflows/native-build.yml @@ -0,0 +1,34 @@ +name: Build data-model-cli Component in Native Environment + +on: + push: + branches: [ main, 'sprint/**', 'release/**', develop ] + pull_request: + branches: [ main, 'sprint/**', 'release/**', topic/RDK*, develop ] + +jobs: + build-data-model-cli-on-pr: + name: Build data-model-cli 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..6e93efc --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "build_tools_workflows"] + path = build_tools_workflows + url = https://github.com/rdkcentral/build_tools_workflows.git + 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/README.md b/cov_docker_script/README.md new file mode 100644 index 0000000..522cf7a --- /dev/null +++ b/cov_docker_script/README.md @@ -0,0 +1,5 @@ +# 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) + diff --git a/cov_docker_script/component_config.json b/cov_docker_script/component_config.json new file mode 100755 index 0000000..61c21fd --- /dev/null +++ b/cov_docker_script/component_config.json @@ -0,0 +1,94 @@ +{ + "_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": "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" } + ], + "build": { + "type": "script", + "script": "build_tools_workflows/cov_docker_script/common_external_build.sh" + } + }, + { + "name": "Utopia", + "repo": "https://github.com/rdkcentral/utopia.git", + "branch": "develop", + "header_paths": [ + { "source": "source/include/sysevent", "destination": "$HOME/usr/include/rdkb/sysevent" }, + { "source": "source/include/syscfg", "destination": "$HOME/usr/include/rdkb/syscfg" }, + { "source": "source/include", "destination": "$HOME/usr/include/rdkb/utctx" }, + { "source": "source/include", "destination": "$HOME/usr/include/rdkb" }, + { "source": "source/utapi/lib", "destination": "$HOME/usr/include/rdkb/utapi" }, + { "source": "source/include/ulog", "destination": "$HOME/usr/include/rdkb/ulog" }, + { "source": "source/util/utils", "destination": "$HOME/usr/include/rdkb" }, + { "source": "source/sysevent/lib", "destination": "$HOME/usr/include/rdkb/sysevent" }, + { "source": "source/util/print_uptime", "destination": "$HOME/usr/include/rdkb" } + ], + "build": { + "type": "script", + "script": "build_tools_workflows/cov_docker_script/common_external_build.sh" + } + }, + { + "name": "rdk_logger", + "repo": "https://github.com/rdkcentral/rdk_logger.git", + "branch": "develop", + "header_paths": [ + { "source": "include", "destination": "$HOME/usr/include/rdkb" } + ], + "build": { + "type": "autotools" + } + }, + { + "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\"" + } + } + ] + }, + + "native_component": { + "_comment": "Configuration for the main component being built", + "name": "dm-cli", + "include_path": "$HOME/usr/include/rdkb/", + "lib_output_path": "$HOME/usr/local/lib/", + "pre_build_commands": [ + { + "description": "Generate dm_pack_datamodel.c from XML", + "command": "python3 $HOME/usr/include/rdkb/dm_pack_code_gen.py source/MsgBusTestServer/config/MsgBusTest.XML source/MsgBusTestServer/dm_pack_datamodel.c" + } + ], + "build": { + "type": "autotools", + "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 100755 index 0000000..12dad06 --- /dev/null +++ b/cov_docker_script/configure_options.conf @@ -0,0 +1,197 @@ +# Utopia Configure Options +# This file contains autotools configure options for the utopia component +# Each section can be edited independently for better maintainability + +# ============================================================================ +# NOTE: Pre-build setup commands are defined in component_config.json +# ============================================================================ +# The following setup is performed automatically before build (see component_config.json): +# - Creates libthreadutil.so linker script (redirects to libupnp) +# - Creates placeholder dbus-1.0/include directory (workaround for Makefile.am syntax issue) + +# ============================================================================ +# CPPFLAGS - Preprocessor flags (includes and defines) +# ============================================================================ +[CPPFLAGS] +# Autotools configuration +-DHAVE_CONFIG_H + +# Include paths +-I$HOME/usr/include/rdkb/ +-I/usr/include/tirpc +-I/usr/include/dbus-1.0 +-I/usr/lib/x86_64-linux-gnu/dbus-1.0/include + +# Standard defines +-DSC_POSIX_SEM +-DSET_REPLY_REQUIRED +-DIPV6=1 + +# Core system defines +-DSAFEC_DUMMY_API +-DUSE_SYSCFG +-DSE_SERVER_CODE_DEBUG +-DREDIRECT_CODE_DEBUG +-DMTA_TR104SUPPORT +-D_COSA_HAL_ +-U_COSA_SIM_ +-DCONFIG_SYSTEM_MOCA + +# ANSC framework defines +-D_ANSC_LINUX +-D_ANSC_USER +-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 + +# MoCA specific +-DMOCA_HOME_ISOLATION +-DMOCA_DIAGONISTIC + +# 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 +-DFEATURE_COGNITIVE_WIFIMOTION + +# Matter support +-DFEATURE_MATTER_ENABLED +-DFEATURE_TAD_HEALTH_CHECK + +# 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 +-DSPEED_BOOST_SUPPORTED_V6 +-DAMENITIES_NETWORK_ENABLED +-DCONFIG_BUILD_TRIGGER +-DENABLE_FEATURE_MESHWIFI +-DCORE_NET_LIB + +# Test/Development +-DCOLUMBO_HWTEST + +# Build system +-DRBUS_BUILD_FLAG_ENABLE + +# ============================================================================ +# CFLAGS - Compiler flags +# ============================================================================ +[CFLAGS] + +# Code generation flags +-fno-exceptions +-ffunction-sections +-fdata-sections +-fomit-frame-pointer +-fno-strict-aliasing + +# Warning flags +-Wall +-Werror +-Wextra +-Wno-pointer-sign +-Wno-sign-compare +-Wno-deprecated-declarations +-Wno-type-limits +-Wno-unused-parameter +-Wno-return-local-addr +-Wno-format-overflow +-Wno-misleading-indentation +-Wno-enum-conversion +-Wno-maybe-uninitialized + +# ============================================================================ +# LDFLAGS - Linker flags +# ============================================================================ +[LDFLAGS] +# Library paths +-L$HOME/usr/local/lib +-L$HOME/usr/local/lib/x86_64-linux-gnu +-L/usr/lib/x86_64-linux-gnu +-Wl,-rpath,$HOME/usr/local/lib/x86_64-linux-gnu +-Wl,--allow-shlib-undefined +-Wl,--unresolved-symbols=ignore-all +-Wl,--no-as-needed + +# ============================================================================ +# LIBS - Libraries to link +# ============================================================================ +[LIBS] +# External libraries +-lrbus +-lsecure_wrapper +-ltirpc +-lupnp +-lrdkloggers +-ldbus-1