-
Notifications
You must be signed in to change notification settings - Fork 1
RDKB-63154 RDKB-63013 Native Build Integration #10
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f51b60b
RDKB-63013 coverity native build
Suganya-Sugumar 3a5b82a
RDKB-63013 coverity native build
Suganya-Sugumar e631684
RDKB-63154 RDKB-63013 native build integ
Suganya-Sugumar a753489
RDKB-63154 RDKB-63013 cmake corrections
Suganya-Sugumar e78a847
RDKB-63154 RDKB-63013 update coverity scripts
Suganya-Sugumar d8f0eae
RDKB-63154 RDKB-63013 native build integ
Suganya-Sugumar dab446a
RDKB-63154 RDKB-63013 update to build_native for cmake conf
Suganya-Sugumar eeab16e
RDKB-63154 RDKB-63013 Native Build Integration conf update
Suganya-Sugumar c8e65cc
RDKB-63154 RDKB-63013 Native Build Integration
Suganya-Sugumar 48f1d83
RDKB-63154 RDKB-63013 Native Build Integration
Suganya-Sugumar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| branch = develop |
Submodule build_tools_workflows
added at
3d000d
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| # 🔧 Coverity Native Build System for RDK-B Components | ||
|
|
||
| The documentation and source for the RDK-B native build system has been centralized in [rdkcentral/build_tools_workflows](https://github.com/rdkcentral/build_tools_workflows/blob/develop/cov_docker_script/README.md) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| { | ||
| "_comment": "Component Build Configuration for Coverity/Native Builds", | ||
| "_version": "2.0", | ||
| "_description": "Defines dependencies and build settings for the native component", | ||
|
|
||
| "dependencies": { | ||
| "_comment": "External repositories needed by this component", | ||
| "repos": [ | ||
| { | ||
| "name": "rbus", | ||
| "repo": "https://github.com/rdkcentral/rbus.git", | ||
| "branch": "v2.7.0", | ||
| "header_paths": [ | ||
| { "source": "include", "destination": "$HOME/usr/include/rdkb/rbus" }, | ||
| { "source": "src/rbus", "destination": "$HOME/usr/include/rdkb/rbus" }, | ||
| { "source": "src/core", "destination": "$HOME/usr/include/rdkb/rbus" }, | ||
| { "source": "src/rtmessage", "destination": "$HOME/usr/include/rdkb/rtmessage" } | ||
| ], | ||
| "build": { | ||
| "type": "cmake", | ||
| "build_dir": "build", | ||
| "cmake_flags": "-DCMAKE_INSTALL_PREFIX=$HOME/usr -DCMAKE_PREFIX_PATH=/usr -DBUILD_FOR_DESKTOP=ON -DCMAKE_BUILD_TYPE=Debug" | ||
| } | ||
| }, | ||
| { | ||
| "name": "trower-base64", | ||
| "repo": "https://github.com/xmidt-org/trower-base64.git", | ||
| "branch": "v1.2.7", | ||
| "header_paths": [ | ||
| { "source": "include", "destination": "$HOME/usr/include/rdkb" } | ||
| ], | ||
| "build": { | ||
| "type": "commands", | ||
| "commands": [ | ||
| "meson setup build --prefix=$HOME/usr", | ||
| "meson compile -C build" | ||
| ] | ||
| } | ||
| }, | ||
| { | ||
| "name": "common-library", | ||
| "repo": "https://github.com/rdkcentral/common-library.git", | ||
| "branch": "develop", | ||
| "header_paths": [ | ||
| { "source": "source/ccsp/include", "destination": "$HOME/usr/include/rdkb" }, | ||
| { "source": "source/ccsp/components/include", "destination": "$HOME/usr/include/rdkb" }, | ||
| { "source": "source/ccsp/custom", "destination": "$HOME/usr/include/rdkb" }, | ||
| { "source": "source/cosa/include", "destination": "$HOME/usr/include/rdkb" }, | ||
| { "source": "source/cosa/include/linux", "destination": "$HOME/usr/include/rdkb" }, | ||
| { "source": "source/cosa/include/linux", "destination": "$HOME/usr/include/rdkb/linux" }, | ||
| { "source": "source/cosa/package/slap/include", "destination": "$HOME/usr/include/rdkb" }, | ||
| { "source": "source/debug_api/include", "destination": "$HOME/usr/include/rdkb" }, | ||
| { "source": "source/util_api/http/include", "destination": "$HOME/usr/include/rdkb" }, | ||
| { "source": "source/util_api/ansc/include", "destination": "$HOME/usr/include/rdkb" }, | ||
| { "source": "source/ccsp/components/common/MessageBusHelper/include", "destination": "$HOME/usr/include/rdkb" }, | ||
| { "source": "source/dm_pack", "destination": "$HOME/usr/include/rdkb" }, | ||
| { "source": "source/ccsp/components/common/PoamIrepFolder", "destination": "$HOME/usr/include/rdkb" } | ||
| ], | ||
| "source_patches": [ | ||
| { | ||
| "file": "source/ccsp/include/ccsp_message_bus.h", | ||
| "search": "typedef struct _CCSP_MESSAGE_BUS_CONNECTION", | ||
| "replace": "typedef struct DBusLoop DBusLoop;\n\ntypedef struct _CCSP_MESSAGE_BUS_CONNECTION" | ||
| }, | ||
| { | ||
| "file": "$HOME/usr/include/rdkb/ccsp_message_bus.h", | ||
| "search": "typedef struct _CCSP_MESSAGE_BUS_CONNECTION", | ||
| "replace": "typedef struct DBusLoop DBusLoop;\n\ntypedef struct _CCSP_MESSAGE_BUS_CONNECTION" | ||
|
Suganya-Sugumar marked this conversation as resolved.
|
||
| } | ||
| ], | ||
| "build": { | ||
| "type": "script", | ||
| "script": "build_tools_workflows/cov_docker_script/common_external_build.sh" | ||
| } | ||
| }, | ||
| { | ||
| "name": "dbus", | ||
| "repo": "https://github.com/deepin-community/dbus.git", | ||
| "branch" : "master", | ||
|
Suganya-Sugumar marked this conversation as resolved.
|
||
| "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" | ||
|
Suganya-Sugumar marked this conversation as resolved.
|
||
| } | ||
| } | ||
|
Suganya-Sugumar marked this conversation as resolved.
|
||
| ] | ||
| }, | ||
|
|
||
| "native_component": { | ||
| "_comment": "Configuration for the main component being built", | ||
| "name": "javascript-templates", | ||
| "include_path": "$HOME/usr/include/rdkb", | ||
| "lib_output_path": "$HOME/usr/local/lib", | ||
| "build": { | ||
| "type": "cmake", | ||
| "configure_options_file": "cov_docker_script/configure_options.conf" | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # Javascript-templates Configure Options | ||
| # This file contains autotools configure options for the javascript-templates component | ||
| # Each section can be edited independently for better maintainability | ||
|
|
||
| # ============================================================================ | ||
| # CPPFLAGS - Preprocessor flags (includes and defines) | ||
| # ============================================================================ | ||
| [CPPFLAGS] | ||
| # Include paths | ||
| -I$HOME/usr/include/rdkb/ | ||
| -I/usr/include/dbus-1.0 | ||
| -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include | ||
|
|
||
| # ANSC framework defines | ||
| -D_ANSC_USER | ||
| -D_ANSC_LINUX | ||
| -D_ANSC_LITTLE_ENDIAN_ | ||
|
|
||
| # Build system | ||
| -DBUILD_RDK=ON | ||
|
Suganya-Sugumar marked this conversation as resolved.
|
||
|
|
||
| # Standard defines | ||
| -D_GNU_SOURCE | ||
| -D__USE_XOPEN | ||
|
|
||
| # ============================================================================ | ||
| # CFLAGS - Compiler flags | ||
| # ============================================================================ | ||
| [CFLAGS] | ||
| -ffunction-sections | ||
| -fdata-sections | ||
| -fomit-frame-pointer | ||
| -fno-strict-aliasing | ||
|
|
||
| # ============================================================================ | ||
| # LDFLAGS - Linker flags | ||
| # ============================================================================ | ||
| [LDFLAGS] | ||
| -L$HOME/usr/local/lib | ||
| -L/usr/lib/x86_64-linux-gnu | ||
| -Wl,--allow-shlib-undefined | ||
| -Wl,--unresolved-symbols=ignore-all | ||
| -Wl,--no-as-needed | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 6 months ago
In general, this issue is fixed by explicitly specifying a
permissionsblock for the workflow or for individual jobs, restricting theGITHUB_TOKENto the least privileges needed (often justcontents: readfor build/test workflows). This avoids inheriting potentially broad organization or repository defaults.For this specific workflow, the safest and simplest fix without changing behavior is to add a
permissionsblock at the workflow root level (just undername:and beforeon:) or at thejobs.build-jst-on-prlevel. Since the job only checks out code and runs build scripts, it does not need write privileges to the repository; a minimalcontents: readpermission is sufficient. Adding it at the root will apply to all jobs (currently onlybuild-jst-on-pr). No imports or additional methods are needed because this is a YAML configuration change only.Concretely, in
.github/workflows/native-build.yml, insert:between line 1 (
name: ...) and line 3 (on:). This will constrain the defaultGITHUB_TOKEN(if used in the future) to read-only repository contents, while leaving the existing use ofsecrets.RDKCM_RDKEunchanged.