Skip to content

Commit 12055db

Browse files
RDKB-63009 RDKB-63010: Native build for Coverity (#9)
Reason for change: Enable coverity scan using native build. Test Procedure: All the checks should pass in github Risks: Low Priority: P1 Signed-off-by: [sowmiya_chelliah@comcast.com](mailto:sowmiya_chelliah@comcast.com)
1 parent f673a22 commit 12055db

6 files changed

Lines changed: 301 additions & 0 deletions

File tree

.github/workflows/native-build.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build XDNS Component in Native Environment
2+
3+
on:
4+
push:
5+
branches: [ main, 'sprint/**', 'release/**', develop ]
6+
pull_request:
7+
branches: [ main, 'sprint/**', 'release/**', topic/RDK*, develop ]
8+
9+
jobs:
10+
build-xdns-on-pr:
11+
name: Build XDNS component in github rdkcentral
12+
runs-on: ubuntu-latest
13+
container:
14+
image: ghcr.io/rdkcentral/docker-rdk-ci:latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
20+
- name: native build
21+
run: |
22+
# Trust the workspace
23+
git config --global --add safe.directory '*'
24+
25+
# Pull the latest changes for the native build system
26+
git submodule update --init --recursive --remote
27+
28+
# Build and install dependencies
29+
chmod +x build_tools_workflows/cov_docker_script/setup_dependencies.sh
30+
./build_tools_workflows/cov_docker_script/setup_dependencies.sh ./cov_docker_script/component_config.json
31+
32+
# Build component
33+
chmod +x build_tools_workflows/cov_docker_script/build_native.sh
34+
./build_tools_workflows/cov_docker_script/build_native.sh ./cov_docker_script/component_config.json "$(pwd)"
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.RDKCM_RDKE }}

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[submodule "build_tools_workflows"]
2+
path = build_tools_workflows
3+
url = https://github.com/rdkcentral/build_tools_workflows
4+
branch = develop

build_tools_workflows

Submodule build_tools_workflows added at b7c9625

cov_docker_script/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 🔧 Coverity Native Build System for RDK-B Components
2+
3+
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)
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
{
2+
"_comment": "Component Build Configuration for Coverity/Native Builds",
3+
"_version": "2.0",
4+
"_description": "Defines dependencies and build settings for the native component",
5+
6+
"dependencies": {
7+
"_comment": "External repositories needed by this component",
8+
"repos": [
9+
{
10+
"name": "rbus",
11+
"repo": "https://github.com/rdkcentral/rbus.git",
12+
"branch": "v2.7.0",
13+
"header_paths": [
14+
{ "source": "include", "destination": "$HOME/usr/include/rdkb" }
15+
],
16+
"build": {
17+
"type": "cmake",
18+
"build_dir": "build",
19+
"cmake_flags": "-DCMAKE_INSTALL_PREFIX=$HOME/usr -DCMAKE_PREFIX_PATH=/usr -DBUILD_FOR_DESKTOP=ON -DCMAKE_BUILD_TYPE=Debug"
20+
}
21+
},
22+
{
23+
"name": "common-library",
24+
"repo": "https://github.com/rdkcentral/common-library.git",
25+
"branch": "develop",
26+
"header_paths": [
27+
{ "source": "source/cosa/include", "destination": "$HOME/usr/include/rdkb" },
28+
{ "source": "source/cosa/include/linux", "destination": "$HOME/usr/include/rdkb/linux" },
29+
{ "source": "source/ccsp/custom", "destination": "$HOME/usr/include/rdkb" },
30+
{ "source": "source/ccsp/include", "destination": "$HOME/usr/include/rdkb" },
31+
{ "source": "source/debug_api/include", "destination": "$HOME/usr/include/rdkb" },
32+
{ "source": "source/util_api/http/include", "destination": "$HOME/usr/include/rdkb" },
33+
{ "source": "source/ccsp/components/include", "destination": "$HOME/usr/include/rdkb" },
34+
{ "source": "source/util_api/ansc/include", "destination": "$HOME/usr/include/rdkb" },
35+
{ "source": "source/cosa/package/slap/include", "destination": "$HOME/usr/include/rdkb" },
36+
{ "source": "source/ccsp/components/common/MessageBusHelper/include", "destination": "$HOME/usr/include/rdkb" },
37+
{ "source": "source/dm_pack", "destination": "$HOME/usr/include/rdkb" }
38+
],
39+
"build": {
40+
"type": "script",
41+
"script": "build_tools_workflows/cov_docker_script/common_external_build.sh"
42+
}
43+
},
44+
{
45+
"name": "WebconfigFramework",
46+
"repo": "https://github.com/rdkcentral/WebconfigFramework.git",
47+
"branch": "develop",
48+
"header_paths": [
49+
{ "source": "include", "destination": "$HOME/usr/include/rdkb" }
50+
],
51+
"build": {
52+
"type": "autotools",
53+
"configure_flags": "CPPFLAGS=\"-I$HOME/usr/include/rdkb -I$HOME/usr/include/rdkb/rbus -I$HOME/usr/local/include -I$HOME/usr/include/rdkb/rtmessage\" LDFLAGS=\"-L$HOME/usr/local/lib -L$HOME/usr/lib\" LIBS=\"-lrbus -lrtMessage\""
54+
}
55+
},
56+
{
57+
"name": "libSyscallWrapper",
58+
"repo": "https://github.com/rdkcentral/libSyscallWrapper.git",
59+
"branch": "develop",
60+
"header_paths": [
61+
{ "source": "source", "destination": "$HOME/usr/include/rdkb" }
62+
],
63+
"build": {
64+
"type": "autotools",
65+
"configure_flags": "CPPFLAGS=\"-I$HOME/usr/include/rdkb\" LDFLAGS=\"-L$HOME/usr/local/lib\""
66+
}
67+
},
68+
{
69+
"name": "rdk-libunpriv",
70+
"repo": "https://github.com/rdkcentral/rdk-libunpriv.git",
71+
"branch": "develop",
72+
"header_paths": [
73+
{ "source": "source", "destination": "$HOME/usr/include/rdkb" }
74+
]
75+
},
76+
{
77+
"name": "Utopia",
78+
"repo": "https://github.com/rdkcentral/utopia.git",
79+
"branch": "develop",
80+
"header_paths": [
81+
{ "source": "include", "destination": "$HOME/usr/include/rdkb/utopia" },
82+
{ "source": "source/include/utctx", "destination": "$HOME/usr/include/rdkb/utctx" }
83+
],
84+
"build": {
85+
"type": "script",
86+
"script": "build_tools_workflows/cov_docker_script/common_external_build.sh"
87+
}
88+
}
89+
]
90+
},
91+
92+
"native_component": {
93+
"_comment": "Configuration for the main component being built",
94+
"name": "xdns",
95+
"include_path": "$HOME/usr/include/rdkb/",
96+
"lib_output_path": "$HOME/usr/local/lib/",
97+
"pre_build_commands": [
98+
{
99+
"description": "Generate dm_pack_datamodel.c from XML",
100+
"command": "python3 $HOME/usr/include/rdkb/dm_pack_code_gen.py config/CcspXdns_dm.xml source/XdnsSsp/dm_pack_datamodel.c"
101+
}
102+
],
103+
"build": {
104+
"type": "autotools",
105+
"configure_options_file": "cov_docker_script/configure_options.conf"
106+
}
107+
}
108+
}
109+
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
# XDNS Configure Options
2+
# This file contains autotools configure options for the xdns component
3+
4+
# ============================================================================
5+
# CPPFLAGS - Preprocessor flags (includes and defines)
6+
# ============================================================================
7+
[CPPFLAGS]
8+
9+
# Autotools configuration
10+
-DHAVE_CONFIG_H
11+
12+
# Include paths
13+
-I$HOME/usr/include/rdkb/
14+
-I/usr/include/dbus-1.0
15+
-I/usr/lib/x86_64-linux-gnu/dbus-1.0/include
16+
17+
# Core system / HAL
18+
-D_COSA_HAL_
19+
-U_COSA_SIM_
20+
-D_COSA_BCM_ARM_
21+
-D_COSA_INTEL_USG_ARM_
22+
-D_COSA_FOR_COMCAST_
23+
24+
# ANSC framework defines
25+
-D_ANSC_LINUX
26+
-D_ANSC_USER
27+
-D_ANSC_LITTLE_ENDIAN_
28+
-D_ANSC_USE_OPENSSL_
29+
-D_ANSC_AES_USED_
30+
-D_NO_ANSC_ZLIB_
31+
-U_ANSC_IPV6_COMPATIBLE_
32+
33+
# CCSP/Component defines
34+
-D_CCSP_CWMP_TCP_CONNREQ_HANDLER
35+
-D_DSLH_STUN_
36+
-D_NO_PKI_KB5_SUPPORT
37+
-D_BBHM_SSE_FILE_IO
38+
-DCCSP_SUPPORT_ENABLED
39+
40+
# Product/Platform defines
41+
-D_XB6_PRODUCT_REQ_
42+
-D_XB7_PRODUCT_REQ_
43+
-D_XB8_PRODUCT_REQ_
44+
-DETH_4_PORTS
45+
-D_2_5G_ETHERNET_SUPPORT_
46+
-D_MACSEC_SUPPORT_
47+
48+
# Security / debugging
49+
-DENABLE_SA_KEY
50+
-D_NO_EXECINFO_H_
51+
-D_DEBUG
52+
-DINCLUDE_BREAKPAD
53+
54+
# System features
55+
-DFEATURE_SUPPORT_RDKLOG
56+
-DFEATURE_SUPPORT_SYSLOG
57+
-DBUILD_WEB
58+
-DUSE_NOTIFY_COMPONENT
59+
-DNTPD_ENABLE
60+
-DUTC_ENABLE
61+
-DUTC_ENABLE_ATOM
62+
-DXDNS_ENABLE
63+
-DRBUS_BUILD_FLAG_ENABLE
64+
65+
# MoCA-related
66+
-DCONFIG_SYSTEM_MOCA
67+
-DMOCA_DIAGONISTIC
68+
-DMOCA_HOME_ISOLATION
69+
70+
# Network features
71+
-DENABLE_ETH_WAN
72+
-DEROUTER_DHCP_OPTION_MTA
73+
-D_BRIDGE_UTILS_BIN_
74+
-DAUTOWAN_ENABLE
75+
-DENABLE_WANMODECHANGE_NOREBOOT
76+
-DFEATURE_RDKB_WAN_MANAGER
77+
-DFEATURE_RDKB_CONFIGURABLE_WAN_INTERFACE
78+
-DWAN_MANAGER_UNIFICATION_ENABLED
79+
-DWAN_FAILOVER_SUPPORTED
80+
-DGATEWAY_FAILOVER_SUPPORTED
81+
-DFEATURE_RDKB_DHCP_MANAGER
82+
83+
# WiFi features
84+
-D_ENABLE_BAND_STEERING_
85+
-D_BEACONRATE_SUPPORT
86+
-D_TRI_BAND_WIFI_
87+
-D_WIFI_AX_SUPPORT_
88+
-D_WIFI_CONSOLIDATED_STANDARDS_
89+
-DWIFI_HAL_VERSION_3
90+
-DFEATURE_SUPPORT_MESH
91+
-DFEATURE_SUPPORT_WEBCONFIG
92+
-DFEATURE_SUPPORT_INTERWORKING
93+
-DFEATURE_SUPPORT_PASSPOINT
94+
-DWIFI_STATS_DISABLE_SPEEDTEST_RUNNING
95+
-DFEATURE_SUPPORT_RADIUSGREYLIST
96+
-DFEATURE_SUPPORT_ACL_SELFHEAL
97+
-DFEATURE_CSI
98+
-DFEATURE_SUPPORT_ONBOARD_LOGGING
99+
-DFEATURE_OFF_CHANNEL_SCAN_5G
100+
-DRDK_ONEWIFI
101+
-DWIFI_MANAGE_SUPPORTED
102+
103+
# Advanced features
104+
-D_PSM_TRANS_RDK_TRIGG_
105+
-D_CM_HIGHSPLIT_SUPPORTED_
106+
-DFEATURE_RDKB_INTER_DEVICE_MANAGER
107+
-DFEATURE_SUPPORT_MAPT_NAT46
108+
-DMAPT_UNIFICATION_ENABLED
109+
-DSPEED_BOOST_SUPPORTED
110+
-DAMENITIES_NETWORK_ENABLED
111+
-DCORE_NET_LIB
112+
113+
# Test/Development
114+
-DCOLUMBO_HWTEST
115+
116+
117+
# ============================================================================
118+
# CFLAGS - Compiler flags
119+
# ============================================================================
120+
[CFLAGS]
121+
122+
# Optimization
123+
-Os
124+
-pipe
125+
-g
126+
-feliminate-unused-debug-types
127+
128+
# Warnings
129+
-Wall
130+
-Werror
131+
-Wextra
132+
133+
# Code generation
134+
-fno-exceptions
135+
-ffunction-sections
136+
-fdata-sections
137+
-fomit-frame-pointer
138+
-fno-strict-aliasing
139+
140+
141+
# ============================================================================
142+
# LDFLAGS - Linker flags
143+
# ============================================================================
144+
[LDFLAGS]
145+
146+
-L$HOME/usr/local/lib/
147+
-Wl,--allow-shlib-undefined
148+
-Wl,--unresolved-symbols=ignore-all

0 commit comments

Comments
 (0)