-
Notifications
You must be signed in to change notification settings - Fork 2
Enable Coverity DM CLI #14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | |||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -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 '*' | |||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||
| git config --global --add safe.directory '*' | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE" |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 6 days ago
In general, the fix is to explicitly declare permissions for the workflow or for the individual job, granting only the minimal scopes required. For a build job that just needs to read the repository contents, the appropriate minimal setting is typically contents: read. Additional scopes (like packages: read) should only be added if the job actually needs them (not evident from the snippet), so we keep it to contents: read.
The single best way to fix this, without changing existing behavior, is to add a permissions block to the build-data-model-cli-on-pr job. According to GitHub’s documentation, actions/checkout can operate with contents: read, and there is no code here that requires write access to the repository or to other resources mediated by GITHUB_TOKEN. We therefore insert:
permissions:
contents: readdirectly under the job definition (e.g., below name:), indented to align with other job-level keys. No additional imports or external libraries are needed, as this is purely a workflow configuration change in .github/workflows/native-build.yml.
-
Copy modified lines R12-R13
| @@ -9,6 +9,8 @@ | ||
| jobs: | ||
| build-data-model-cli-on-pr: | ||
| name: Build data-model-cli component in github rdkcentral | ||
| permissions: | ||
| contents: read | ||
| runs-on: ubuntu-latest | ||
| container: | ||
| image: ghcr.io/rdkcentral/docker-rdk-ci:latest |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| [submodule "build_tools_workflows"] | ||
| path = build_tools_workflows | ||
| url = https://github.com/rdkcentral/build_tools_workflows.git | ||
| branch = develop |
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -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) | ||||||||
|
|
||||||||
|
Comment on lines
+3
to
+5
|
||||||||
| 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) | |
| 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) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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" | ||
| } | ||
| } | ||
| } |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file is not specific to component. please get the list from do_compile log of component. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -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 | ||||||
|
||||||
| -DMOCA_DIAGONISTIC | |
| -DMOCA_DIAGNOSTIC |
Copilot
AI
Feb 24, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These linker flags can mask real missing-symbol/linkage problems by allowing unresolved symbols through. If they are required for this native/Coverity flow, consider documenting the rationale here and/or scoping them to only the specific binaries that need them to avoid hiding genuine link errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actions/checkout@v3is outdated; update toactions/checkout@v4to pick up the latest fixes and improvements.